Ignore:
Timestamp:
Aug 20, 2009, 9:21:01 PM (16 years ago)
Author:
[email protected]
Message:

REGRESSION: fast/profiler/call.html is crashing occasionally
https://bugs.webkit.org/show_bug.cgi?id=28476

Reviewed by Gavin Barraclough.

Using the codeblock for information about how many parameters and
locals a function has is unsafe in certain circumstances. The
basic scenario is all function code being cleared in response to
the debugger or profiler being enabled, and then an activation is
marked before its associated function is re-executed.

To deal with this scenario we store the variable count of a function
directly in the FunctionExecutable, and then use that information.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/Arguments.h

    r47412 r47620  
    116116    {
    117117        function = callFrame->callee();
    118    
    119         CodeBlock* codeBlock = &function->executable()->generatedBytecode();
    120         int numParameters = codeBlock->m_numParameters;
     118
     119        int numParameters = function->executable()->parameterCount();
    121120        argc = callFrame->argumentCount();
    122121
    123122        if (argc <= numParameters)
    124             argv = callFrame->registers() - RegisterFile::CallFrameHeaderSize - numParameters + 1; // + 1 to skip "this"
     123            argv = callFrame->registers() - RegisterFile::CallFrameHeaderSize - numParameters;
    125124        else
    126             argv = callFrame->registers() - RegisterFile::CallFrameHeaderSize - numParameters - argc + 1; // + 1 to skip "this"
     125            argv = callFrame->registers() - RegisterFile::CallFrameHeaderSize - numParameters - argc;
    127126
    128127        argc -= 1; // - 1 to skip "this"
    129         firstParameterIndex = -RegisterFile::CallFrameHeaderSize - numParameters + 1; // + 1 to skip "this"
     128        firstParameterIndex = -RegisterFile::CallFrameHeaderSize - numParameters;
    130129    }
    131130
Note: See TracChangeset for help on using the changeset viewer.