Parent: #493 Related: #496, #539, #460, #461
Problem
Parser.checkPrivateNames compares each private class member against every earlier member. A class with N distinct private fields therefore performs O(N²) exact-name comparisons before execution, giving attacker-controlled source a deterministic parser CPU denial-of-service surface and obscuring the allocation work isolated in #539.
Scope
- Add parser-only 1K/2K/4K private-member growth rows with exact decoded member-name/index checks plus duplicate and accessor-pair controls.
- Replace the nested scan with a collision-independent deterministic index/order that gives a declared O(N log N) or better bound without weakening exact byte equality.
- Preserve the sole allowed duplicate form: one complementary private getter/setter pair at the same static/instance placement.
- Preserve rejection of fields/method duplicates, get/get, set/set, third declarations, static/instance splits, and
#constructor.
Security and correctness
- Do not rely on predictable hash placement for attacker-controlled names; exact bytes decide groups.
- Transient index storage must use freeable parser scratch backing and be released on success and every error.
- Allocation failure must propagate atomically; no member state may be published before validation completes.
- Do not impose an arbitrary private-member limit, skip early errors, special-case benchmark names, or change source order.
Acceptance
- Benchmark source and exact member-name/semantic controls land before parser changes.
- 1K/2K/4K work evidence proves the declared bound and materially reduces exact-parent CPU/instructions.
- Every allowed/rejected getter/setter/field/method/static/constructor combination and OOM boundary is covered.
- Parser/frontend suites, class/private-name test262, forced tree-walker/VM/eval paths, full units, TSan, and sanitizer gates pass without regressions.
Blocks: #539