Closed Bug 501218 Opened 15 years ago Closed 15 years ago

Delay importing values into Arguments objects

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 495061

People

(Reporter: dmandelin, Unassigned)

Details

Background:

The |arguments| JS language feature is implemented by creating an object of class js_ArgumentsClass. While the callee function is active, the class simply points to the stack frame and reads/writes property values from there. When the callee function returns, js_PutArgsObject (or js_PutArguments if on trace) imports the values into the object by creating properties with JS_DefineProperty for callee, length, and each argument index.

The Proposal:

I assume that |arguments| objects are rarely used after the callee returns. If so, then it is best to minimal importing work when the function returns, and import the values as full properties only if required. The on-return work would be simply copying the arguments from their current location into a new buffer and possibly setting a flag so the getters know where the values are.
Just use reserved dslots in the arguments object, a la js_PutCallObject and js_CallClass.

/be
This is a dup of 495061.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.