Commit graph

13 commits

Author SHA1 Message Date
branchseer
ac4f98e376
refactor(span): derive Copy on Atom (#8596)
Follow up from
https://github.com/oxc-project/oxc/pull/8543#discussion_r1918592423

> I agree. https://github.com/oxc-project/backlog/issues/155

> Originally we were considering some form of interning and
reference-counting, so we didn't make it Copy to leave the door open for
that. But now all strings are stored in the arena anyway, so even if we
did decide to intern strings, reference-counting would be irrelevant -
our bump allocator doesn't allow freeing individual allocations anyway.

Most of the changes are done automatically by `just fix` (`cargo clippy
--fix` && `cargo fmt --all`). See the commit list for the manual edits.
2025-01-19 16:14:23 +08:00
Boshen
2736657dcd perf(semantic): allocate UnresolvedReferences in allocator (#8046) 2024-12-20 15:18:16 +00:00
Boshen
414e8285cd perf(semantic): allocate symbol data in Allocator (#8012) 2024-12-20 14:13:41 +00:00
Boshen
7aebed012d perf(semantic): allocate Bindings in allocator (#8021) 2024-12-19 15:16:03 +00:00
Boshen
02f968d02d refactor(semantic): change Bindings to a plain FxHashMap (#8019)
`IndexMap` was needed for the insertion order requirement in mangler.

Bindings (symbol ids) are monotonically increasing by binding
positions, which means we can get insertion order by sorting the symbol ids in
mangler.

Previous attempt: https://github.com/oxc-project/oxc/pull/4228
2024-12-19 14:16:28 +00:00
Boshen
ed75e42ed6 refactor(semantic)!: make SymbolTable fields pub(crate) instead of pub (#7999)
SymbolTable needs some internal changes.
2024-12-18 16:38:58 +00:00
overlookmotel
3858221f45 refactor(global): sort imports (#7883)
Pure refactor. Re-order imports for clarity:

1. `std`
2. External crates
3. `oxc_*` crates
4. Current crate `use crate::...`
5. Super `use super::...`
6. Local modules

This order is from "furthest away" to "closest". This makes it clearer to see what is coming from where.

`cargo +nightly fmt` (#7877) did a lot of the work, but unfortunately `rustfmt` does not have an option to (a) put workspace crates in a separate block from external crates and (b) move `mod` statements to after `use` statements.
2024-12-14 15:07:21 +00:00
Boshen
7fb9d47460 style(rust): cargo +nightly fmt (#7877) 2024-12-14 06:03:31 +00:00
Boshen
d942a8d41a
chore: Rust v1.83.0 changes (#7535)
This PR does not upgrade rustc. Only changes are applied.

We cannot upgrade to the lastet Rust version yet due to wasm-bindgen
breaking some generated types.

THere's also some elided lifetimes in `**/generated/**`, which requires
modification to ast tools.
2024-11-29 11:59:45 +08:00
overlookmotel
d21448bf65 refactor(semantic, transformer): simplify FxIndexMap type aliases (#7524)
Pure refactor. Simplify `FxIndexMap` type aliases by using `rustc_hash`'s `FxBuildHasher`, instead of longhand `BuildHasherDefault<FxHasher>`.
2024-11-28 12:01:17 +00:00
Boshen
423d54cb74 refactor(rust): remove the annoying clippy::wildcard_imports (#6860) 2024-10-24 13:57:19 +00:00
Boshen
2b7be08af4 feat(ast)! add source_text to Program (#6444) 2024-10-11 04:13:41 +00:00
overlookmotel
e19deaa102 ci(transformer): move post-transform checker to tasks crate (#6288)
Move post-transform checker into a `tasks` crate. It doesn't feel like it belongs in `oxc_semantic`. It also feels like too heavy a lump of code to put in `tasks/common`.
2024-10-05 14:48:37 +00:00