Changeset 120989 in webkit for trunk/Source/JavaScriptCore


Ignore:
Timestamp:
Jun 21, 2012, 6:33:30 PM (13 years ago)
Author:
[email protected]
Message:

op_resolve_global should not prevent DFG inlining
https://bugs.webkit.org/show_bug.cgi?id=89726

Reviewed by Gavin Barraclough.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::shrinkToFit):

  • bytecode/GlobalResolveInfo.h:

(JSC::GlobalResolveInfo::GlobalResolveInfo):
(GlobalResolveInfo):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):

  • dfg/DFGCapabilities.h:

(JSC::DFG::canInlineOpcode):

  • dfg/DFGOperations.cpp:
  • dfg/DFGOperations.h:
  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::callOperation):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

Location:
trunk/Source/JavaScriptCore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r120974 r120989  
     12012-06-21  Filip Pizlo  <[email protected]>
     2
     3        op_resolve_global should not prevent DFG inlining
     4        https://bugs.webkit.org/show_bug.cgi?id=89726
     5
     6        Reviewed by Gavin Barraclough.
     7
     8        * bytecode/CodeBlock.cpp:
     9        (JSC::CodeBlock::CodeBlock):
     10        (JSC::CodeBlock::shrinkToFit):
     11        * bytecode/GlobalResolveInfo.h:
     12        (JSC::GlobalResolveInfo::GlobalResolveInfo):
     13        (GlobalResolveInfo):
     14        * dfg/DFGByteCodeParser.cpp:
     15        (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
     16        * dfg/DFGCapabilities.h:
     17        (JSC::DFG::canInlineOpcode):
     18        * dfg/DFGOperations.cpp:
     19        * dfg/DFGOperations.h:
     20        * dfg/DFGSpeculativeJIT.h:
     21        (JSC::DFG::SpeculativeJIT::callOperation):
     22        * dfg/DFGSpeculativeJIT32_64.cpp:
     23        (JSC::DFG::SpeculativeJIT::compile):
     24        * dfg/DFGSpeculativeJIT64.cpp:
     25        (JSC::DFG::SpeculativeJIT::compile):
     26
    1272012-06-20  Filip Pizlo  <[email protected]>
    228
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r120897 r120989  
    15841584    , m_sourceOffset(other.m_sourceOffset)
    15851585#if ENABLE(JIT)
    1586     , m_globalResolveInfos(other.m_globalResolveInfos)
     1586    , m_globalResolveInfos(other.m_globalResolveInfos.size())
    15871587#endif
    15881588#if ENABLE(VALUE_PROFILER)
     
    16091609    optimizeAfterWarmUp();
    16101610    jitAfterWarmUp();
     1611
     1612#if ENABLE(JIT)
     1613    for (unsigned i = m_globalResolveInfos.size(); i--;)
     1614        m_globalResolveInfos[i] = GlobalResolveInfo(other.m_globalResolveInfos[i].bytecodeOffset);
     1615#endif
    16111616
    16121617    if (other.m_rareData) {
     
    22742279#if ENABLE(JIT)
    22752280    m_structureStubInfos.shrinkToFit();
    2276     m_globalResolveInfos.shrinkToFit();
     2281    if (shrinkMode == EarlyShrink)
     2282        m_globalResolveInfos.shrinkToFit();
    22772283    m_callLinkInfos.shrinkToFit();
    22782284    m_methodCallLinkInfos.shrinkToFit();
  • trunk/Source/JavaScriptCore/bytecode/GlobalResolveInfo.h

    r120897 r120989  
    3232
    3333struct GlobalResolveInfo {
     34    GlobalResolveInfo() { }
     35   
    3436    GlobalResolveInfo(unsigned bytecodeOffset)
    3537        : offset(0)
     
    4042    WriteBarrier<Structure> structure;
    4143    unsigned offset;
    42     unsigned bytecodeOffset;
     44    unsigned bytecodeOffset; // Only valid in old JIT code. This means nothing in the DFG.
    4345};
    4446
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r120974 r120989  
    31733173            m_constantRemap[i] = result.iterator->second;
    31743174        }
     3175        for (unsigned i = 0; i < codeBlock->numberOfGlobalResolveInfos(); ++i)
     3176            byteCodeParser->m_codeBlock->addGlobalResolveInfo(std::numeric_limits<unsigned>::max());
    31753177       
    31763178        m_callsiteBlockHeadNeedsLinking = true;
  • trunk/Source/JavaScriptCore/dfg/DFGCapabilities.h

    r120244 r120989  
    194194    case op_resolve:
    195195    case op_resolve_base:
    196     case op_resolve_global:
    197196       
    198197    // Constant buffers aren't copied correctly. This is easy to fix, but for
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp

    r120244 r120989  
    969969}
    970970
    971 EncodedJSValue DFG_OPERATION operationResolveGlobal(ExecState* exec, GlobalResolveInfo* resolveInfo, Identifier* propertyName)
    972 {
    973     JSGlobalData* globalData = &exec->globalData();
    974     NativeCallFrameTracer tracer(globalData, exec);
    975    
    976     JSGlobalObject* globalObject = exec->lexicalGlobalObject();
    977 
     971EncodedJSValue DFG_OPERATION operationResolveGlobal(ExecState* exec, GlobalResolveInfo* resolveInfo, JSGlobalObject* globalObject, Identifier* propertyName)
     972{
     973    JSGlobalData* globalData = &exec->globalData();
     974    NativeCallFrameTracer tracer(globalData, exec);
     975   
    978976    PropertySlot slot(globalObject);
    979977    if (globalObject->getPropertySlot(exec, *propertyName, slot)) {
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.h

    r120244 r120989  
    6666typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_ECI)(ExecState*, JSCell*, Identifier*);
    6767typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_ECJ)(ExecState*, JSCell*, EncodedJSValue);
    68 typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_EGI)(ExecState*, GlobalResolveInfo*, Identifier*);
     68typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_EGriJsgI)(ExecState*, GlobalResolveInfo*, JSGlobalObject*, Identifier*);
    6969typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_EI)(ExecState*, Identifier*);
    7070typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_EJ)(ExecState*, EncodedJSValue);
     
    122122EncodedJSValue DFG_OPERATION operationResolveBase(ExecState*, Identifier*) WTF_INTERNAL;
    123123EncodedJSValue DFG_OPERATION operationResolveBaseStrictPut(ExecState*, Identifier*) WTF_INTERNAL;
    124 EncodedJSValue DFG_OPERATION operationResolveGlobal(ExecState*, GlobalResolveInfo*, Identifier*) WTF_INTERNAL;
     124EncodedJSValue DFG_OPERATION operationResolveGlobal(ExecState*, GlobalResolveInfo*, JSGlobalObject*, Identifier*) WTF_INTERNAL;
    125125EncodedJSValue DFG_OPERATION operationToPrimitive(ExecState*, EncodedJSValue) WTF_INTERNAL;
    126126EncodedJSValue DFG_OPERATION operationStrCat(ExecState*, void*, size_t) WTF_INTERNAL;
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h

    r120834 r120989  
    12301230        return call;
    12311231    }
    1232     JITCompiler::Call callOperation(J_DFGOperation_EGI operation, GPRReg result, GPRReg arg1, Identifier* identifier)
    1233     {
    1234         m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(identifier));
     1232    JITCompiler::Call callOperation(J_DFGOperation_EGriJsgI operation, GPRReg result, GPRReg arg1, GPRReg arg2, Identifier* identifier)
     1233    {
     1234        m_jit.setupArgumentsWithExecState(arg1, arg2, TrustedImmPtr(identifier));
    12351235        return appendCallWithExceptionCheckSetResult(operation, result);
    12361236    }
     
    14831483        return appendCallWithExceptionCheckSetResult(operation, resultPayload, resultTag);
    14841484    }
    1485     JITCompiler::Call callOperation(J_DFGOperation_EGI operation, GPRReg resultTag, GPRReg resultPayload, GPRReg arg1, Identifier* identifier)
    1486     {
    1487         m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(identifier));
     1485    JITCompiler::Call callOperation(J_DFGOperation_EGriJsgI operation, GPRReg resultTag, GPRReg resultPayload, GPRReg arg1, GPRReg arg2, Identifier* identifier)
     1486    {
     1487        m_jit.setupArgumentsWithExecState(arg1, arg2, TrustedImmPtr(identifier));
    14881488        return appendCallWithExceptionCheckSetResult(operation, resultPayload, resultTag);
    14891489    }
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp

    r120500 r120989  
    38413841            slowPathCall(
    38423842                structuresNotMatch, this, operationResolveGlobal,
    3843                 JSValueRegs(resultTagGPR, resultPayloadGPR), resolveInfoGPR,
     3843                JSValueRegs(resultTagGPR, resultPayloadGPR), resolveInfoGPR, globalObjectGPR,
    38443844                &m_jit.codeBlock()->identifier(data.identifierNumber)));
    38453845
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp

    r120499 r120989  
    38443844        m_jit.load32(JITCompiler::Address(resolveInfoGPR, OBJECT_OFFSETOF(GlobalResolveInfo, offset)), resolveInfoGPR);
    38453845        m_jit.loadPtr(JITCompiler::BaseIndex(resultGPR, resolveInfoGPR, JITCompiler::ScalePtr), resultGPR);
    3846 
     3846       
    38473847        addSlowPathGenerator(
    38483848            slowPathCall(
    38493849                structuresDontMatch, this, operationResolveGlobal,
    3850                 resultGPR, resolveInfoGPR,
     3850                resultGPR, resolveInfoGPR, globalObjectGPR,
    38513851                &m_jit.codeBlock()->identifier(data.identifierNumber)));
    38523852
Note: See TracChangeset for help on using the changeset viewer.