Changeset 112320 in webkit for trunk/Source/JavaScriptCore


Ignore:
Timestamp:
Mar 27, 2012, 2:54:40 PM (13 years ago)
Author:
[email protected]
Message:

DFG OSR exit should not generate an exit for variables of inlinees if the
inlinees are not in scope
https://bugs.webkit.org/show_bug.cgi?id=82312

Reviewed by Oliver Hunt.

  • bytecode/CodeBlock.h:

(JSC::baselineCodeBlockForInlineCallFrame):
(JSC):
(JSC::baselineCodeBlockForOriginAndBaselineCodeBlock):

  • dfg/DFGOSRExit.cpp:

(JSC::DFG::computeNumVariablesForCodeOrigin):
(DFG):
(JSC::DFG::OSRExit::OSRExit):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r112313 r112320  
     12012-03-27  Filip Pizlo  <[email protected]>
     2
     3        DFG OSR exit should not generate an exit for variables of inlinees if the
     4        inlinees are not in scope
     5        https://bugs.webkit.org/show_bug.cgi?id=82312
     6
     7        Reviewed by Oliver Hunt.
     8       
     9        * bytecode/CodeBlock.h:
     10        (JSC::baselineCodeBlockForInlineCallFrame):
     11        (JSC):
     12        (JSC::baselineCodeBlockForOriginAndBaselineCodeBlock):
     13        * dfg/DFGOSRExit.cpp:
     14        (JSC::DFG::computeNumVariablesForCodeOrigin):
     15        (DFG):
     16        (JSC::DFG::OSRExit::OSRExit):
     17
    1182012-03-27  Matt Lilek  <[email protected]>
    219
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.h

    r109705 r112320  
    13861386    };
    13871387
     1388    inline CodeBlock* baselineCodeBlockForInlineCallFrame(InlineCallFrame* inlineCallFrame)
     1389    {
     1390        ASSERT(inlineCallFrame);
     1391        ExecutableBase* executable = inlineCallFrame->executable.get();
     1392        ASSERT(executable->structure()->classInfo() == &FunctionExecutable::s_info);
     1393        return static_cast<FunctionExecutable*>(executable)->baselineCodeBlockFor(inlineCallFrame->isCall ? CodeForCall : CodeForConstruct);
     1394    }
     1395   
    13881396    inline CodeBlock* baselineCodeBlockForOriginAndBaselineCodeBlock(const CodeOrigin& codeOrigin, CodeBlock* baselineCodeBlock)
    13891397    {
    1390         if (codeOrigin.inlineCallFrame) {
    1391             ExecutableBase* executable = codeOrigin.inlineCallFrame->executable.get();
    1392             ASSERT(executable->structure()->classInfo() == &FunctionExecutable::s_info);
    1393             return static_cast<FunctionExecutable*>(executable)->baselineCodeBlockFor(codeOrigin.inlineCallFrame->isCall ? CodeForCall : CodeForConstruct);
    1394         }
     1398        if (codeOrigin.inlineCallFrame)
     1399            return baselineCodeBlockForInlineCallFrame(codeOrigin.inlineCallFrame);
    13951400        return baselineCodeBlock;
    13961401    }
  • trunk/Source/JavaScriptCore/dfg/DFGOSRExit.cpp

    r108677 r112320  
    3434namespace JSC { namespace DFG {
    3535
     36static unsigned computeNumVariablesForCodeOrigin(
     37    CodeBlock* codeBlock, const CodeOrigin& codeOrigin)
     38{
     39    if (!codeOrigin.inlineCallFrame)
     40        return codeBlock->m_numCalleeRegisters;
     41    return
     42        codeOrigin.inlineCallFrame->stackOffset +
     43        baselineCodeBlockForInlineCallFrame(codeOrigin.inlineCallFrame)->m_numCalleeRegisters;
     44}
     45
    3646OSRExit::OSRExit(ExitKind kind, JSValueSource jsValueSource, MethodOfGettingAValueProfile valueProfile, MacroAssembler::Jump check, SpeculativeJIT* jit, unsigned recoveryIndex)
    3747    : m_jsValueSource(jsValueSource)
     
    4454    , m_count(0)
    4555    , m_arguments(jit->m_arguments.size())
    46     , m_variables(jit->m_variables.size())
     56    , m_variables(computeNumVariablesForCodeOrigin(jit->m_jit.graph().m_profiledBlock, jit->m_codeOriginForOSR))
    4757    , m_lastSetOperand(jit->m_lastSetOperand)
    4858{
Note: See TracChangeset for help on using the changeset viewer.