Changeset 37086 in webkit for trunk/JavaScriptCore/VM/Machine.cpp


Ignore:
Timestamp:
Sep 29, 2008, 5:46:25 PM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2008-09-29 Geoffrey Garen <[email protected]>

Reviewed by Cameron Zwarich.


Store the callee ScopeChain, not the caller ScopeChain, in the call frame
header. Nix the "scopeChain" local variable and ExecState::m_scopeChain, and
access the callee ScopeChain through the call frame header instead.

Profit: call + return are simpler, because they don't have to update the
"scopeChain" local variable, or ExecState::m_scopeChain.


Because CTI keeps "r" in a register, reading the callee ScopeChain relative
to "r" can be very fast, in any cases we care to optimize.

0% speedup on empty function call benchmark. (5.5% speedup in bytecode.)
0% speedup on SunSpider. (7.5% speedup on controlflow-recursive.)
2% speedup on SunSpider --v8.
2% speedup on v8 benchmark.

  • VM/CTI.cpp: Changed scope chain access to read the scope chain from the call frame header. Sped up op_ret by changing it not to fuss with the "scopeChain" local variable or ExecState::m_scopeChain.
  • VM/CTI.h: Updated CTI trampolines not to take a ScopeChainNode* argument, since that's stored in the call frame header now.
  • VM/Machine.cpp: Access "scopeChain" and "codeBlock" through new helper functions that read from the call frame header. Updated functions operating on ExecState::m_callFrame to account for / take advantage of the fact that Exec:m_callFrame is now never NULL.


Fixed a bug in op_construct, where it would use the caller's default
object prototype, rather than the callee's, when constructing a new object.

  • VM/Machine.h: Made some helper functions available. Removed ScopeChainNode* arguments to a lot of functions, since the ScopeChainNode* is now stored in the call frame header.
  • VM/RegisterFile.h: Renamed "CallerScopeChain" to "ScopeChain", since that's what it is now.
  • kjs/DebuggerCallFrame.cpp: Updated for change to ExecState signature.
  • kjs/ExecState.cpp:
  • kjs/ExecState.h: Nixed ExecState::m_callFrame, along with the unused isGlobalObject function.
  • kjs/JSGlobalObject.cpp:
  • kjs/JSGlobalObject.h: Gave the global object a fake call frame in which to store the global scope chain, since our code now assumes that it can always read the scope chain out of the ExecState's call frame.

JavaScriptGlue:

2008-09-29 Geoffrey Garen <[email protected]>

Not reviewed.


Forwarding headers to fix the build.

  • ForwardingHeaders/kjs/CTI.h: Copied from ForwardingHeaders/kjs/ExecState.h.
  • ForwardingHeaders/kjs/ustring.h: Copied from ForwardingHeaders/kjs/ExecState.h.
  • ForwardingHeaders/masm: Added.
  • ForwardingHeaders/masm/X86Assembler.h: Added.
  • ForwardingHeaders/profiler: Added.
  • ForwardingHeaders/profiler/Profiler.h: Added.

LayoutTests:

2008-09-29 Geoffrey Garen <[email protected]>

Reviewed by Cameron Zwarich.


Test case for which prototype is used when calling "new" across windows.

  • fast/js/construct-global-object-expected.txt: Added.
  • fast/js/construct-global-object.html: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/VM/Machine.cpp

    r37068 r37086  
    306306}
    307307
    308 NEVER_INLINE bool Machine::resolve(ExecState* exec, Instruction* vPC, Register* r, ScopeChainNode* scopeChain, JSValue*& exceptionValue)
     308NEVER_INLINE bool Machine::resolve(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)
    309309{
    310310    int dst = (vPC + 1)->u.operand;
    311311    int property = (vPC + 2)->u.operand;
    312312
     313    ScopeChainNode* scopeChain = this->scopeChain(r);
    313314    ScopeChainIterator iter = scopeChain->begin();
    314315    ScopeChainIterator end = scopeChain->end();
    315316    ASSERT(iter != end);
    316317
    317     CodeBlock* codeBlock = r[RegisterFile::CodeBlock].codeBlock();
     318    CodeBlock* codeBlock = this->codeBlock(r);
    318319    Identifier& ident = codeBlock->identifiers[property];
    319320    do {
     
    333334}
    334335
    335 NEVER_INLINE bool Machine::resolveSkip(ExecState* exec, Instruction* vPC, Register* r, ScopeChainNode* scopeChain, JSValue*& exceptionValue)
    336 {
    337     CodeBlock* codeBlock = r[RegisterFile::CodeBlock].codeBlock();
     336NEVER_INLINE bool Machine::resolveSkip(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)
     337{
     338    CodeBlock* codeBlock = this->codeBlock(r);
    338339
    339340    int dst = (vPC + 1)->u.operand;
     
    341342    int skip = (vPC + 3)->u.operand + codeBlock->needsFullScopeChain;
    342343
     344    ScopeChainNode* scopeChain = this->scopeChain(r);
    343345    ScopeChainIterator iter = scopeChain->begin();
    344346    ScopeChainIterator end = scopeChain->end();
     
    379381    }
    380382
    381     CodeBlock* codeBlock = r[RegisterFile::CodeBlock].codeBlock();
     383    CodeBlock* codeBlock = this->codeBlock(r);
    382384    Identifier& ident = codeBlock->identifiers[property];
    383385    PropertySlot slot(globalObject);
     
    428430}
    429431
    430 NEVER_INLINE void Machine::resolveBase(ExecState* exec, Instruction* vPC, Register* r, ScopeChainNode* scopeChain)
     432NEVER_INLINE void Machine::resolveBase(ExecState* exec, Instruction* vPC, Register* r)
    431433{
    432434    int dst = (vPC + 1)->u.operand;
    433435    int property = (vPC + 2)->u.operand;
    434     CodeBlock* codeBlock = r[RegisterFile::CodeBlock].codeBlock();
     436    CodeBlock* codeBlock = this->codeBlock(r);
     437    ScopeChainNode* scopeChain = this->scopeChain(r);
    435438    r[dst] = inlineResolveBase(exec, codeBlock->identifiers[property], scopeChain);
    436439}
    437440
    438 NEVER_INLINE bool Machine::resolveBaseAndProperty(ExecState* exec, Instruction* vPC, Register* r, ScopeChainNode* scopeChain, JSValue*& exceptionValue)
     441NEVER_INLINE bool Machine::resolveBaseAndProperty(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)
    439442{
    440443    int baseDst = (vPC + 1)->u.operand;
     
    442445    int property = (vPC + 3)->u.operand;
    443446
     447    ScopeChainNode* scopeChain = this->scopeChain(r);
    444448    ScopeChainIterator iter = scopeChain->begin();
    445449    ScopeChainIterator end = scopeChain->end();
     
    449453    ASSERT(iter != end);
    450454
    451     CodeBlock* codeBlock = r[RegisterFile::CodeBlock].codeBlock();
     455    CodeBlock* codeBlock = this->codeBlock(r);
    452456    Identifier& ident = codeBlock->identifiers[property];
    453457    JSObject* base;
     
    471475}
    472476
    473 NEVER_INLINE bool Machine::resolveBaseAndFunc(ExecState* exec, Instruction* vPC, Register* r, ScopeChainNode* scopeChain, JSValue*& exceptionValue)
     477NEVER_INLINE bool Machine::resolveBaseAndFunc(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)
    474478{
    475479    int baseDst = (vPC + 1)->u.operand;
     
    477481    int property = (vPC + 3)->u.operand;
    478482
     483    ScopeChainNode* scopeChain = this->scopeChain(r);
    479484    ScopeChainIterator iter = scopeChain->begin();
    480485    ScopeChainIterator end = scopeChain->end();
     
    484489    ASSERT(iter != end);
    485490
    486     CodeBlock* codeBlock = r[RegisterFile::CodeBlock].codeBlock();
     491    CodeBlock* codeBlock = this->codeBlock(r);
    487492    Identifier& ident = codeBlock->identifiers[property];
    488493    JSObject* base;
     
    515520}
    516521
    517 ALWAYS_INLINE void Machine::initializeCallFrame(Register* callFrame, CodeBlock* codeBlock, Instruction* vPC, ScopeChainNode* scopeChain, Register* r, int returnValueRegister, int argc, JSValue* function)
    518 {
    519     callFrame[RegisterFile::CodeBlock] = codeBlock;
    520     callFrame[RegisterFile::CallerScopeChain] = scopeChain;
    521     callFrame[RegisterFile::CallerRegisters] = r;
    522     callFrame[RegisterFile::ReturnPC] = vPC + 1;
    523     callFrame[RegisterFile::ReturnValueRegister] = returnValueRegister;
    524     callFrame[RegisterFile::ArgumentCount] = argc; // original argument count (for the sake of the "arguments" object)
    525     callFrame[RegisterFile::Callee] = function;
    526     callFrame[RegisterFile::OptionalCalleeActivation] = nullJSValue;
    527     callFrame[RegisterFile::OptionalCalleeArguments] = nullJSValue;
    528 }
    529 
    530522ALWAYS_INLINE Register* slideRegisterWindowForCall(ExecState* exec, CodeBlock* newCodeBlock, RegisterFile* registerFile, Register* registerBase, Register* r, size_t registerOffset, int argc, JSValue*& exceptionValue)
    531523{
     
    570562}
    571563
    572 ALWAYS_INLINE ScopeChainNode* scopeChainForCall(ExecState* exec, FunctionBodyNode* functionBodyNode, CodeBlock* newCodeBlock, ScopeChainNode* callDataScopeChain, Register* r)
    573 {
    574     if (newCodeBlock->needsFullScopeChain) {
    575         JSActivation* activation = new (exec) JSActivation(exec, functionBodyNode, r);
    576         r[RegisterFile::OptionalCalleeActivation] = activation;
    577 
    578         return callDataScopeChain->copy()->push(activation);
    579     }
    580 
    581     return callDataScopeChain;
    582 }
    583 
    584564static NEVER_INLINE bool isNotObject(ExecState* exec, bool forInstanceOf, CodeBlock* codeBlock, const Instruction* vPC, JSValue* value, JSValue*& exceptionData)
    585565{
     
    606586    UString programSource = static_cast<JSString*>(program)->value();
    607587
    608     CodeBlock* codeBlock = r[RegisterFile::CodeBlock].codeBlock();
     588    CodeBlock* codeBlock = this->codeBlock(r);
    609589    RefPtr<EvalNode> evalNode = codeBlock->evalCodeCache.get(exec, programSource, scopeChain, exceptionValue);
    610590
     
    666646#ifndef NDEBUG
    667647
    668 void Machine::dumpCallFrame(ScopeChainNode* scopeChain, const RegisterFile* registerFile, const Register* r)
    669 {
    670     ScopeChain sc(scopeChain);
    671     JSGlobalObject* globalObject = sc.globalObject();
    672 
    673     CodeBlock* codeBlock = r[RegisterFile::CodeBlock].codeBlock();
     648void Machine::dumpCallFrame(const RegisterFile* registerFile, const Register* r)
     649{
     650    JSGlobalObject* globalObject = scopeChain(r)->globalObject();
     651
     652    CodeBlock* codeBlock = this->codeBlock(r);
    674653    codeBlock->dump(globalObject->globalExec());
    675654
     
    684663    printf("----------------------------------------------------\n");
    685664
    686     CodeBlock* codeBlock = r[RegisterFile::CodeBlock].codeBlock();
     665    CodeBlock* codeBlock = this->codeBlock(r);
    687666    const Register* it;
    688667    const Register* end;
     
    710689
    711690    printf("[CodeBlock]                | %10p | %10p \n", it, (*it).v()); ++it;
    712     printf("[CallerScopeChain]         | %10p | %10p \n", it, (*it).v()); ++it;
     691    printf("[ScopeChain]               | %10p | %10p \n", it, (*it).v()); ++it;
    713692    printf("[CallerRegisters]          | %10p | %10p \n", it, (*it).v()); ++it;
    714693    printf("[ReturnPC]                 | %10p | %10p \n", it, (*it).v()); ++it;
     
    770749//#endif
    771750
    772 NEVER_INLINE bool Machine::unwindCallFrame(ExecState* exec, JSValue* exceptionValue, const Instruction*& vPC, CodeBlock*& codeBlock, ScopeChainNode*& scopeChain, Register*& r)
     751NEVER_INLINE bool Machine::unwindCallFrame(ExecState* exec, JSValue* exceptionValue, const Instruction*& vPC, CodeBlock*& codeBlock, Register*& r)
    773752{
    774753    CodeBlock* oldCodeBlock = codeBlock;
     754    ScopeChainNode* scopeChain = this->scopeChain(r);
    775755
    776756    if (Debugger* debugger = exec->dynamicGlobalObject()->debugger()) {
     
    799779   
    800780    void* returnPC = r[RegisterFile::ReturnPC].v();
    801     scopeChain = r[RegisterFile::CallerScopeChain].scopeChain();
    802781    r = r[RegisterFile::CallerRegisters].r();
    803782    if (!r)
     
    805784
    806785    exec->m_callFrame = r;
    807     codeBlock = r[RegisterFile::CodeBlock].codeBlock();
     786    codeBlock = this->codeBlock(r);
    808787    vPC = vPCForPC(codeBlock, returnPC);
    809788    return true;
    810789}
    811790
    812 NEVER_INLINE Instruction* Machine::throwException(ExecState* exec, JSValue*& exceptionValue, const Instruction* vPC, ScopeChainNode*& scopeChain, Register*& r, bool explicitThrow)
     791NEVER_INLINE Instruction* Machine::throwException(ExecState* exec, JSValue*& exceptionValue, const Instruction* vPC, Register*& r, bool explicitThrow)
    813792{
    814793    // Set up the exception object
    815794   
    816     CodeBlock* codeBlock = r[RegisterFile::CodeBlock].codeBlock();
     795    CodeBlock* codeBlock = this->codeBlock(r);
    817796    if (exceptionValue->isObject()) {
    818797        JSObject* exception = static_cast<JSObject*>(exceptionValue);
     
    845824           
    846825            if (exception->isWatchdogException()) {
    847                 while (unwindCallFrame(exec, exceptionValue, vPC, codeBlock, scopeChain, r)) {
     826                while (unwindCallFrame(exec, exceptionValue, vPC, codeBlock, r)) {
    848827                    // Don't need handler checks or anything, we just want to unroll all the JS callframes possible.
    849828                }
     
    854833
    855834    if (Debugger* debugger = exec->dynamicGlobalObject()->debugger()) {
     835        ScopeChainNode* scopeChain = this->scopeChain(r);
    856836        DebuggerCallFrame debuggerCallFrame(exec, exec->dynamicGlobalObject(), codeBlock, scopeChain, r, exceptionValue);
    857837        debugger->exception(debuggerCallFrame, codeBlock->ownerNode->sourceId(), codeBlock->lineNumberForVPC(vPC));
     
    864844
    865845    while (!codeBlock->getHandlerForVPC(vPC, handlerVPC, scopeDepth)) {
    866         if (!unwindCallFrame(exec, exceptionValue, vPC, codeBlock, scopeChain, r))
     846        if (!unwindCallFrame(exec, exceptionValue, vPC, codeBlock, r))
    867847            return 0;
    868848    }
     
    870850    // Now unwind the scope chain within the exception handler's call frame.
    871851
    872     ScopeChain sc(scopeChain);
     852    ScopeChain sc(this->scopeChain(r));
    873853    int scopeDelta = depth(codeBlock, sc) - scopeDepth;
    874854    ASSERT(scopeDelta >= 0);
    875855    while (scopeDelta--)
    876856        sc.pop();
    877     setScopeChain(exec, scopeChain, sc.node());
     857    r[RegisterFile::ScopeChain] = sc.node();
    878858
    879859    return handlerVPC;
     
    904884    Register* r = m_registerFile.base() + oldSize + codeBlock->numParameters + RegisterFile::CallFrameHeaderSize;
    905885    r[codeBlock->thisRegister] = thisObj;
    906     initializeCallFrame(r, codeBlock, 0, 0, 0, 0, 0, 0);
     886    initializeCallFrame(r, codeBlock, 0, scopeChain, 0, 0, 0, 0);
    907887
    908888    if (codeBlock->needsFullScopeChain)
    909889        scopeChain = scopeChain->copy();
    910890
    911     ExecState newExec(exec, &m_registerFile, scopeChain, 0);
     891    ExecState newExec(exec, &m_registerFile, r);
    912892
    913893    Profiler** profiler = Profiler::enabledProfilerReference();
     
    919899    if (!codeBlock->ctiCode)
    920900        CTI::compile(this, exec, codeBlock);
    921     JSValue* result = CTI::execute(codeBlock->ctiCode, &newExec, &m_registerFile, r, scopeChain, exception);
     901    JSValue* result = CTI::execute(codeBlock->ctiCode, &newExec, &m_registerFile, r, exception);
    922902#else
    923     JSValue* result = privateExecute(Normal, &newExec, &m_registerFile, r, scopeChain, exception);
     903    JSValue* result = privateExecute(Normal, &newExec, &m_registerFile, r, exception);
    924904#endif
    925905    m_reentryDepth--;
     
    969949    }
    970950    // a 0 codeBlock indicates a built-in caller
    971     initializeCallFrame(r, codeBlock, 0, 0, 0, 0, argc, function);
    972 
    973     ExecState newExec(exec, &m_registerFile, scopeChain, r);
     951    initializeCallFrame(r, codeBlock, 0, scopeChain, 0, 0, argc, function);
     952
     953    ExecState newExec(exec, &m_registerFile, r);
    974954
    975955    Profiler** profiler = Profiler::enabledProfilerReference();
     
    981961    if (!codeBlock->ctiCode)
    982962        CTI::compile(this, exec, codeBlock);
    983     JSValue* result = CTI::execute(codeBlock->ctiCode, &newExec, &m_registerFile, r, scopeChain, exception);
     963    JSValue* result = CTI::execute(codeBlock->ctiCode, &newExec, &m_registerFile, r, exception);
    984964#else
    985     setScopeChain(&newExec, scopeChain, scopeChain);
    986     JSValue* result = privateExecute(Normal, &newExec, &m_registerFile, r, scopeChain, exception);
     965    JSValue* result = privateExecute(Normal, &newExec, &m_registerFile, r, exception);
    987966#endif
    988967    m_reentryDepth--;
     
    10531032    // a 0 codeBlock indicates a built-in caller
    10541033    r[codeBlock->thisRegister] = thisObj;
    1055     initializeCallFrame(r, codeBlock, 0, 0, 0, 0, 0, 0);
     1034    initializeCallFrame(r, codeBlock, 0, scopeChain, 0, 0, 0, 0);
    10561035
    10571036    if (codeBlock->needsFullScopeChain)
    10581037        scopeChain = scopeChain->copy();
    10591038
    1060     ExecState newExec(exec, &m_registerFile, scopeChain, 0);
     1039    ExecState newExec(exec, &m_registerFile, r);
    10611040
    10621041    Profiler** profiler = Profiler::enabledProfilerReference();
     
    10681047    if (!codeBlock->ctiCode)
    10691048        CTI::compile(this, exec, codeBlock);
    1070     JSValue* result = CTI::execute(codeBlock->ctiCode, &newExec, &m_registerFile, r, scopeChain, exception);
     1049    JSValue* result = CTI::execute(codeBlock->ctiCode, &newExec, &m_registerFile, r, exception);
    10711050#else
    1072     JSValue* result = privateExecute(Normal, &newExec, &m_registerFile, r, scopeChain, exception);
     1051    JSValue* result = privateExecute(Normal, &newExec, &m_registerFile, r, exception);
    10731052#endif
    10741053    m_reentryDepth--;
     
    10831062}
    10841063
    1085 ALWAYS_INLINE void Machine::setScopeChain(ExecState* exec, ScopeChainNode*& scopeChain, ScopeChainNode* newScopeChain)
    1086 {
    1087     scopeChain = newScopeChain;
    1088     exec->m_scopeChain = newScopeChain;
    1089 }
    1090 
    1091 NEVER_INLINE void Machine::debug(ExecState* exec, ScopeChainNode* scopeChain, Register* r, DebugHookID debugHookID, int firstLine, int lastLine)
     1064NEVER_INLINE void Machine::debug(ExecState* exec, Register* r, DebugHookID debugHookID, int firstLine, int lastLine)
    10921065{
    10931066    Debugger* debugger = exec->dynamicGlobalObject()->debugger();
     
    10951068        return;
    10961069
    1097     CodeBlock* codeBlock = r[RegisterFile::CodeBlock].codeBlock();
     1070    CodeBlock* codeBlock = this->codeBlock(r);
     1071    ScopeChainNode* scopeChain = this->scopeChain(r);
    10981072    DebuggerCallFrame debuggerCallFrame(exec, exec->dynamicGlobalObject(), codeBlock, scopeChain, r, 0);
    10991073
     
    12051179}
    12061180
    1207 NEVER_INLINE ScopeChainNode* Machine::createExceptionScope(ExecState* exec, const Instruction* vPC, Register* r, ScopeChainNode* scopeChain)
     1181NEVER_INLINE ScopeChainNode* Machine::createExceptionScope(ExecState* exec, const Instruction* vPC, Register* r)
    12081182{
    12091183    int dst = (++vPC)->u.operand;
    1210     CodeBlock* codeBlock = r[RegisterFile::CodeBlock].codeBlock();
     1184    CodeBlock* codeBlock = this->codeBlock(r);
    12111185    Identifier& property = codeBlock->identifiers[(++vPC)->u.operand];
    12121186    JSValue* value = r[(++vPC)->u.operand].jsValue(exec);
    12131187    JSObject* scope = new (exec) JSStaticScopeObject(exec, property, value, DontDelete);
    12141188    r[dst] = scope;
    1215     return scopeChain->push(scope);
     1189
     1190    return scopeChain(r)->push(scope);
    12161191}
    12171192
     
    14281403}
    14291404
    1430 JSValue* Machine::privateExecute(ExecutionFlag flag, ExecState* exec, RegisterFile* registerFile, Register* r, ScopeChainNode* scopeChain, JSValue** exception)
     1405JSValue* Machine::privateExecute(ExecutionFlag flag, ExecState* exec, RegisterFile* registerFile, Register* r, JSValue** exception)
    14311406{
    14321407    // One-time initialization of our address tables. We have to put this code
     
    14571432
    14581433    Register* registerBase = registerFile->base();
    1459     Instruction* vPC = r[RegisterFile::CodeBlock].codeBlock()->instructions.begin();
     1434    Instruction* vPC = this->codeBlock(r)->instructions.begin();
    14601435    Profiler** enabledProfilerReference = Profiler::enabledProfilerReference();
    14611436    unsigned tickCount = m_ticksUntilNextTimeoutCheck + 1;
     
    14811456
    14821457#if HAVE(COMPUTED_GOTO)
    1483     #define NEXT_OPCODE MACHINE_SAMPLING_sample(r[RegisterFile::CodeBlock].codeBlock(), vPC); goto *vPC->u.opcode
     1458    #define NEXT_OPCODE MACHINE_SAMPLING_sample(this->codeBlock(r), vPC); goto *vPC->u.opcode
    14841459#if DUMP_OPCODE_STATS
    14851460    #define BEGIN_OPCODE(opcode) opcode: OpcodeStats::recordInstruction(opcode);
     
    14891464    NEXT_OPCODE;
    14901465#else
    1491     #define NEXT_OPCODE MACHINE_SAMPLING_sample(r[RegisterFile::CodeBlock].codeBlock(), vPC); continue
     1466    #define NEXT_OPCODE MACHINE_SAMPLING_sample(this->codeBlock(r), vPC); continue
    14921467#if DUMP_OPCODE_STATS
    14931468    #define BEGIN_OPCODE(opcode) case opcode: OpcodeStats::recordInstruction(opcode);
     
    15371512        int dst = (++vPC)->u.operand;
    15381513        int regExp = (++vPC)->u.operand;
    1539         r[dst] = new (exec) RegExpObject(scopeChain->globalObject()->regExpStructure(), r[RegisterFile::CodeBlock].codeBlock()->regexps[regExp]);
     1514        r[dst] = new (exec) RegExpObject(scopeChain(r)->globalObject()->regExpStructure(), codeBlock(r)->regexps[regExp]);
    15401515
    15411516        ++vPC;
     
    21442119        JSValue* baseVal = r[base].jsValue(exec);
    21452120
    2146         if (isNotObject(exec, true, r[RegisterFile::CodeBlock].codeBlock(), vPC, baseVal, exceptionValue))
     2121        if (isNotObject(exec, true, codeBlock(r), vPC, baseVal, exceptionValue))
    21472122            goto vm_throw;
    21482123
     
    22652240
    22662241        JSValue* baseVal = r[base].jsValue(exec);
    2267         if (isNotObject(exec, false, r[RegisterFile::CodeBlock].codeBlock(), vPC, baseVal, exceptionValue))
     2242        if (isNotObject(exec, false, codeBlock(r), vPC, baseVal, exceptionValue))
    22682243            goto vm_throw;
    22692244
     
    22912266           dst. If the property is not found, raises an exception.
    22922267        */
    2293         if (UNLIKELY(!resolve(exec, vPC, r, scopeChain, exceptionValue)))
     2268        if (UNLIKELY(!resolve(exec, vPC, r, exceptionValue)))
    22942269            goto vm_throw;
    22952270
     
    23042279         value to register dst. If the property is not found, raises an exception.
    23052280         */
    2306         if (UNLIKELY(!resolveSkip(exec, vPC, r, scopeChain, exceptionValue)))
     2281        if (UNLIKELY(!resolveSkip(exec, vPC, r, exceptionValue)))
    23072282            goto vm_throw;
    23082283
     
    23622337        int dst = (++vPC)->u.operand;
    23632338        int index = (++vPC)->u.operand;
    2364         int skip = (++vPC)->u.operand + r[RegisterFile::CodeBlock].codeBlock()->needsFullScopeChain;
    2365 
     2339        int skip = (++vPC)->u.operand + codeBlock(r)->needsFullScopeChain;
     2340
     2341        ScopeChainNode* scopeChain = this->scopeChain(r);
    23662342        ScopeChainIterator iter = scopeChain->begin();
    23672343        ScopeChainIterator end = scopeChain->end();
     
    23832359         */
    23842360        int index = (++vPC)->u.operand;
    2385         int skip = (++vPC)->u.operand + r[RegisterFile::CodeBlock].codeBlock()->needsFullScopeChain;
     2361        int skip = (++vPC)->u.operand + codeBlock(r)->needsFullScopeChain;
    23862362        int value = (++vPC)->u.operand;
    23872363
     2364        ScopeChainNode* scopeChain = this->scopeChain(r);
    23882365        ScopeChainIterator iter = scopeChain->begin();
    23892366        ScopeChainIterator end = scopeChain->end();
     
    24082385           will be the global object) is stored in register dst.
    24092386        */
    2410         resolveBase(exec, vPC, r, scopeChain);
     2387        resolveBase(exec, vPC, r);
    24112388
    24122389        vPC += 3;
     
    24252402           avoids duplicate hash lookups.
    24262403        */
    2427         if (UNLIKELY(!resolveBaseAndProperty(exec, vPC, r, scopeChain, exceptionValue)))
     2404        if (UNLIKELY(!resolveBaseAndProperty(exec, vPC, r, exceptionValue)))
    24282405            goto vm_throw;
    24292406
     
    24462423           calls but not for other property lookup.
    24472424        */
    2448         if (UNLIKELY(!resolveBaseAndFunc(exec, vPC, r, scopeChain, exceptionValue)))
     2425        if (UNLIKELY(!resolveBaseAndFunc(exec, vPC, r, exceptionValue)))
    24492426            goto vm_throw;
    24502427
     
    24622439        int property = vPC[3].u.operand;
    24632440
    2464         Identifier& ident = r[RegisterFile::CodeBlock].codeBlock()->identifiers[property];
     2441        CodeBlock* codeBlock = this->codeBlock(r);
     2442        Identifier& ident = codeBlock->identifiers[property];
    24652443        JSValue* baseValue = r[base].jsValue(exec);
    24662444        PropertySlot slot(baseValue);
     
    24682446        VM_CHECK_EXCEPTION();
    24692447
    2470         tryCacheGetByID(exec, r[RegisterFile::CodeBlock].codeBlock(), vPC, baseValue, ident, slot);
     2448        tryCacheGetByID(exec, codeBlock, vPC, baseValue, ident, slot);
    24712449
    24722450        r[dst] = result;
     
    24942472                int offset = vPC[5].u.operand;
    24952473
    2496                 ASSERT(baseObject->get(exec, r[RegisterFile::CodeBlock].codeBlock()->identifiers[vPC[3].u.operand]) == baseObject->getDirectOffset(offset));
     2474                ASSERT(baseObject->get(exec, codeBlock(r)->identifiers[vPC[3].u.operand]) == baseObject->getDirectOffset(offset));
    24972475                r[dst] = baseObject->getDirectOffset(offset);
    24982476
     
    25022480        }
    25032481
    2504         uncacheGetByID(r[RegisterFile::CodeBlock].codeBlock(), vPC);
     2482        uncacheGetByID(codeBlock(r), vPC);
    25052483        NEXT_OPCODE;
    25062484    }
     
    25282506                    int offset = vPC[6].u.operand;
    25292507
    2530                     ASSERT(protoObject->get(exec, r[RegisterFile::CodeBlock].codeBlock()->identifiers[vPC[3].u.operand]) == protoObject->getDirectOffset(offset));
     2508                    ASSERT(protoObject->get(exec, codeBlock(r)->identifiers[vPC[3].u.operand]) == protoObject->getDirectOffset(offset));
    25312509                    r[dst] = protoObject->getDirectOffset(offset);
    25322510
     
    25372515        }
    25382516
    2539         uncacheGetByID(r[RegisterFile::CodeBlock].codeBlock(), vPC);
     2517        uncacheGetByID(codeBlock(r), vPC);
    25402518        NEXT_OPCODE;
    25412519    }
     
    25692547                        int offset = vPC[7].u.operand;
    25702548
    2571                         ASSERT(baseObject->get(exec, r[RegisterFile::CodeBlock].codeBlock()->identifiers[vPC[3].u.operand]) == baseObject->getDirectOffset(offset));
     2549                        ASSERT(baseObject->get(exec, codeBlock(r)->identifiers[vPC[3].u.operand]) == baseObject->getDirectOffset(offset));
    25722550                        r[dst] = baseObject->getDirectOffset(offset);
    25732551
     
    25792557        }
    25802558
    2581         uncacheGetByID(r[RegisterFile::CodeBlock].codeBlock(), vPC);
     2559        uncacheGetByID(codeBlock(r), vPC);
    25822560        NEXT_OPCODE;
    25832561    }
     
    25922570        int property = vPC[3].u.operand;
    25932571
    2594         Identifier& ident = r[RegisterFile::CodeBlock].codeBlock()->identifiers[property];
    2595 
     2572        Identifier& ident = codeBlock(r)->identifiers[property];
    25962573        JSValue* baseValue = r[base].jsValue(exec);
    25972574        PropertySlot slot(baseValue);
     
    26202597        }
    26212598
    2622         uncacheGetByID(r[RegisterFile::CodeBlock].codeBlock(), vPC);
     2599        uncacheGetByID(codeBlock(r), vPC);
    26232600        NEXT_OPCODE;
    26242601    }
     
    26402617        }
    26412618
    2642         uncacheGetByID(r[RegisterFile::CodeBlock].codeBlock(), vPC);
     2619        uncacheGetByID(codeBlock(r), vPC);
    26432620        NEXT_OPCODE;
    26442621    }
     
    26572634        int value = vPC[3].u.operand;
    26582635
     2636        CodeBlock* codeBlock = this->codeBlock(r);
    26592637        JSValue* baseValue = r[base].jsValue(exec);
    2660 
     2638        Identifier& ident = codeBlock->identifiers[property];
    26612639        PutPropertySlot slot;
    2662         Identifier& ident = r[RegisterFile::CodeBlock].codeBlock()->identifiers[property];
    26632640        baseValue->put(exec, ident, r[value].jsValue(exec), slot);
    26642641        VM_CHECK_EXCEPTION();
    26652642
    2666         tryCachePutByID(exec, r[RegisterFile::CodeBlock].codeBlock(), vPC, baseValue, slot);
     2643        tryCachePutByID(exec, codeBlock, vPC, baseValue, slot);
    26672644
    26682645        vPC += 8;
     
    26972674                while (!proto->isNull()) {
    26982675                    if (UNLIKELY(proto->structureID() != (*it).get())) {
    2699                         uncachePutByID(r[RegisterFile::CodeBlock].codeBlock(), vPC);
     2676                        uncachePutByID(codeBlock(r), vPC);
    27002677                        NEXT_OPCODE;
    27012678                    }
     
    27102687                int value = vPC[3].u.operand;
    27112688                unsigned offset = vPC[7].u.operand;
    2712                 ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(r[RegisterFile::CodeBlock].codeBlock()->identifiers[vPC[2].u.operand])) == offset);
     2689                ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(codeBlock(r)->identifiers[vPC[2].u.operand])) == offset);
    27132690                baseObject->putDirectOffset(offset, r[value].jsValue(exec));
    27142691
     
    27182695        }
    27192696       
    2720         uncachePutByID(r[RegisterFile::CodeBlock].codeBlock(), vPC);
     2697        uncachePutByID(codeBlock(r), vPC);
    27212698        NEXT_OPCODE;
    27222699    }
     
    27452722                unsigned offset = vPC[5].u.operand;
    27462723               
    2747                 ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(r[RegisterFile::CodeBlock].codeBlock()->identifiers[vPC[2].u.operand])) == offset);
     2724                ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(codeBlock(r)->identifiers[vPC[2].u.operand])) == offset);
    27482725                baseObject->putDirectOffset(offset, r[value].jsValue(exec));
    27492726
     
    27532730        }
    27542731
    2755         uncachePutByID(r[RegisterFile::CodeBlock].codeBlock(), vPC);
     2732        uncachePutByID(codeBlock(r), vPC);
    27562733        NEXT_OPCODE;
    27572734    }
     
    27702747
    27712748        JSValue* baseValue = r[base].jsValue(exec);
    2772 
     2749        Identifier& ident = codeBlock(r)->identifiers[property];
    27732750        PutPropertySlot slot;
    2774         Identifier& ident = r[RegisterFile::CodeBlock].codeBlock()->identifiers[property];
    27752751        baseValue->put(exec, ident, r[value].jsValue(exec), slot);
    27762752        VM_CHECK_EXCEPTION();
     
    27922768
    27932769        JSObject* baseObj = r[base].jsValue(exec)->toObject(exec);
    2794 
    2795         Identifier& ident = r[RegisterFile::CodeBlock].codeBlock()->identifiers[property];
     2770        Identifier& ident = codeBlock(r)->identifiers[property];
    27962771        JSValue* result = jsBoolean(baseObj->deleteProperty(exec, ident));
    27972772        VM_CHECK_EXCEPTION();
     
    31103085        else {
    31113086            int32_t value = JSImmediate::getTruncatedInt32(scrutinee);
    3112             vPC += r[RegisterFile::CodeBlock].codeBlock()->immediateSwitchJumpTables[tableIndex].offsetForValue(value, defaultOffset);
     3087            vPC += codeBlock(r)->immediateSwitchJumpTables[tableIndex].offsetForValue(value, defaultOffset);
    31133088        }
    31143089        NEXT_OPCODE;
     
    31333108                vPC += defaultOffset;
    31343109            else
    3135                 vPC += r[RegisterFile::CodeBlock].codeBlock()->characterSwitchJumpTables[tableIndex].offsetForValue(value->data()[0], defaultOffset);
     3110                vPC += codeBlock(r)->characterSwitchJumpTables[tableIndex].offsetForValue(value->data()[0], defaultOffset);
    31363111        }
    31373112        NEXT_OPCODE;
     
    31523127            vPC += defaultOffset;
    31533128        else
    3154             vPC += r[RegisterFile::CodeBlock].codeBlock()->stringSwitchJumpTables[tableIndex].offsetForValue(static_cast<JSString*>(scrutinee)->value().rep(), defaultOffset);
     3129            vPC += codeBlock(r)->stringSwitchJumpTables[tableIndex].offsetForValue(static_cast<JSString*>(scrutinee)->value().rep(), defaultOffset);
    31553130        NEXT_OPCODE;
    31563131    }
     
    31663141        int func = (++vPC)->u.operand;
    31673142
    3168         r[dst] = r[RegisterFile::CodeBlock].codeBlock()->functions[func]->makeFunction(exec, scopeChain);
     3143        r[dst] = codeBlock(r)->functions[func]->makeFunction(exec, scopeChain(r));
    31693144
    31703145        ++vPC;
     
    31823157        int func = (++vPC)->u.operand;
    31833158
    3184         r[dst] = r[RegisterFile::CodeBlock].codeBlock()->functionExpressions[func]->makeFunction(exec, scopeChain);
     3159        r[dst] = codeBlock(r)->functionExpressions[func]->makeFunction(exec, scopeChain(r));
    31853160
    31863161        ++vPC;
     
    32093184        JSValue* baseVal = r[thisVal].jsValue(exec);
    32103185
     3186        ScopeChainNode* scopeChain = this->scopeChain(r);
    32113187        if (baseVal == scopeChain->globalObject() && funcVal == scopeChain->globalObject()->evalFunction()) {
    3212             JSObject* thisObject = static_cast<JSObject*>(r[r[RegisterFile::CodeBlock].codeBlock()->thisRegister].jsValue(exec));
     3188            JSObject* thisObject = static_cast<JSObject*>(r[codeBlock(r)->thisRegister].jsValue(exec));
    32133189            JSValue* result = callEval(exec, thisObject, scopeChain, registerFile, r, firstArg, argCount, exceptionValue);
    32143190            if (exceptionValue)
     
    32943270
    32953271            r = slideRegisterWindowForCall(exec, newCodeBlock, registerFile, registerBase, r, registerOffset, argCount, exceptionValue);
     3272            exec->m_callFrame = r;
    32963273            if (UNLIKELY(exceptionValue != 0))
    32973274                goto vm_throw;
    32983275
    3299             initializeCallFrame(r, newCodeBlock, vPC, scopeChain, savedR, dst, argCount, v);
    3300             exec->m_callFrame = r;
     3276            initializeCallFrame(r, newCodeBlock, vPC + 1, callDataScopeChain, savedR, dst, argCount, v);
    33013277   
    33023278            if (*enabledProfilerReference)
    33033279                (*enabledProfilerReference)->willExecute(exec, static_cast<JSObject*>(v));
    33043280
    3305             setScopeChain(exec, scopeChain, callDataScopeChain);
    33063281            vPC = newCodeBlock->instructions.begin();
    33073282
     
    33173292            ArgList args(r + firstArg + 1, argCount - 1);
    33183293
    3319             initializeCallFrame(r + registerOffset, 0, vPC, scopeChain, r, dst, argCount, v);
     3294            ScopeChainNode* scopeChain = this->scopeChain(r);
     3295            initializeCallFrame(r + registerOffset, 0, vPC + 1, scopeChain, r, dst, argCount, v);
    33203296            exec->m_callFrame = r + registerOffset;
    33213297
     
    33403316        ASSERT(callType == CallTypeNone);
    33413317
    3342         exceptionValue = createNotAFunctionError(exec, v, vPC, r[RegisterFile::CodeBlock].codeBlock());
     3318        exceptionValue = createNotAFunctionError(exec, v, vPC, codeBlock(r));
    33433319        goto vm_throw;
    33443320    }
     
    33563332
    33573333        if (JSActivation* activation = static_cast<JSActivation*>(r[RegisterFile::OptionalCalleeActivation].jsValue(exec))) {
    3358             ASSERT(!r[RegisterFile::CodeBlock].codeBlock()->needsFullScopeChain || scopeChain->object == activation);
     3334            ASSERT(!codeBlock(r)->needsFullScopeChain || scopeChain(r)->object == activation);
    33593335            ASSERT(activation->isObject(&JSActivation::info));
    33603336            activation->copyRegisters();
     
    33643340            (*enabledProfilerReference)->didExecute(exec, static_cast<JSObject*>(r[RegisterFile::Callee].jsValue(exec)));
    33653341
    3366         if (r[RegisterFile::CodeBlock].codeBlock()->needsFullScopeChain)
    3367             scopeChain->deref();
     3342        if (codeBlock(r)->needsFullScopeChain)
     3343            scopeChain(r)->deref();
    33683344
    33693345        JSValue* returnValue = r[result].jsValue(exec);
    33703346
    33713347        vPC = r[RegisterFile::ReturnPC].vPC();
    3372         setScopeChain(exec, scopeChain, r[RegisterFile::CallerScopeChain].scopeChain());
    33733348        int dst = r[RegisterFile::ReturnValueRegister].i();
    33743349        r = r[RegisterFile::CallerRegisters].r();
     
    33843359    BEGIN_OPCODE(op_init) {
    33853360        size_t i = 0;
    3386         CodeBlock* codeBlock = r[RegisterFile::CodeBlock].codeBlock();
     3361        CodeBlock* codeBlock = this->codeBlock(r);
    33873362       
    33883363        for (size_t count = codeBlock->numVars; i < count; ++i)
     
    33973372    BEGIN_OPCODE(op_init_activation) {
    33983373        size_t i = 0;
    3399         CodeBlock* codeBlock = r[RegisterFile::CodeBlock].codeBlock();
     3374        CodeBlock* codeBlock = this->codeBlock(r);
    34003375
    34013376        for (size_t count = codeBlock->numVars; i < count; ++i)
     
    34073382        JSActivation* activation = new (exec) JSActivation(exec, static_cast<FunctionBodyNode*>(codeBlock->ownerNode), r);
    34083383        r[RegisterFile::OptionalCalleeActivation] = activation;
    3409         setScopeChain(exec, scopeChain, scopeChain->copy()->push(activation));
     3384        r[RegisterFile::ScopeChain] = scopeChain(r)->copy()->push(activation);
    34103385
    34113386        ++vPC;
     
    34493424                (*enabledProfilerReference)->willExecute(exec, static_cast<JSObject*>(v));
    34503425
     3426            ScopeChainNode* callDataScopeChain = constructData.js.scopeChain;
     3427            FunctionBodyNode* functionBodyNode = constructData.js.functionBody;
     3428            CodeBlock* newCodeBlock = &functionBodyNode->byteCode(callDataScopeChain);
     3429
    34513430            StructureID* structure;
    34523431            JSValue* prototype = r[constrProto].jsValue(exec);
     
    34543433                structure = static_cast<JSObject*>(prototype)->inheritorID();
    34553434            else
    3456                 structure = scopeChain->globalObject()->emptyObjectStructure();
     3435                structure = callDataScopeChain->globalObject()->emptyObjectStructure();
    34573436            JSObject* newObject = new (exec) JSObject(structure);
    34583437
    3459             ScopeChainNode* callDataScopeChain = constructData.js.scopeChain;
    3460             FunctionBodyNode* functionBodyNode = constructData.js.functionBody;
    3461             CodeBlock* newCodeBlock = &functionBodyNode->byteCode(callDataScopeChain);
    3462 
    34633438            r[firstArg] = newObject; // "this" value
    34643439
     
    34663441
    34673442            r = slideRegisterWindowForCall(exec, newCodeBlock, registerFile, registerBase, r, registerOffset, argCount, exceptionValue);
     3443            exec->m_callFrame = r;
    34683444            if (UNLIKELY(exceptionValue != 0))
    34693445                goto vm_throw;
    34703446
    3471             initializeCallFrame(r, newCodeBlock, vPC, scopeChain, savedR, dst, argCount, v);
    3472             exec->m_callFrame = r;
     3447            initializeCallFrame(r, newCodeBlock, vPC + 1, callDataScopeChain, savedR, dst, argCount, v);
    34733448   
    34743449            if (*enabledProfilerReference)
    34753450                (*enabledProfilerReference)->didExecute(exec, static_cast<JSObject*>(v));
    34763451
    3477             setScopeChain(exec, scopeChain, callDataScopeChain);
    34783452            vPC = newCodeBlock->instructions.begin();
    34793453
     
    34883462            ArgList args(r + firstArg + 1, argCount - 1);
    34893463
    3490             initializeCallFrame(r + registerOffset, 0, vPC, scopeChain, r, dst, argCount, v);
     3464            ScopeChainNode* scopeChain = this->scopeChain(r);
     3465            initializeCallFrame(r + registerOffset, 0, vPC + 1, scopeChain, r, dst, argCount, v);
    34913466            exec->m_callFrame = r + registerOffset;
    34923467
     
    35113486        ASSERT(constructType == ConstructTypeNone);
    35123487
    3513         exceptionValue = createNotAConstructorError(exec, v, vPC, r[RegisterFile::CodeBlock].codeBlock());
     3488        exceptionValue = createNotAConstructorError(exec, v, vPC, codeBlock(r));
    35143489        goto vm_throw;
    35153490    }
     
    35443519        VM_CHECK_EXCEPTION();
    35453520
    3546         setScopeChain(exec, scopeChain, scopeChain->push(o));
     3521        r[RegisterFile::ScopeChain] = scopeChain(r)->push(o);
    35473522
    35483523        ++vPC;
     
    35543529           Removes the top item from the current scope chain.
    35553530        */
    3556         setScopeChain(exec, scopeChain, scopeChain->pop());
     3531        r[RegisterFile::ScopeChain] = scopeChain(r)->pop();
    35573532
    35583533        ++vPC;
     
    36093584        int target = (++vPC)->u.operand;
    36103585
    3611         ScopeChainNode* tmp = scopeChain;
     3586        ScopeChainNode* tmp = scopeChain(r);
    36123587        while (count--)
    36133588            tmp = tmp->pop();
    3614         setScopeChain(exec, scopeChain, tmp);
     3589        r[RegisterFile::ScopeChain] = tmp;
    36153590
    36163591        vPC += target;
     
    36283603           in dst for GC.
    36293604         */
    3630         setScopeChain(exec, scopeChain, createExceptionScope(exec, vPC, r, scopeChain));
     3605        r[RegisterFile::ScopeChain] = createExceptionScope(exec, vPC, r);
     3606
    36313607        vPC += 4;
    36323608        NEXT_OPCODE;
     
    36653641        exceptionValue = r[ex].jsValue(exec);
    36663642
    3667         handlerVPC = throwException(exec, exceptionValue, vPC, scopeChain, r, true);
     3643        handlerVPC = throwException(exec, exceptionValue, vPC, r, true);
    36683644        if (!handlerVPC) {
    36693645            *exception = exceptionValue;
     
    36903666        int dst = (++vPC)->u.operand;
    36913667        int src = (++vPC)->u.operand;
    3692         r[dst] = r[RegisterFile::CodeBlock].codeBlock()->unexpectedConstants[src];
     3668        r[dst] = codeBlock(r)->unexpectedConstants[src];
    36933669
    36943670        ++vPC;
     
    37073683        int message = (++vPC)->u.operand;
    37083684
    3709         CodeBlock* codeBlock = r[RegisterFile::CodeBlock].codeBlock();
     3685        CodeBlock* codeBlock = this->codeBlock(r);
    37103686        r[dst] = Error::create(exec, (ErrorType)type, codeBlock->unexpectedConstants[message]->toString(exec), codeBlock->lineNumberForVPC(vPC), codeBlock->ownerNode->sourceId(), codeBlock->ownerNode->sourceURL());
    37113687
     
    37203696        */
    37213697
    3722         if (r[RegisterFile::CodeBlock].codeBlock()->needsFullScopeChain) {
     3698        if (codeBlock(r)->needsFullScopeChain) {
     3699            ScopeChainNode* scopeChain = this->scopeChain(r);
    37233700            ASSERT(scopeChain->refCount > 1);
    37243701            scopeChain->deref();
     
    37443721        ASSERT(r[base].jsValue(exec)->isObject());
    37453722        JSObject* baseObj = static_cast<JSObject*>(r[base].jsValue(exec));
    3746         Identifier& ident = r[RegisterFile::CodeBlock].codeBlock()->identifiers[property];
     3723        Identifier& ident = codeBlock(r)->identifiers[property];
    37473724        ASSERT(r[function].jsValue(exec)->isObject());
    37483725        baseObj->defineGetter(exec, ident, static_cast<JSObject*>(r[function].jsValue(exec)));
     
    37683745        ASSERT(r[base].jsValue(exec)->isObject());
    37693746        JSObject* baseObj = static_cast<JSObject*>(r[base].jsValue(exec));
    3770         Identifier& ident = r[RegisterFile::CodeBlock].codeBlock()->identifiers[property];
     3747        Identifier& ident = codeBlock(r)->identifiers[property];
    37713748        ASSERT(r[function].jsValue(exec)->isObject());
    37723749        baseObj->defineSetter(exec, ident, static_cast<JSObject*>(r[function].jsValue(exec)));
     
    38093786        int lastLine = (++vPC)->u.operand;
    38103787
    3811         debug(exec, scopeChain, r, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
     3788        debug(exec, r, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
    38123789
    38133790        ++vPC;
     
    38213798            exceptionValue = createInterruptedExecutionException(exec);
    38223799        }
    3823         handlerVPC = throwException(exec, exceptionValue, vPC, scopeChain, r, false);
     3800        handlerVPC = throwException(exec, exceptionValue, vPC, r, false);
    38243801        if (!handlerVPC) {
    38253802            *exception = exceptionValue;
     
    38813858
    38823859    Register* r = exec->m_callFrame;
    3883     if (!r)
    3884         return;
    3885 
    38863860    Register* callerR = r[RegisterFile::CallerRegisters].r();
    38873861    if (!callerR)
    38883862        return;
    38893863
    3890     CodeBlock* callerCodeBlock = callerR[RegisterFile::CodeBlock].codeBlock();
     3864    CodeBlock* callerCodeBlock = codeBlock(callerR);
    38913865    Instruction* vPC = vPCForPC(callerCodeBlock, r[RegisterFile::ReturnPC].v());
    38923866    lineNumber = callerCodeBlock->lineNumberForVPC(vPC - 1);
     
    39033877Register* Machine::callFrame(ExecState* exec, InternalFunction* function) const
    39043878{
    3905     Register* callFrame = exec->m_callFrame;
    3906 
    3907     while (1) {
    3908         while (!callFrame) {
    3909             exec = exec->m_prev;
    3910             if (!exec)
    3911                 return 0;
    3912             callFrame = exec->m_callFrame;
    3913         }
    3914 
    3915         if (callFrame[RegisterFile::Callee].jsValue(exec) == function)
    3916             return callFrame;
    3917 
    3918         callFrame = callFrame[RegisterFile::CallerRegisters].r();
    3919     }
     3879    for (; exec; exec = exec->m_prev)
     3880        for (Register* r = exec->m_callFrame; r; r = r[RegisterFile::CallerRegisters].r())
     3881            if (r[RegisterFile::Callee].jsValue(exec) == function)
     3882                return r;
     3883               
     3884    return 0;
    39203885}
    39213886
     
    41944159void Machine::cti_op_end(CTI_ARGS)
    41954160{
    4196     ASSERT(ARG_scopeChain->refCount > 1);
    4197     ARG_scopeChain->deref();
     4161    Register* r = ARG_r;
     4162    ScopeChainNode* scopeChain = Machine::scopeChain(r);
     4163    ASSERT(scopeChain->refCount > 1);
     4164    scopeChain->deref();
    41984165}
    41994166
     
    42794246    baseValue->put(exec, ident, ARG_src3, slot);
    42804247
    4281     exec->machine()->tryCTICachePutByID(exec, ARG_r[RegisterFile::CodeBlock].codeBlock(), CTI_RETURN_ADDRESS, baseValue, slot);
     4248    Register* r = ARG_r;
     4249    exec->machine()->tryCTICachePutByID(exec, codeBlock(r), CTI_RETURN_ADDRESS, baseValue, slot);
    42824250
    42834251    VM_CHECK_EXCEPTION_AT_END();
     
    43334301    JSValue* result = baseValue->get(exec, ident, slot);
    43344302
    4335     exec->machine()->tryCTICacheGetByID(exec, ARG_r[RegisterFile::CodeBlock].codeBlock(), CTI_RETURN_ADDRESS, baseValue, ident, slot);
     4303    Register* r = ARG_r;
     4304    exec->machine()->tryCTICacheGetByID(exec, codeBlock(r), CTI_RETURN_ADDRESS, baseValue, ident, slot);
    43364305
    43374306    VM_CHECK_EXCEPTION_AT_END();
     
    43844353
    43854354    if (!baseVal->isObject()) {
    4386         CodeBlock* codeBlock = ARG_r[RegisterFile::CodeBlock].codeBlock();
     4355        Register* r = ARG_r;
     4356        CodeBlock* codeBlock = Machine::codeBlock(r);
    43874357        ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    43884358        unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
     
    44394409JSValue* Machine::cti_op_new_func(CTI_ARGS)
    44404410{
    4441     return ARG_func1->makeFunction(ARG_exec, ARG_scopeChain);
     4411    Register* r = ARG_r;
     4412    ScopeChainNode* scopeChain = Machine::scopeChain(r);
     4413    return ARG_func1->makeFunction(ARG_exec, scopeChain);
    44424414}
    44434415
     
    44744446
    44754447    r[RegisterFile::CodeBlock] = newCodeBlock;
    4476     r[RegisterFile::CallerScopeChain] = ARG_scopeChain;
     4448    r[RegisterFile::ScopeChain] = callDataScopeChain;
    44774449    r[RegisterFile::CallerRegisters] = savedR;
    44784450    // RegisterFile::ReturnPC is set by callee
     
    44844456
    44854457    exec->m_callFrame = r;
    4486     exec->m_scopeChain = callDataScopeChain;
    4487 
    4488     ARG_setScopeChain(callDataScopeChain);
    44894458    ARG_setR(r);
     4459
    44904460    return newCodeBlock->ctiCode;
    44914461}
     
    44944464{
    44954465    ExecState* exec = ARG_exec;
    4496     CodeBlock* codeBlock = ARG_r[RegisterFile::CodeBlock].codeBlock();
     4466    Register* r = ARG_r;
     4467    CodeBlock* codeBlock = Machine::codeBlock(r);
    44974468
    44984469    if (!codeBlock->ctiCode)
     
    45054476{
    45064477    ExecState* exec = ARG_exec;
    4507     CodeBlock* codeBlock = ARG_r[RegisterFile::CodeBlock].codeBlock();
    4508     ScopeChainNode* scopeChain = ARG_scopeChain;
    45094478    Register* r = ARG_r;
     4479    CodeBlock* codeBlock = Machine::codeBlock(r);
     4480    ScopeChainNode* scopeChain = Machine::scopeChain(r);
    45104481
    45114482    JSActivation* activation = new (exec) JSActivation(exec, static_cast<FunctionBodyNode*>(codeBlock->ownerNode), r);
    45124483    r[RegisterFile::OptionalCalleeActivation] = activation;
    4513 
    4514     setScopeChain(exec, scopeChain, scopeChain->copy()->push(activation));
    4515     ARG_setScopeChain(scopeChain);
     4484    r[RegisterFile::ScopeChain] = scopeChain->copy()->push(activation);
    45164485}
    45174486
     
    45194488{
    45204489    ExecState* exec = ARG_exec;
    4521 
    45224490    JSValue* funcVal = ARG_src1;
    45234491
     
    45304498        int registerOffset = ARG_int2;
    45314499        int argCount = ARG_int3;
    4532         Register* r = ARG_r + registerOffset;
    4533        
    4534         initializeCallFrame(r, 0, ARG_instr4, ARG_scopeChain, ARG_r, 0, argCount, funcVal);
     4500        Register* savedR = ARG_r;
     4501        Register* r = savedR + registerOffset;
     4502
     4503        initializeCallFrame(r, 0, ARG_instr4 + 1, scopeChain(savedR), savedR, 0, argCount, funcVal);
    45354504        exec->m_callFrame = r;
     4505        ARG_setR(r);
    45364506
    45374507        if (*ARG_profilerReference)
     
    45444514
    45454515        JSValue* returnValue = callData.native.function(exec, static_cast<JSObject*>(funcVal), argv[0].jsValue(exec), argList);
     4516        exec->m_callFrame = savedR;
     4517        ARG_setR(savedR);
    45464518        VM_CHECK_EXCEPTION(JSValue*);
    45474519
     
    45494521            (*ARG_profilerReference)->didExecute(exec, static_cast<JSObject*>(funcVal));
    45504522
    4551         exec->m_callFrame = ARG_r;
    45524523        return returnValue;
    45534524    }
     
    45554526    ASSERT(callType == CallTypeNone);
    45564527
    4557     exec->setException(createNotAFunctionError(exec, funcVal, ARG_instr4, ARG_r[RegisterFile::CodeBlock].codeBlock()));
     4528    Register* r = ARG_r;
     4529    exec->setException(createNotAFunctionError(exec, funcVal, ARG_instr4, codeBlock(r)));
    45584530    VM_CHECK_EXCEPTION_AT_END();
    45594531    return 0;
     
    45714543{
    45724544    ExecState* exec = ARG_exec;
    4573     Register* callFrame = ARG_r;
    4574 
    4575     JSActivation* activation = static_cast<JSActivation*>(callFrame[RegisterFile::OptionalCalleeActivation].jsValue(exec));
     4545    Register* r = ARG_r;
     4546
     4547    JSActivation* activation = static_cast<JSActivation*>(r[RegisterFile::OptionalCalleeActivation].jsValue(exec));
    45764548    ASSERT(activation);
    45774549
    4578     ASSERT(!ARG_r[RegisterFile::CodeBlock].codeBlock()->needsFullScopeChain || ARG_scopeChain->object == activation);
     4550    ASSERT(!codeBlock(r)->needsFullScopeChain || scopeChain(r)->object == activation);
    45794551    ASSERT(activation->isObject(&JSActivation::info));
    45804552    activation->copyRegisters();
     
    45854557    ExecState* exec = ARG_exec;
    45864558
    4587     Register* callFrame = ARG_r;
     4559    Register* r = ARG_r;
    45884560    ASSERT(*ARG_profilerReference);
    4589     (*ARG_profilerReference)->didExecute(exec, static_cast<JSObject*>(callFrame[RegisterFile::Callee].jsValue(exec)));
     4561    (*ARG_profilerReference)->didExecute(exec, static_cast<JSObject*>(r[RegisterFile::Callee].jsValue(exec)));
    45904562}
    45914563
    45924564void Machine::cti_op_ret_scopeChain(CTI_ARGS)
    45934565{
    4594     ASSERT(ARG_r[RegisterFile::CodeBlock].codeBlock()->needsFullScopeChain);
    4595     ARG_scopeChain->deref();
     4566    Register* r = ARG_r;
     4567    ASSERT(codeBlock(r)->needsFullScopeChain);
     4568    scopeChain(r)->deref();
    45964569}
    45974570
     
    46054578{
    46064579    ExecState* exec = ARG_exec;
    4607     ScopeChainNode* scopeChain = ARG_scopeChain;
     4580    Register* r = ARG_r;
     4581    ScopeChainNode* scopeChain = Machine::scopeChain(r);
    46084582
    46094583    ScopeChainIterator iter = scopeChain->begin();
     
    46224596    } while (++iter != end);
    46234597
    4624     CodeBlock* codeBlock = ARG_r[RegisterFile::CodeBlock].codeBlock();
     4598    CodeBlock* codeBlock = Machine::codeBlock(r);
    46254599    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    46264600    unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
     
    46554629        (*ARG_profilerReference)->willExecute(exec, constructor);
    46564630
     4631    ScopeChainNode* callDataScopeChain = constructor->m_scopeChain.node();
     4632    FunctionBodyNode* functionBodyNode = constructor->m_body.get();
     4633    CodeBlock* newCodeBlock = &functionBodyNode->byteCode(callDataScopeChain);
     4634
    46574635    StructureID* structure;
    46584636    if (constrProtoVal->isObject())
    46594637        structure = static_cast<JSObject*>(constrProtoVal)->inheritorID();
    46604638    else
    4661         structure = ARG_scopeChain->globalObject()->emptyObjectStructure();
     4639        structure = callDataScopeChain->globalObject()->emptyObjectStructure();
    46624640    JSObject* newObject = new (exec) JSObject(structure);
    4663 
    4664     ScopeChainNode* callDataScopeChain = constructor->m_scopeChain.node();
    4665     FunctionBodyNode* functionBodyNode = constructor->m_body.get();
    4666     CodeBlock* newCodeBlock = &functionBodyNode->byteCode(callDataScopeChain);
    46674641
    46684642    r[firstArg] = newObject; // "this" value
     
    46754649
    46764650    r[RegisterFile::CodeBlock] = newCodeBlock;
    4677     r[RegisterFile::CallerScopeChain] = ARG_scopeChain;
     4651    r[RegisterFile::ScopeChain] = callDataScopeChain;
    46784652    r[RegisterFile::CallerRegisters] = savedR;
    46794653    // RegisterFile::ReturnPC is set by callee
     
    46854659
    46864660    exec->m_callFrame = r;
    4687     exec->m_scopeChain = callDataScopeChain;
    4688 
    4689     ARG_setScopeChain(callDataScopeChain);
     4661
    46904662    ARG_setR(r);
    46914663    return newCodeBlock->ctiCode;
     
    47254697    ASSERT(constructType == ConstructTypeNone);
    47264698
    4727     exec->setException(createNotAConstructorError(exec, constrVal, ARG_instr6, r[RegisterFile::CodeBlock].codeBlock()));
     4699    exec->setException(createNotAConstructorError(exec, constrVal, ARG_instr6, codeBlock(r)));
    47284700    VM_CHECK_EXCEPTION_AT_END();
    47294701    return 0;
     
    47654737{
    47664738    ExecState* exec = ARG_exec;
    4767     ScopeChainNode* scopeChain = ARG_scopeChain;
     4739    Register* r = ARG_r;
     4740    ScopeChainNode* scopeChain = Machine::scopeChain(r);
    47684741
    47694742    ScopeChainIterator iter = scopeChain->begin();
     
    47974770    } while (iter != end);
    47984771
    4799     CodeBlock* codeBlock = ARG_r[RegisterFile::CodeBlock].codeBlock();
     4772    CodeBlock* codeBlock = Machine::codeBlock(r);
    48004773    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    48014774    unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
     
    49164889JSValue* Machine::cti_op_resolve_base(CTI_ARGS)
    49174890{
    4918     return inlineResolveBase(ARG_exec, *ARG_id1, ARG_scopeChain);
     4891    return inlineResolveBase(ARG_exec, *ARG_id1, scopeChain(ARG_r));
    49194892}
    49204893
     
    49224895{
    49234896    ExecState* exec = ARG_exec;
    4924     ScopeChainNode* scopeChain = ARG_scopeChain;
     4897    Register* r = ARG_r;
     4898    ScopeChainNode* scopeChain = Machine::scopeChain(r);
    49254899
    49264900    int skip = ARG_int2;
     
    49444918    } while (++iter != end);
    49454919
    4946     CodeBlock* codeBlock = ARG_r[RegisterFile::CodeBlock].codeBlock();
     4920    CodeBlock* codeBlock = Machine::codeBlock(r);
    49474921    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    49484922    unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
     
    49774951    }
    49784952   
    4979     exec->setException(createUndefinedVariableError(exec, ident, vPC, ARG_r[RegisterFile::CodeBlock].codeBlock()));
     4953    Register* r = ARG_r;
     4954    exec->setException(createUndefinedVariableError(exec, ident, vPC, codeBlock(r)));
    49804955   
    49814956    VM_CHECK_EXCEPTION_AT_END();
     
    51445119{
    51455120    ExecState* exec = ARG_exec;
    5146     ScopeChainNode* scopeChain = ARG_scopeChain;
     5121    Register* r = ARG_r;
     5122    ScopeChainNode* scopeChain = Machine::scopeChain(r);
    51475123
    51485124    ScopeChainIterator iter = scopeChain->begin();
     
    51675143    } while (iter != end);
    51685144
    5169     CodeBlock* codeBlock = ARG_r[RegisterFile::CodeBlock].codeBlock();
     5145    CodeBlock* codeBlock = Machine::codeBlock(r);
    51705146    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    51715147    unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
     
    51785154JSValue* Machine::cti_op_new_func_exp(CTI_ARGS)
    51795155{
    5180     return ARG_funcexp1->makeFunction(ARG_exec, ARG_scopeChain);
     5156    return ARG_funcexp1->makeFunction(ARG_exec, scopeChain(ARG_r));
    51815157}
    51825158
     
    52575233JSValue* Machine::cti_op_new_regexp(CTI_ARGS)
    52585234{
    5259     return new (ARG_exec) RegExpObject(ARG_scopeChain->globalObject()->regExpStructure(), ARG_regexp1);
     5235    return new (ARG_exec) RegExpObject(scopeChain(ARG_r)->globalObject()->regExpStructure(), ARG_regexp1);
    52605236}
    52615237
     
    52775253    RegisterFile* registerFile = ARG_registerFile;
    52785254    Register* r = ARG_r;
    5279     CodeBlock* codeBlock = r[RegisterFile::CodeBlock].codeBlock();
    5280     ScopeChainNode* scopeChain = ARG_scopeChain;
     5255    CodeBlock* codeBlock = Machine::codeBlock(r);
     5256    ScopeChainNode* scopeChain = Machine::scopeChain(r);
    52815257
    52825258    Machine* machine = exec->machine();
     
    53015277{
    53025278    ExecState* exec = ARG_exec;
    5303     ScopeChainNode* scopeChain = ARG_scopeChain;
    53045279    Register* r = ARG_r;
    5305     CodeBlock* codeBlock = r[RegisterFile::CodeBlock].codeBlock();
     5280    CodeBlock* codeBlock = Machine::codeBlock(r);
    53065281
    53075282    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
     
    53095284
    53105285    JSValue* exceptionValue = ARG_src1;
    5311     Instruction* handlerVPC = ARG_exec->machine()->throwException(exec, exceptionValue, codeBlock->instructions.begin() + vPCIndex, scopeChain, r, true);
     5286    Instruction* handlerVPC = ARG_exec->machine()->throwException(exec, exceptionValue, codeBlock->instructions.begin() + vPCIndex, r, true);
    53125287
    53135288    if (handlerVPC) {
    53145289        exec->setException(exceptionValue);
    5315         ARG_setScopeChain(scopeChain);
    53165290        ARG_setR(r);
    53175291
    5318         void* catchRoutine = r[RegisterFile::CodeBlock].codeBlock()->nativeExceptionCodeForHandlerVPC(handlerVPC);
     5292        void* catchRoutine = Machine::codeBlock(r)->nativeExceptionCodeForHandlerVPC(handlerVPC);
    53195293        ASSERT(catchRoutine);
    53205294        ctiSetReturnAddress(&CTI_RETURN_ADDRESS, catchRoutine);
     
    53445318{
    53455319    ExecState* exec = ARG_exec;
    5346 
    53475320    JSValue* v = ARG_src1;
     5321
    53485322    JSObject* o = v->toObject(exec);
    53495323    VM_CHECK_EXCEPTION_v();
    53505324
    5351     ScopeChainNode* newScopeChain = ARG_scopeChain->push(o);
    5352     ARG_setScopeChain(newScopeChain);
    5353     exec->m_scopeChain = newScopeChain;
     5325    Register* r = ARG_r;
     5326    r[RegisterFile::ScopeChain] = scopeChain(r)->push(o);
    53545327}
    53555328
    53565329void Machine::cti_op_pop_scope(CTI_ARGS)
    53575330{
    5358     ExecState* exec = ARG_exec;
    5359 
    5360     ScopeChainNode* newScopeChain = ARG_scopeChain->pop();
    5361     ARG_setScopeChain(newScopeChain);
    5362     exec->m_scopeChain = newScopeChain;
     5331    Register* r = ARG_r;
     5332    r[RegisterFile::ScopeChain] = scopeChain(r)->pop();
    53635333}
    53645334
     
    54395409
    54405410    if (!baseVal->isObject()) {
    5441         CodeBlock* codeBlock = ARG_r[RegisterFile::CodeBlock].codeBlock();
     5411        Register* r = ARG_r;
     5412        CodeBlock* codeBlock = Machine::codeBlock(r);
    54425413        ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    54435414        unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
     
    54635434    JSObject* scope = new (exec) JSStaticScopeObject(exec, *ARG_id1, ARG_src2, DontDelete);
    54645435
    5465     ScopeChainNode* newScopeChain = ARG_scopeChain->push(scope);
    5466     ARG_setScopeChain(newScopeChain);
    5467     exec->m_scopeChain = newScopeChain;
    5468 
     5436    Register* r = ARG_r;
     5437    r[RegisterFile::ScopeChain] = scopeChain(r)->push(scope);
    54695438    return scope;
    54705439}
     
    54725441void Machine::cti_op_jmp_scopes(CTI_ARGS)
    54735442{
    5474     ExecState* exec = ARG_exec;
    54755443    unsigned count = ARG_int1;
    5476 
    5477     ScopeChainNode* tmp = ARG_scopeChain;
     5444    Register* r = ARG_r;
     5445
     5446    ScopeChainNode* tmp = scopeChain(r);
    54785447    while (count--)
    54795448        tmp = tmp->pop();
    5480 
    5481     ARG_setScopeChain(tmp);
    5482     exec->m_scopeChain = tmp;
     5449    r[RegisterFile::ScopeChain] = tmp;
    54835450}
    54845451
     
    54955462    JSValue* scrutinee = ARG_src1;
    54965463    unsigned tableIndex = ARG_int2;
    5497 
    5498     CodeBlock* codeBlock = ARG_r[RegisterFile::CodeBlock].codeBlock();
     5464    Register* r = ARG_r;
     5465    CodeBlock* codeBlock = Machine::codeBlock(r);
    54995466
    55005467    if (JSImmediate::isNumber(scrutinee)) {
     
    55105477    JSValue* scrutinee = ARG_src1;
    55115478    unsigned tableIndex = ARG_int2;
    5512 
    5513     CodeBlock* codeBlock = ARG_r[RegisterFile::CodeBlock].codeBlock();
     5479    Register* r = ARG_r;
     5480    CodeBlock* codeBlock = Machine::codeBlock(r);
    55145481
    55155482    void* result = codeBlock->characterSwitchJumpTables[tableIndex].ctiDefault;
     
    55285495    JSValue* scrutinee = ARG_src1;
    55295496    unsigned tableIndex = ARG_int2;
    5530 
    5531     CodeBlock* codeBlock = ARG_r[RegisterFile::CodeBlock].codeBlock();
     5497    Register* r = ARG_r;
     5498    CodeBlock* codeBlock = Machine::codeBlock(r);
    55325499
    55335500    void* result = codeBlock->stringSwitchJumpTables[tableIndex].ctiDefault;
     
    55895556{
    55905557    ExecState* exec = ARG_exec;
    5591     CodeBlock* codeBlock = ARG_r[RegisterFile::CodeBlock].codeBlock();
     5558    Register* r = ARG_r;
     5559    CodeBlock* codeBlock = Machine::codeBlock(r);
    55925560    unsigned type = ARG_int1;
    55935561    JSValue* message = ARG_src2;
     
    56005568{
    56015569    ExecState* exec = ARG_exec;
    5602     ScopeChainNode* scopeChain = ARG_scopeChain;
    56035570    Register* r = ARG_r;
    56045571
     
    56075574    int lastLine = ARG_int3;
    56085575
    5609     exec->machine()->debug(exec, scopeChain, r, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
     5576    exec->machine()->debug(exec, r, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
    56105577}
    56115578
     
    56135580{
    56145581    ExecState* exec = ARG_exec;
    5615     ScopeChainNode* scopeChain = ARG_scopeChain;
    56165582    Register* r = ARG_r;
    5617     CodeBlock* codeBlock = r[RegisterFile::CodeBlock].codeBlock();
     5583    CodeBlock* codeBlock = Machine::codeBlock(r);
    56185584
    56195585    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(exec->ctiReturnAddress()));
     
    56245590    JSValue* exceptionValue = exec->exception();
    56255591
    5626     Instruction* handlerVPC = ARG_exec->machine()->throwException(exec, exceptionValue, codeBlock->instructions.begin() + vPCIndex, scopeChain, r, false);
     5592    Instruction* handlerVPC = ARG_exec->machine()->throwException(exec, exceptionValue, codeBlock->instructions.begin() + vPCIndex, r, false);
    56275593
    56285594    if (handlerVPC) {
    56295595        exec->setException(exceptionValue);
    5630         ARG_setScopeChain(scopeChain);
    56315596        ARG_setR(r);
    56325597
    5633         void* catchRoutine = r[RegisterFile::CodeBlock].codeBlock()->nativeExceptionCodeForHandlerVPC(handlerVPC);
     5598        void* catchRoutine = Machine::codeBlock(r)->nativeExceptionCodeForHandlerVPC(handlerVPC);
    56345599        ASSERT(catchRoutine);
    56355600        ctiSetReturnAddress(&CTI_RETURN_ADDRESS, catchRoutine);
Note: See TracChangeset for help on using the changeset viewer.