mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
4922141d0a
## Summary
Fix private-name mangling for `get #x()` / `set #x(value)` accessor pairs.
JavaScript treats an accessor pair as one private name, but the mangler previously assigned a candidate per element before collecting into a name-keyed map. The setter overwrote the getter’s mapping, while still consuming an extra candidate.
### Before
```js
class Outer {
get #x() {}
set #x(value) {}
#longName;
nested() {
return class {
#nestedName;
};
}
}
```
```js
class Outer {
get #t() {}
set #t(e) {}
#n;
nested() {
return class {
#r;
};
}
}
```
### After
```js
class Outer {
get #e() {}
set #e(e) {}
#t;
nested() {
return class {
#n;
};
}
}
```
## Implementation
- Deduplicate private names during map construction with `HashMap::entry`.
- Derive nested-class offsets from already-built lexical parent mappings, preserving collision avoidance.
- Pre-size mappings from the number of private elements.
77 lines
1.7 KiB
YAML
77 lines
1.7 KiB
YAML
checker.ts:
|
|
file size: 2922154 # 2.92 MB
|
|
sys allocs: 150
|
|
sys reallocs: 5
|
|
sys deallocs: 150
|
|
sys alloc bytes: 14996600 # 15.00 MB
|
|
sys peak growth: 10169560 # 10.17 MB
|
|
arena allocs: 148428
|
|
arena reallocs: 28468
|
|
arena size: 19204712 # 19.20 MB
|
|
|
|
App.tsx:
|
|
file size: 415342 # 415.34 kB
|
|
sys allocs: 61
|
|
sys reallocs: 8
|
|
sys deallocs: 61
|
|
sys alloc bytes: 2128555 # 2.13 MB
|
|
sys peak growth: 1612427 # 1.61 MB
|
|
arena allocs: 16046
|
|
arena reallocs: 2721
|
|
arena size: 2887488 # 2.89 MB
|
|
|
|
RadixUIAdoptionSection.jsx:
|
|
file size: 2520 # 2.52 kB
|
|
sys allocs: 21
|
|
sys reallocs: 0
|
|
sys deallocs: 21
|
|
sys alloc bytes: 17400 # 17.40 kB
|
|
sys peak growth: 11628 # 11.63 kB
|
|
arena allocs: 30
|
|
arena reallocs: 6
|
|
arena size: 35632 # 35.63 kB
|
|
|
|
pdf.mjs:
|
|
file size: 567296 # 567.30 kB
|
|
sys allocs: 2427
|
|
sys reallocs: 205
|
|
sys deallocs: 2427
|
|
sys alloc bytes: 5334247 # 5.33 MB
|
|
sys peak growth: 3693355 # 3.69 MB
|
|
arena allocs: 45881
|
|
arena reallocs: 7718
|
|
arena size: 6326224 # 6.33 MB
|
|
|
|
antd.js:
|
|
file size: 6686316 # 6.69 MB
|
|
sys allocs: 1038
|
|
sys reallocs: 56
|
|
sys deallocs: 1038
|
|
sys alloc bytes: 29976031 # 29.98 MB
|
|
sys peak growth: 19934725 # 19.93 MB
|
|
arena allocs: 371736
|
|
arena reallocs: 76289
|
|
arena size: 49111064 # 49.11 MB
|
|
|
|
binder.ts:
|
|
file size: 193077 # 193.08 kB
|
|
sys allocs: 33
|
|
sys reallocs: 1
|
|
sys deallocs: 33
|
|
sys alloc bytes: 963008 # 963.01 kB
|
|
sys peak growth: 657404 # 657.40 kB
|
|
arena allocs: 7032
|
|
arena reallocs: 842
|
|
arena size: 1167360 # 1.17 MB
|
|
|
|
kitchen-sink.tsx:
|
|
file size: 732898 # 732.90 kB
|
|
sys allocs: 1854
|
|
sys reallocs: 174
|
|
sys deallocs: 1854
|
|
sys alloc bytes: 5307512 # 5.31 MB
|
|
sys peak growth: 3707425 # 3.71 MB
|
|
arena allocs: 66771
|
|
arena reallocs: 12252
|
|
arena size: 9424360 # 9.42 MB
|