Changeset 39737 in webkit for trunk/JavaScriptCore/bytecompiler


Ignore:
Timestamp:
Jan 8, 2009, 9:41:01 PM (16 years ago)
Author:
[email protected]
Message:

2009-01-08 Sam Weinig <[email protected]>

Revert r39720. It broke Interpreted mode.

Location:
trunk/JavaScriptCore/bytecompiler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r39720 r39737  
    116116
    117117#ifndef NDEBUG
    118 static bool s_dumpsGeneratedCode = false;
     118bool BytecodeGenerator::s_dumpsGeneratedCode = false;
    119119#endif
    120120
     
    212212    : m_shouldEmitDebugHooks(!!debugger)
    213213    , m_shouldEmitProfileHooks(scopeChain.globalObject()->supportsProfiling())
     214    , m_regeneratingForExceptionInfo(false)
    214215    , m_scopeChain(&scopeChain)
    215216    , m_symbolTable(symbolTable)
     
    225226    , m_lastOpcodeID(op_end)
    226227    , m_emitNodeDepth(0)
    227     , m_regeneratingForExceptionInfo(false)
    228     , m_codeBlockBeingRegeneratedFrom(0)
    229228{
    230229    if (m_shouldEmitDebugHooks)
     
    296295    : m_shouldEmitDebugHooks(!!debugger)
    297296    , m_shouldEmitProfileHooks(scopeChain.globalObject()->supportsProfiling())
     297    , m_regeneratingForExceptionInfo(false)
    298298    , m_scopeChain(&scopeChain)
    299299    , m_symbolTable(symbolTable)
     
    307307    , m_lastOpcodeID(op_end)
    308308    , m_emitNodeDepth(0)
    309     , m_regeneratingForExceptionInfo(false)
    310     , m_codeBlockBeingRegeneratedFrom(0)
    311309{
    312310    if (m_shouldEmitDebugHooks)
     
    369367    : m_shouldEmitDebugHooks(!!debugger)
    370368    , m_shouldEmitProfileHooks(scopeChain.globalObject()->supportsProfiling())
     369    , m_regeneratingForExceptionInfo(false)
    371370    , m_scopeChain(&scopeChain)
    372371    , m_symbolTable(symbolTable)
     
    376375    , m_finallyDepth(0)
    377376    , m_dynamicScopeDepth(0)
    378     , m_baseScopeDepth(codeBlock->baseScopeDepth())
     377    , m_baseScopeDepth(scopeChain.localDepth())
    379378    , m_codeType(EvalCode)
    380379    , m_globalData(&scopeChain.globalObject()->globalExec()->globalData())
    381380    , m_lastOpcodeID(op_end)
    382381    , m_emitNodeDepth(0)
    383     , m_regeneratingForExceptionInfo(false)
    384     , m_codeBlockBeingRegeneratedFrom(0)
    385382{
    386383    if (m_shouldEmitDebugHooks || m_baseScopeDepth)
     
    995992    }
    996993
     994    if (index != missingSymbolMarker()) {
     995        // Directly index the property lookup across multiple scopes.  Yay!
     996        return emitGetScopedVar(dst, depth, index, globalObject);
     997    }
     998
    997999    if (globalObject) {
    998         bool forceGlobalResolve = false;
    999         if (m_regeneratingForExceptionInfo) {
    10001000#if ENABLE(JIT)
    1001             forceGlobalResolve = m_codeBlockBeingRegeneratedFrom->hasGlobalResolveInfoAtBytecodeOffset(instructions().size());
    1002 #else
    1003             forceGlobalResolve = m_codeBlockBeingRegeneratedFrom->hasGlobalResolveInstructionAtBytecodeOffset(instructions().size());
    1004 #endif
    1005         }
    1006 
    1007         if (index != missingSymbolMarker() && !forceGlobalResolve) {
    1008             // Directly index the property lookup across multiple scopes.
    1009             return emitGetScopedVar(dst, depth, index, globalObject);
    1010         }
    1011 
    1012 #if ENABLE(JIT)
    1013         m_codeBlock->addGlobalResolveInfo(instructions().size());
     1001        m_codeBlock->addGlobalResolveInfo();
    10141002#else
    10151003        m_codeBlock->addGlobalResolveInstruction(instructions().size());
     
    10241012    }
    10251013
    1026     if (index != missingSymbolMarker()) {
    1027         // Directly index the property lookup across multiple scopes.
    1028         return emitGetScopedVar(dst, depth, index, globalObject);
    1029     }
    1030 
    10311014    // In this case we are at least able to drop a few scope chains from the
    10321015    // lookup chain, although we still need to hash from then on.
     
    10411024{
    10421025    if (globalObject) {
     1026        // op_get_global_var must be the same length as op_resolve_global.
    10431027        emitOpcode(op_get_global_var);
    10441028        instructions().append(dst->index());
    10451029        instructions().append(asCell(globalObject));
    10461030        instructions().append(index);
     1031        instructions().append(0);
     1032        instructions().append(0);
    10471033        return dst;
    10481034    }
  • trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.h

    r39720 r39737  
    330330        CodeType codeType() const { return m_codeType; }
    331331
    332         void setRegeneratingForExceptionInfo(CodeBlock* originalCodeBlock)
    333         {
    334             m_regeneratingForExceptionInfo = true;
    335             m_codeBlockBeingRegeneratedFrom = originalCodeBlock;
    336         }
     332        void setRegeneratingForExceptionInfo() { m_regeneratingForExceptionInfo = true; }
    337333
    338334    private:
     
    426422        bool m_shouldEmitDebugHooks;
    427423        bool m_shouldEmitProfileHooks;
     424
     425        bool m_regeneratingForExceptionInfo;
    428426
    429427        const ScopeChain* m_scopeChain;
     
    468466        OpcodeID m_lastOpcodeID;
    469467
     468#ifndef NDEBUG
     469        static bool s_dumpsGeneratedCode;
     470#endif
     471
    470472        unsigned m_emitNodeDepth;
    471 
    472         bool m_regeneratingForExceptionInfo;
    473         CodeBlock* m_codeBlockBeingRegeneratedFrom;
    474473
    475474        static const unsigned s_maxEmitNodeDepth = 10000;
Note: See TracChangeset for help on using the changeset viewer.