Pool Proxy trap argument arrays#2675
Merged
Merged
Conversation
CallTrap now rents the trap argument array from the engine's JsValueArrayPool and returns it after the call, following the interpreter call-site pattern (no finally: an exception lets the array fall to the GC, and JsArguments.Materialize protects arrays captured by the callee). The set trap needs four arguments (target, key, value, receiver), so the pool gains a size-4 bucket. Two existing size-4 rent/return sites in IntrinsicTypedArrayPrototype start benefiting as well - until now RentArray(4) always allocated and ReturnArray(4) was a silent no-op. ProxyBenchmark on the same base commit (control vs this change): time flat within run noise, allocations on trapped operations drop to the JS-call floor: | Lane | Allocated | |-------------- |-----------------------------:| | TrapGet | 4,689 KB -> 1.3 KB | | TrapHas | 3,908 KB -> 1.3 KB | | TrapSet | 8,275 KB -> 2,806 KB (-66%) | | ApplyTrap | 25,143 KB -> 20,455 KB (-19%)| | ConstructTrap | 3,048 KB -> 2,579 KB (-15%) | | OwnKeysTrap | -313 KB | Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EsHuKuE4UihKZp5HYapDHE
lahma
enabled auto-merge (squash)
July 13, 2026 18:32
This was referenced Jul 13, 2026
This was referenced Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2674.
CallTrapnow rents the trap argument array fromJsValueArrayPooland returns it after the call — the same rent/call/return contract as the interpreter call sites (JintCallExpression), withJsArguments.Materializeprotecting arrays captured by the callee.The
settrap takes four arguments (target, key, value, receiver), so the pool gains a size-4 bucket. Bonus: the two existingRentArray(4)/ReturnArraysites inIntrinsicTypedArrayPrototype(sortcomparers etc.) start actually pooling — until now size-4 rents always allocated and returns were silent no-ops.ProxyBenchmark, control vs change on the same base commit (time flat within run noise; allocation is the win):
Verification: full test262 suite green (99,429 passed / 0 failed), full Jint.Tests + PublicInterface green, ProxyTests 43/43.
🤖 Generated with Claude Code
https://claude.ai/code/session_01EsHuKuE4UihKZp5HYapDHE