Ignore:
Timestamp:
Jan 18, 2011, 6:37:59 PM (15 years ago)
Author:
[email protected]
Message:

2011-01-18 Oliver Hunt <[email protected]>

Reviewed by Gavin Barraclough.

[jsfunfuzz] Assertion asking activation for arguments when arguments is overridden
https://bugs.webkit.org/show_bug.cgi?id=52690

Add a few more tests.

  • fast/js/function-dot-arguments-expected.txt:
  • fast/js/script-tests/function-dot-arguments.js: (overwroteArgumentsInDynamicScope1): (overwroteArgumentsInDynamicScope2): (overwroteArgumentsInDynamicScope3):

2011-01-18 Oliver Hunt <[email protected]>

Reviewed by Gavin Barraclough.

[jsfunfuzz] Assertion asking activation for arguments when arguments is overridden
https://bugs.webkit.org/show_bug.cgi?id=52690

Clean up code to retrieve arguments from activation and function objects.
Remove the incorrect assertion from JSActivation's argumentsGetter.

  • interpreter/Interpreter.cpp: (JSC::Interpreter::retrieveArguments):
  • runtime/JSActivation.cpp: (JSC::JSActivation::argumentsGetter):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSActivation.cpp

    r76078 r76090  
    204204    CallFrame* callFrame = CallFrame::create(activation->d()->registers);
    205205    int argumentsRegister = activation->d()->functionExecutable->generatedBytecode().argumentsRegister();
    206     if (!callFrame->uncheckedR(argumentsRegister).jsValue()) {
    207         JSValue arguments = JSValue(new (callFrame) Arguments(callFrame));
    208         callFrame->uncheckedR(argumentsRegister) = arguments;
    209         callFrame->uncheckedR(unmodifiedArgumentsRegister(argumentsRegister)) = arguments;
    210     }
    211 
    212     ASSERT(callFrame->uncheckedR(argumentsRegister).jsValue().inherits(&Arguments::info));
    213     return callFrame->uncheckedR(argumentsRegister).jsValue();
     206    if (JSValue arguments = callFrame->uncheckedR(argumentsRegister).jsValue())
     207        return arguments;
     208    int realArgumentsRegister = unmodifiedArgumentsRegister(argumentsRegister);
     209
     210    JSValue arguments = JSValue(new (callFrame) Arguments(callFrame));
     211    callFrame->uncheckedR(argumentsRegister) = arguments;
     212    callFrame->uncheckedR(realArgumentsRegister) = arguments;
     213   
     214    ASSERT(callFrame->uncheckedR(realArgumentsRegister).jsValue().inherits(&Arguments::info));
     215    return callFrame->uncheckedR(realArgumentsRegister).jsValue();
    214216}
    215217
Note: See TracChangeset for help on using the changeset viewer.