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


Ignore:
Timestamp:
Oct 8, 2008, 10:50:42 AM (17 years ago)
Author:
[email protected]
Message:

Roll out r37427 because it causes an infinite recursion loading about:blank.

https://bugs.webkit.org/show_bug.cgi?id=21476

File:
1 edited

Legend:

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

    r37427 r37428  
    163163}
    164164
    165 static inline bool jsLess(CallFrame* callFrame, JSValue* v1, JSValue* v2)
     165static inline bool jsLess(ExecState* exec, JSValue* v1, JSValue* v2)
    166166{
    167167    if (JSImmediate::areBothImmediateNumbers(v1, v2))
     
    173173        return n1 < n2;
    174174
    175     Machine* machine = callFrame->machine();
     175    Machine* machine = exec->machine();
    176176    if (machine->isJSString(v1) && machine->isJSString(v2))
    177177        return static_cast<const JSString*>(v1)->value() < static_cast<const JSString*>(v2)->value();
     
    179179    JSValue* p1;
    180180    JSValue* p2;
    181     bool wasNotString1 = v1->getPrimitiveNumber(callFrame, n1, p1);
    182     bool wasNotString2 = v2->getPrimitiveNumber(callFrame, n2, p2);
     181    bool wasNotString1 = v1->getPrimitiveNumber(exec, n1, p1);
     182    bool wasNotString2 = v2->getPrimitiveNumber(exec, n2, p2);
    183183
    184184    if (wasNotString1 | wasNotString2)
     
    188188}
    189189
    190 static inline bool jsLessEq(CallFrame* callFrame, JSValue* v1, JSValue* v2)
     190static inline bool jsLessEq(ExecState* exec, JSValue* v1, JSValue* v2)
    191191{
    192192    if (JSImmediate::areBothImmediateNumbers(v1, v2))
     
    198198        return n1 <= n2;
    199199
    200     Machine* machine = callFrame->machine();
     200    Machine* machine = exec->machine();
    201201    if (machine->isJSString(v1) && machine->isJSString(v2))
    202202        return !(static_cast<const JSString*>(v2)->value() < static_cast<const JSString*>(v1)->value());
     
    204204    JSValue* p1;
    205205    JSValue* p2;
    206     bool wasNotString1 = v1->getPrimitiveNumber(callFrame, n1, p1);
    207     bool wasNotString2 = v2->getPrimitiveNumber(callFrame, n2, p2);
     206    bool wasNotString1 = v1->getPrimitiveNumber(exec, n1, p1);
     207    bool wasNotString2 = v2->getPrimitiveNumber(exec, n2, p2);
    208208
    209209    if (wasNotString1 | wasNotString2)
     
    213213}
    214214
    215 static NEVER_INLINE JSValue* jsAddSlowCase(CallFrame* callFrame, JSValue* v1, JSValue* v2)
     215static NEVER_INLINE JSValue* jsAddSlowCase(ExecState* exec, JSValue* v1, JSValue* v2)
    216216{
    217217    // exception for the Date exception in defaultValue()
    218     JSValue* p1 = v1->toPrimitive(callFrame);
    219     JSValue* p2 = v2->toPrimitive(callFrame);
     218    JSValue* p1 = v1->toPrimitive(exec);
     219    JSValue* p2 = v2->toPrimitive(exec);
    220220
    221221    if (p1->isString() || p2->isString()) {
    222         RefPtr<UString::Rep> value = concatenate(p1->toString(callFrame).rep(), p2->toString(callFrame).rep());
     222        RefPtr<UString::Rep> value = concatenate(p1->toString(exec).rep(), p2->toString(exec).rep());
    223223        if (!value)
    224             return throwOutOfMemoryError(callFrame);
    225         return jsString(callFrame, value.release());
    226     }
    227 
    228     return jsNumber(callFrame, p1->toNumber(callFrame) + p2->toNumber(callFrame));
     224            return throwOutOfMemoryError(exec);
     225        return jsString(exec, value.release());
     226    }
     227
     228    return jsNumber(exec, p1->toNumber(exec) + p2->toNumber(exec));
    229229}
    230230
     
    238238//    4000    Add case: 3 5
    239239
    240 static ALWAYS_INLINE JSValue* jsAdd(CallFrame* callFrame, JSValue* v1, JSValue* v2)
     240static ALWAYS_INLINE JSValue* jsAdd(ExecState* exec, JSValue* v1, JSValue* v2)
    241241{
    242242    double left;
     
    245245    bool rightIsNumber = fastIsNumber(v2, right);
    246246    if (rightIsNumber && fastIsNumber(v1, left))
    247         return jsNumber(callFrame, left + right);
     247        return jsNumber(exec, left + right);
    248248   
    249249    bool leftIsString = v1->isString();
     
    251251        RefPtr<UString::Rep> value = concatenate(static_cast<JSString*>(v1)->value().rep(), static_cast<JSString*>(v2)->value().rep());
    252252        if (!value)
    253             return throwOutOfMemoryError(callFrame);
    254         return jsString(callFrame, value.release());
     253            return throwOutOfMemoryError(exec);
     254        return jsString(exec, value.release());
    255255    }
    256256
     
    261261
    262262        if (!value)
    263             return throwOutOfMemoryError(callFrame);
    264         return jsString(callFrame, value.release());
     263            return throwOutOfMemoryError(exec);
     264        return jsString(exec, value.release());
    265265    }
    266266
    267267    // All other cases are pretty uncommon
    268     return jsAddSlowCase(callFrame, v1, v2);
    269 }
    270 
    271 static JSValue* jsTypeStringForValue(CallFrame* callFrame, JSValue* v)
     268    return jsAddSlowCase(exec, v1, v2);
     269}
     270
     271static JSValue* jsTypeStringForValue(ExecState* exec, JSValue* v)
    272272{
    273273    if (v->isUndefined())
    274         return jsNontrivialString(callFrame, "undefined");
     274        return jsNontrivialString(exec, "undefined");
    275275    if (v->isBoolean())
    276         return jsNontrivialString(callFrame, "boolean");
     276        return jsNontrivialString(exec, "boolean");
    277277    if (v->isNumber())
    278         return jsNontrivialString(callFrame, "number");
     278        return jsNontrivialString(exec, "number");
    279279    if (v->isString())
    280         return jsNontrivialString(callFrame, "string");
     280        return jsNontrivialString(exec, "string");
    281281    if (v->isObject()) {
    282282        // Return "undefined" for objects that should be treated
    283283        // as null when doing comparisons.
    284284        if (static_cast<JSObject*>(v)->structureID()->typeInfo().masqueradesAsUndefined())
    285             return jsNontrivialString(callFrame, "undefined");
     285            return jsNontrivialString(exec, "undefined");
    286286        CallData callData;
    287287        if (static_cast<JSObject*>(v)->getCallData(callData) != CallTypeNone)
    288             return jsNontrivialString(callFrame, "function");
    289     }
    290     return jsNontrivialString(callFrame, "object");
     288            return jsNontrivialString(exec, "function");
     289    }
     290    return jsNontrivialString(exec, "object");
    291291}
    292292
     
    319319}
    320320
    321 NEVER_INLINE bool Machine::resolve(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)
     321NEVER_INLINE bool Machine::resolve(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)
    322322{
    323323    int dst = (vPC + 1)->u.operand;
    324324    int property = (vPC + 2)->u.operand;
    325325
    326     ScopeChainNode* scopeChain = callFrame->scopeChain();
     326    ScopeChainNode* scopeChain = this->scopeChain(r);
    327327    ScopeChainIterator iter = scopeChain->begin();
    328328    ScopeChainIterator end = scopeChain->end();
    329329    ASSERT(iter != end);
    330330
    331     CodeBlock* codeBlock = callFrame->codeBlock();
     331    CodeBlock* codeBlock = this->codeBlock(r);
    332332    Identifier& ident = codeBlock->identifiers[property];
    333333    do {
    334334        JSObject* o = *iter;
    335335        PropertySlot slot(o);
    336         if (o->getPropertySlot(callFrame, ident, slot)) {
    337             JSValue* result = slot.getValue(callFrame, ident);
    338             exceptionValue = callFrame->globalData().exception;
     336        if (o->getPropertySlot(exec, ident, slot)) {
     337            JSValue* result = slot.getValue(exec, ident);
     338            exceptionValue = exec->exception();
    339339            if (exceptionValue)
    340340                return false;
    341             callFrame[dst] = result;
     341            r[dst] = result;
    342342            return true;
    343343        }
    344344    } while (++iter != end);
    345     exceptionValue = createUndefinedVariableError(callFrame, ident, vPC, codeBlock);
     345    exceptionValue = createUndefinedVariableError(exec, ident, vPC, codeBlock);
    346346    return false;
    347347}
    348348
    349 NEVER_INLINE bool Machine::resolveSkip(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)
    350 {
    351     CodeBlock* codeBlock = callFrame->codeBlock();
     349NEVER_INLINE bool Machine::resolveSkip(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)
     350{
     351    CodeBlock* codeBlock = this->codeBlock(r);
    352352
    353353    int dst = (vPC + 1)->u.operand;
     
    355355    int skip = (vPC + 3)->u.operand + codeBlock->needsFullScopeChain;
    356356
    357     ScopeChainNode* scopeChain = callFrame->scopeChain();
     357    ScopeChainNode* scopeChain = this->scopeChain(r);
    358358    ScopeChainIterator iter = scopeChain->begin();
    359359    ScopeChainIterator end = scopeChain->end();
     
    367367        JSObject* o = *iter;
    368368        PropertySlot slot(o);
    369         if (o->getPropertySlot(callFrame, ident, slot)) {
    370             JSValue* result = slot.getValue(callFrame, ident);
    371             exceptionValue = callFrame->globalData().exception;
     369        if (o->getPropertySlot(exec, ident, slot)) {
     370            JSValue* result = slot.getValue(exec, ident);
     371            exceptionValue = exec->exception();
    372372            if (exceptionValue)
    373373                return false;
    374             callFrame[dst] = result;
     374            r[dst] = result;
    375375            return true;
    376376        }
    377377    } while (++iter != end);
    378     exceptionValue = createUndefinedVariableError(callFrame, ident, vPC, codeBlock);
     378    exceptionValue = createUndefinedVariableError(exec, ident, vPC, codeBlock);
    379379    return false;
    380380}
    381381
    382 NEVER_INLINE bool Machine::resolveGlobal(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)
     382NEVER_INLINE bool Machine::resolveGlobal(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)
    383383{
    384384    int dst = (vPC + 1)->u.operand;
     
    390390
    391391    if (structureID == globalObject->structureID()) {
    392         callFrame[dst] = globalObject->getDirectOffset(offset);
     392        r[dst] = globalObject->getDirectOffset(offset);
    393393        return true;
    394394    }
    395395
    396     CodeBlock* codeBlock = callFrame->codeBlock();
     396    CodeBlock* codeBlock = this->codeBlock(r);
    397397    Identifier& ident = codeBlock->identifiers[property];
    398398    PropertySlot slot(globalObject);
    399     if (globalObject->getPropertySlot(callFrame, ident, slot)) {
    400         JSValue* result = slot.getValue(callFrame, ident);
     399    if (globalObject->getPropertySlot(exec, ident, slot)) {
     400        JSValue* result = slot.getValue(exec, ident);
    401401        if (slot.isCacheable()) {
    402402            if (vPC[4].u.structureID)
     
    405405            vPC[4] = globalObject->structureID();
    406406            vPC[5] = slot.cachedOffset();
    407             callFrame[dst] = result;
     407            r[dst] = result;
    408408            return true;
    409409        }
    410410
    411         exceptionValue = callFrame->globalData().exception;
     411        exceptionValue = exec->exception();
    412412        if (exceptionValue)
    413413            return false;
    414         callFrame[dst] = result;
     414        r[dst] = result;
    415415        return true;
    416416    }
    417417
    418     exceptionValue = createUndefinedVariableError(callFrame, ident, vPC, codeBlock);
     418    exceptionValue = createUndefinedVariableError(exec, ident, vPC, codeBlock);
    419419    return false;
    420420}
    421421
    422 ALWAYS_INLINE static JSValue* inlineResolveBase(CallFrame* callFrame, Identifier& property, ScopeChainNode* scopeChain)
     422ALWAYS_INLINE static JSValue* inlineResolveBase(ExecState* exec, Identifier& property, ScopeChainNode* scopeChain)
    423423{
    424424    ScopeChainIterator iter = scopeChain->begin();
     
    432432    while (true) {
    433433        base = *iter;
    434         if (next == end || base->getPropertySlot(callFrame, property, slot))
     434        if (next == end || base->getPropertySlot(exec, property, slot))
    435435            return base;
    436436
     
    443443}
    444444
    445 NEVER_INLINE void Machine::resolveBase(CallFrame* callFrame, Instruction* vPC)
     445NEVER_INLINE void Machine::resolveBase(ExecState* exec, Instruction* vPC, Register* r)
    446446{
    447447    int dst = (vPC + 1)->u.operand;
    448448    int property = (vPC + 2)->u.operand;
    449     callFrame[dst] = inlineResolveBase(callFrame, callFrame->codeBlock()->identifiers[property], callFrame->scopeChain());
    450 }
    451 
    452 NEVER_INLINE bool Machine::resolveBaseAndProperty(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)
     449    CodeBlock* codeBlock = this->codeBlock(r);
     450    ScopeChainNode* scopeChain = this->scopeChain(r);
     451    r[dst] = inlineResolveBase(exec, codeBlock->identifiers[property], scopeChain);
     452}
     453
     454NEVER_INLINE bool Machine::resolveBaseAndProperty(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)
    453455{
    454456    int baseDst = (vPC + 1)->u.operand;
     
    456458    int property = (vPC + 3)->u.operand;
    457459
    458     ScopeChainNode* scopeChain = callFrame->scopeChain();
     460    ScopeChainNode* scopeChain = this->scopeChain(r);
    459461    ScopeChainIterator iter = scopeChain->begin();
    460462    ScopeChainIterator end = scopeChain->end();
     
    464466    ASSERT(iter != end);
    465467
    466     CodeBlock* codeBlock = callFrame->codeBlock();
     468    CodeBlock* codeBlock = this->codeBlock(r);
    467469    Identifier& ident = codeBlock->identifiers[property];
    468470    JSObject* base;
     
    470472        base = *iter;
    471473        PropertySlot slot(base);
    472         if (base->getPropertySlot(callFrame, ident, slot)) {
    473             JSValue* result = slot.getValue(callFrame, ident);
    474             exceptionValue = callFrame->globalData().exception;
     474        if (base->getPropertySlot(exec, ident, slot)) {
     475            JSValue* result = slot.getValue(exec, ident);
     476            exceptionValue = exec->exception();
    475477            if (exceptionValue)
    476478                return false;
    477             callFrame[propDst] = result;
    478             callFrame[baseDst] = base;
     479            r[propDst] = result;
     480            r[baseDst] = base;
    479481            return true;
    480482        }
     
    482484    } while (iter != end);
    483485
    484     exceptionValue = createUndefinedVariableError(callFrame, ident, vPC, codeBlock);
     486    exceptionValue = createUndefinedVariableError(exec, ident, vPC, codeBlock);
    485487    return false;
    486488}
    487489
    488 NEVER_INLINE bool Machine::resolveBaseAndFunc(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)
     490NEVER_INLINE bool Machine::resolveBaseAndFunc(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)
    489491{
    490492    int baseDst = (vPC + 1)->u.operand;
     
    492494    int property = (vPC + 3)->u.operand;
    493495
    494     ScopeChainNode* scopeChain = callFrame->scopeChain();
     496    ScopeChainNode* scopeChain = this->scopeChain(r);
    495497    ScopeChainIterator iter = scopeChain->begin();
    496498    ScopeChainIterator end = scopeChain->end();
     
    500502    ASSERT(iter != end);
    501503
    502     CodeBlock* codeBlock = callFrame->codeBlock();
     504    CodeBlock* codeBlock = this->codeBlock(r);
    503505    Identifier& ident = codeBlock->identifiers[property];
    504506    JSObject* base;
     
    506508        base = *iter;
    507509        PropertySlot slot(base);
    508         if (base->getPropertySlot(callFrame, ident, slot)) {           
     510        if (base->getPropertySlot(exec, ident, slot)) {           
    509511            // ECMA 11.2.3 says that if we hit an activation the this value should be null.
    510512            // However, section 10.2.3 says that in the case where the value provided
     
    514516            // that in host objects you always get a valid object for this.
    515517            // We also handle wrapper substitution for the global object at the same time.
    516             JSObject* thisObj = base->toThisObject(callFrame);
    517             JSValue* result = slot.getValue(callFrame, ident);
    518             exceptionValue = callFrame->globalData().exception;
     518            JSObject* thisObj = base->toThisObject(exec);
     519            JSValue* result = slot.getValue(exec, ident);
     520            exceptionValue = exec->exception();
    519521            if (exceptionValue)
    520522                return false;
    521523
    522             callFrame[baseDst] = thisObj;
    523             callFrame[funcDst] = result;
     524            r[baseDst] = thisObj;
     525            r[funcDst] = result;
    524526            return true;
    525527        }
     
    527529    } while (iter != end);
    528530
    529     exceptionValue = createUndefinedVariableError(callFrame, ident, vPC, codeBlock);
     531    exceptionValue = createUndefinedVariableError(exec, ident, vPC, codeBlock);
    530532    return false;
    531533}
    532534
    533 ALWAYS_INLINE CallFrame* Machine::slideRegisterWindowForCall(CodeBlock* newCodeBlock, RegisterFile* registerFile, CallFrame* callFrame, size_t registerOffset, int argc)
    534 {
    535     Register* r = callFrame->registers();
     535ALWAYS_INLINE Register* slideRegisterWindowForCall(CodeBlock* newCodeBlock, RegisterFile* registerFile, Register* r, size_t registerOffset, int argc)
     536{
    536537    Register* newEnd = r + registerOffset + newCodeBlock->numCalleeRegisters;
    537538
     
    565566    }
    566567
    567     return callFrame;
    568 }
    569 
    570 static NEVER_INLINE bool isNotObject(CallFrame* callFrame, bool forInstanceOf, CodeBlock* codeBlock, const Instruction* vPC, JSValue* value, JSValue*& exceptionData)
     568    return r;
     569}
     570
     571static NEVER_INLINE bool isNotObject(ExecState* exec, bool forInstanceOf, CodeBlock* codeBlock, const Instruction* vPC, JSValue* value, JSValue*& exceptionData)
    571572{
    572573    if (value->isObject())
    573574        return false;
    574     exceptionData = createInvalidParamError(callFrame, forInstanceOf ? "instanceof" : "in" , value, vPC, codeBlock);
     575    exceptionData = createInvalidParamError(exec, forInstanceOf ? "instanceof" : "in" , value, vPC, codeBlock);
    575576    return true;
    576577}
    577578
    578 NEVER_INLINE JSValue* Machine::callEval(CallFrame* callFrame, JSObject* thisObj, ScopeChainNode* scopeChain, RegisterFile* registerFile, int argv, int argc, JSValue*& exceptionValue)
     579NEVER_INLINE JSValue* Machine::callEval(ExecState* exec, JSObject* thisObj, ScopeChainNode* scopeChain, RegisterFile* registerFile, Register* r, int argv, int argc, JSValue*& exceptionValue)
    579580{
    580581    if (argc < 2)
    581582        return jsUndefined();
    582583
    583     JSValue* program = callFrame[argv + 1].jsValue(callFrame);
     584    JSValue* program = r[argv + 1].jsValue(exec);
    584585
    585586    if (!program->isString())
     
    588589    Profiler** profiler = Profiler::enabledProfilerReference();
    589590    if (*profiler)
    590         (*profiler)->willExecute(callFrame, scopeChain->globalObject()->evalFunction());
     591        (*profiler)->willExecute(exec, scopeChain->globalObject()->evalFunction());
    591592
    592593    UString programSource = static_cast<JSString*>(program)->value();
    593594
    594     CodeBlock* codeBlock = callFrame->codeBlock();
    595     RefPtr<EvalNode> evalNode = codeBlock->evalCodeCache.get(callFrame, programSource, scopeChain, exceptionValue);
     595    CodeBlock* codeBlock = this->codeBlock(r);
     596    RefPtr<EvalNode> evalNode = codeBlock->evalCodeCache.get(exec, programSource, scopeChain, exceptionValue);
    596597
    597598    JSValue* result = 0;
    598599    if (evalNode)
    599         result = callFrame->globalData().machine->execute(evalNode.get(), callFrame, thisObj, callFrame->registers() - registerFile->start() + argv + 1 + RegisterFile::CallFrameHeaderSize, scopeChain, &exceptionValue);
     600        result = exec->globalData().machine->execute(evalNode.get(), exec, thisObj, r - registerFile->start() + argv + 1 + RegisterFile::CallFrameHeaderSize, scopeChain, &exceptionValue);
    600601
    601602    if (*profiler)
    602         (*profiler)->didExecute(callFrame, scopeChain->globalObject()->evalFunction());
     603        (*profiler)->didExecute(exec, scopeChain->globalObject()->evalFunction());
    603604
    604605    return result;
     
    652653#ifndef NDEBUG
    653654
    654 void Machine::dumpCallFrame(const RegisterFile* registerFile, CallFrame* callFrame)
    655 {
    656     JSGlobalObject* globalObject = callFrame->scopeChain()->globalObject();
    657 
    658     CodeBlock* codeBlock = callFrame->codeBlock();
     655void Machine::dumpCallFrame(const RegisterFile* registerFile, const Register* r)
     656{
     657    JSGlobalObject* globalObject = scopeChain(r)->globalObject();
     658
     659    CodeBlock* codeBlock = this->codeBlock(r);
    659660    codeBlock->dump(globalObject->globalExec());
    660661
    661     dumpRegisters(registerFile, callFrame);
    662 }
    663 
    664 void Machine::dumpRegisters(const RegisterFile* registerFile, CallFrame* callFrame)
     662    dumpRegisters(registerFile, r);
     663}
     664
     665void Machine::dumpRegisters(const RegisterFile* registerFile, const Register* r)
    665666{
    666667    printf("Register frame: \n\n");
     
    669670    printf("----------------------------------------------------\n");
    670671
    671     CodeBlock* codeBlock = callFrame->codeBlock();
     672    CodeBlock* codeBlock = this->codeBlock(r);
    672673    const Register* it;
    673674    const Register* end;
     
    683684    }
    684685   
    685     it = callFrame->registers() - RegisterFile::CallFrameHeaderSize - codeBlock->numParameters;
     686    it = r - RegisterFile::CallFrameHeaderSize - codeBlock->numParameters;
    686687    printf("[this]                     | %10p | %10p \n", it, (*it).v()); ++it;
    687688    end = it + max(codeBlock->numParameters - 1, 0); // - 1 to skip "this"
     
    739740#endif
    740741
     742//#if !defined(NDEBUG) || ENABLE(SAMPLING_TOOL)
     743
    741744bool Machine::isOpcode(Opcode opcode)
    742745{
     
    750753}
    751754
    752 NEVER_INLINE bool Machine::unwindCallFrame(CallFrame*& callFrame, JSValue* exceptionValue, const Instruction*& vPC, CodeBlock*& codeBlock)
     755//#endif
     756
     757NEVER_INLINE bool Machine::unwindCallFrame(ExecState*& exec, JSValue* exceptionValue, const Instruction*& vPC, CodeBlock*& codeBlock, Register*& r)
    753758{
    754759    CodeBlock* oldCodeBlock = codeBlock;
    755     ScopeChainNode* scopeChain = callFrame->scopeChain();
    756 
    757     if (Debugger* debugger = callFrame->dynamicGlobalObject()->debugger()) {
    758         DebuggerCallFrame debuggerCallFrame(callFrame, exceptionValue);
    759         if (callFrame->callee())
     760    ScopeChainNode* scopeChain = this->scopeChain(r);
     761
     762    if (Debugger* debugger = exec->dynamicGlobalObject()->debugger()) {
     763        DebuggerCallFrame debuggerCallFrame(exec->dynamicGlobalObject(), codeBlock, scopeChain, r, exceptionValue);
     764        if (r[RegisterFile::Callee].jsValue(exec))
    760765            debugger->returnEvent(debuggerCallFrame, codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->lastLine());
    761766        else
     
    764769
    765770    if (Profiler* profiler = *Profiler::enabledProfilerReference()) {
    766         if (callFrame->callee())
    767             profiler->didExecute(callFrame, callFrame->callee());
     771        if (r[RegisterFile::Callee].jsValue(exec))
     772            profiler->didExecute(exec, static_cast<JSObject*>(r[RegisterFile::Callee].jsValue(exec)));
    768773        else
    769             profiler->didExecute(callFrame, codeBlock->ownerNode->sourceURL(), codeBlock->ownerNode->lineNo());
     774            profiler->didExecute(exec, codeBlock->ownerNode->sourceURL(), codeBlock->ownerNode->lineNo());
    770775    }
    771776
     
    774779        while (!scopeChain->object->isObject(&JSActivation::info))
    775780            scopeChain = scopeChain->pop();
    776         static_cast<JSActivation*>(scopeChain->object)->copyRegisters(callFrame->optionalCalleeArguments());
    777     } else if (Arguments* arguments = callFrame->optionalCalleeArguments()) {
     781        JSActivation* activation = static_cast<JSActivation*>(scopeChain->object);
     782        ASSERT(activation->isObject(&JSActivation::info));
     783
     784        Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue());
     785        ASSERT(!arguments || arguments->isObject(&Arguments::info));
     786
     787        activation->copyRegisters(arguments);
     788    } else if (Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue())) {
     789        ASSERT(arguments->isObject(&Arguments::info));
    778790        if (!arguments->isTornOff())
    779791            arguments->copyRegisters();
     
    783795        scopeChain->deref();
    784796
    785     void* returnPC = callFrame->returnPC();
    786     callFrame = callFrame->callerFrame();
    787     if (callFrame->hasHostCallFrameFlag())
     797    void* returnPC = r[RegisterFile::ReturnPC].v();
     798    r = r[RegisterFile::CallerRegisters].r();
     799    exec = CallFrame::create(r);
     800    if (isHostCallFrame(r))
    788801        return false;
    789802
    790     codeBlock = callFrame->codeBlock();
     803    codeBlock = this->codeBlock(r);
    791804    vPC = vPCForPC(codeBlock, returnPC);
    792805    return true;
    793806}
    794807
    795 NEVER_INLINE Instruction* Machine::throwException(CallFrame*& callFrame, JSValue*& exceptionValue, const Instruction* vPC, bool explicitThrow)
     808NEVER_INLINE Instruction* Machine::throwException(ExecState* exec, JSValue*& exceptionValue, const Instruction* vPC, Register*& r, bool explicitThrow)
    796809{
    797810    // Set up the exception object
    798811   
    799     CodeBlock* codeBlock = callFrame->codeBlock();
     812    CodeBlock* codeBlock = this->codeBlock(r);
    800813    if (exceptionValue->isObject()) {
    801814        JSObject* exception = static_cast<JSObject*>(exceptionValue);
    802815        if (exception->isNotAnObjectErrorStub()) {
    803             exception = createNotAnObjectError(callFrame, static_cast<JSNotAnObjectErrorStub*>(exception), vPC, codeBlock);
     816            exception = createNotAnObjectError(exec, static_cast<JSNotAnObjectErrorStub*>(exception), vPC, codeBlock);
    804817            exceptionValue = exception;
    805818        } else {
    806             if (!exception->hasProperty(callFrame, Identifier(callFrame, "line")) &&
    807                 !exception->hasProperty(callFrame, Identifier(callFrame, "sourceId")) &&
    808                 !exception->hasProperty(callFrame, Identifier(callFrame, "sourceURL")) &&
    809                 !exception->hasProperty(callFrame, Identifier(callFrame, expressionBeginOffsetPropertyName)) &&
    810                 !exception->hasProperty(callFrame, Identifier(callFrame, expressionCaretOffsetPropertyName)) &&
    811                 !exception->hasProperty(callFrame, Identifier(callFrame, expressionEndOffsetPropertyName))) {
     819            if (!exception->hasProperty(exec, Identifier(exec, "line")) &&
     820                !exception->hasProperty(exec, Identifier(exec, "sourceId")) &&
     821                !exception->hasProperty(exec, Identifier(exec, "sourceURL")) &&
     822                !exception->hasProperty(exec, Identifier(exec, expressionBeginOffsetPropertyName)) &&
     823                !exception->hasProperty(exec, Identifier(exec, expressionCaretOffsetPropertyName)) &&
     824                !exception->hasProperty(exec, Identifier(exec, expressionEndOffsetPropertyName))) {
    812825                if (explicitThrow) {
    813826                    int startOffset = 0;
     
    815828                    int divotPoint = 0;
    816829                    int line = codeBlock->expressionRangeForVPC(vPC, divotPoint, startOffset, endOffset);
    817                     exception->putWithAttributes(callFrame, Identifier(callFrame, "line"), jsNumber(callFrame, line), ReadOnly | DontDelete);
     830                    exception->putWithAttributes(exec, Identifier(exec, "line"), jsNumber(exec, line), ReadOnly | DontDelete);
    818831                   
    819832                    // We only hit this path for error messages and throw statements, which don't have a specific failure position
    820833                    // So we just give the full range of the error/throw statement.
    821                     exception->putWithAttributes(callFrame, Identifier(callFrame, expressionBeginOffsetPropertyName), jsNumber(callFrame, divotPoint - startOffset), ReadOnly | DontDelete);
    822                     exception->putWithAttributes(callFrame, Identifier(callFrame, expressionEndOffsetPropertyName), jsNumber(callFrame, divotPoint + endOffset), ReadOnly | DontDelete);
     834                    exception->putWithAttributes(exec, Identifier(exec, expressionBeginOffsetPropertyName), jsNumber(exec, divotPoint - startOffset), ReadOnly | DontDelete);
     835                    exception->putWithAttributes(exec, Identifier(exec, expressionEndOffsetPropertyName), jsNumber(exec, divotPoint + endOffset), ReadOnly | DontDelete);
    823836                } else
    824                     exception->putWithAttributes(callFrame, Identifier(callFrame, "line"), jsNumber(callFrame, codeBlock->lineNumberForVPC(vPC)), ReadOnly | DontDelete);
    825                 exception->putWithAttributes(callFrame, Identifier(callFrame, "sourceId"), jsNumber(callFrame, codeBlock->ownerNode->sourceID()), ReadOnly | DontDelete);
    826                 exception->putWithAttributes(callFrame, Identifier(callFrame, "sourceURL"), jsOwnedString(callFrame, codeBlock->ownerNode->sourceURL()), ReadOnly | DontDelete);
     837                    exception->putWithAttributes(exec, Identifier(exec, "line"), jsNumber(exec, codeBlock->lineNumberForVPC(vPC)), ReadOnly | DontDelete);
     838                exception->putWithAttributes(exec, Identifier(exec, "sourceId"), jsNumber(exec, codeBlock->ownerNode->sourceID()), ReadOnly | DontDelete);
     839                exception->putWithAttributes(exec, Identifier(exec, "sourceURL"), jsOwnedString(exec, codeBlock->ownerNode->sourceURL()), ReadOnly | DontDelete);
    827840            }
    828841           
    829842            if (exception->isWatchdogException()) {
    830                 while (unwindCallFrame(callFrame, exceptionValue, vPC, codeBlock)) {
     843                while (unwindCallFrame(exec, exceptionValue, vPC, codeBlock, r)) {
    831844                    // Don't need handler checks or anything, we just want to unroll all the JS callframes possible.
    832845                }
     
    836849    }
    837850
    838     if (Debugger* debugger = callFrame->dynamicGlobalObject()->debugger()) {
    839         DebuggerCallFrame debuggerCallFrame(callFrame, exceptionValue);
     851    if (Debugger* debugger = exec->dynamicGlobalObject()->debugger()) {
     852        ScopeChainNode* scopeChain = this->scopeChain(r);
     853        DebuggerCallFrame debuggerCallFrame(exec->dynamicGlobalObject(), codeBlock, scopeChain, r, exceptionValue);
    840854        debugger->exception(debuggerCallFrame, codeBlock->ownerNode->sourceID(), codeBlock->lineNumberForVPC(vPC));
    841855    }
     
    847861
    848862    while (!codeBlock->getHandlerForVPC(vPC, handlerVPC, scopeDepth)) {
    849         if (!unwindCallFrame(callFrame, exceptionValue, vPC, codeBlock))
     863        if (!unwindCallFrame(exec, exceptionValue, vPC, codeBlock, r))
    850864            return 0;
    851865    }
     
    853867    // Now unwind the scope chain within the exception handler's call frame.
    854868
    855     ScopeChain sc(callFrame->scopeChain());
     869    ScopeChain sc(this->scopeChain(r));
    856870    int scopeDelta = depth(codeBlock, sc) - scopeDepth;
    857871    ASSERT(scopeDelta >= 0);
    858872    while (scopeDelta--)
    859873        sc.pop();
    860     callFrame->setScopeChain(sc.node());
     874    r[RegisterFile::ScopeChain] = sc.node();
    861875
    862876    return handlerVPC;
    863877}
    864878
    865 class DynamicGlobalObjectScope : Noncopyable {
     879class DynamicGlobalObjectScope {
    866880public:
    867     DynamicGlobalObjectScope(CallFrame* callFrame, JSGlobalObject* dynamicGlobalObject)
    868         : m_dynamicGlobalObjectSlot(callFrame->globalData().dynamicGlobalObject)
    869         , m_savedDynamicGlobalObject(m_dynamicGlobalObjectSlot)
     881    DynamicGlobalObjectScope(ExecState* exec, JSGlobalObject* dynamicGlobalObject)
     882        : m_exec(exec)
     883        , m_savedGlobalObject(exec->globalData().dynamicGlobalObject)
    870884    {
    871         m_dynamicGlobalObjectSlot = dynamicGlobalObject;
     885        exec->globalData().dynamicGlobalObject = dynamicGlobalObject;
    872886    }
    873887
    874888    ~DynamicGlobalObjectScope()
    875889    {
    876         m_dynamicGlobalObjectSlot = m_savedDynamicGlobalObject;
     890        m_exec->globalData().dynamicGlobalObject = m_savedGlobalObject;
    877891    }
    878892
    879893private:
    880     JSGlobalObject*& m_dynamicGlobalObjectSlot;
    881     JSGlobalObject* m_savedDynamicGlobalObject;
     894    ExecState* m_exec;
     895    JSGlobalObject* m_savedGlobalObject;
    882896};
    883897
    884 JSValue* Machine::execute(ProgramNode* programNode, CallFrame* callFrame, ScopeChainNode* scopeChain, JSObject* thisObj, JSValue** exception)
    885 {
    886     ASSERT(!scopeChain->globalData->exception);
     898JSValue* Machine::execute(ProgramNode* programNode, ExecState* exec, ScopeChainNode* scopeChain, JSObject* thisObj, JSValue** exception)
     899{
     900    ASSERT(!exec->hadException());
    887901
    888902    if (m_reentryDepth >= MaxReentryDepth) {
    889         *exception = createStackOverflowError(callFrame);
     903        *exception = createStackOverflowError(exec);
    890904        return jsNull();
    891905    }
     
    896910    Register* newEnd = oldEnd + codeBlock->numParameters + RegisterFile::CallFrameHeaderSize + codeBlock->numCalleeRegisters;
    897911    if (!m_registerFile.grow(newEnd)) {
    898         *exception = createStackOverflowError(callFrame);
     912        *exception = createStackOverflowError(exec);
    899913        return jsNull();
    900914    }
    901915
    902     DynamicGlobalObjectScope globalObjectScope(callFrame, scopeChain->globalObject());
     916    DynamicGlobalObjectScope globalObjectScope(exec, scopeChain->globalObject());
    903917
    904918    JSGlobalObject* lastGlobalObject = m_registerFile.globalObject();
    905     JSGlobalObject* globalObject = callFrame->dynamicGlobalObject();
     919    JSGlobalObject* globalObject = exec->dynamicGlobalObject();
    906920    globalObject->copyGlobalsTo(m_registerFile);
    907921
    908     CallFrame* newCallFrame = CallFrame::create(oldEnd + codeBlock->numParameters + RegisterFile::CallFrameHeaderSize);
    909     newCallFrame[codeBlock->thisRegister] = thisObj;
    910     newCallFrame->init(codeBlock, 0, scopeChain, CallFrame::noCaller(), 0, 0, 0);
     922    Register* r = oldEnd + codeBlock->numParameters + RegisterFile::CallFrameHeaderSize;
     923    r[codeBlock->thisRegister] = thisObj;
     924    initializeCallFrame(r, codeBlock, 0, scopeChain, makeHostCallFramePointer(0), 0, 0, 0);
    911925
    912926    if (codeBlock->needsFullScopeChain)
     
    915929    Profiler** profiler = Profiler::enabledProfilerReference();
    916930    if (*profiler)
    917         (*profiler)->willExecute(callFrame, programNode->sourceURL(), programNode->lineNo());
     931        (*profiler)->willExecute(exec, programNode->sourceURL(), programNode->lineNo());
    918932
    919933    m_reentryDepth++;
    920934#if ENABLE(CTI)
    921935    if (!codeBlock->ctiCode)
    922         CTI::compile(this, callFrame, codeBlock);
    923     JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, callFrame, scopeChain->globalData, exception);
     936        CTI::compile(this, exec, codeBlock);
     937    JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, r, scopeChain->globalData, exception);
    924938#else
    925     JSValue* result = privateExecute(Normal, &m_registerFile, callFrame, exception);
     939    JSValue* result = privateExecute(Normal, &m_registerFile, r, exception);
    926940#endif
    927941    m_reentryDepth--;
     
    930944
    931945    if (*profiler)
    932         (*profiler)->didExecute(callFrame, programNode->sourceURL(), programNode->lineNo());
     946        (*profiler)->didExecute(exec, programNode->sourceURL(), programNode->lineNo());
    933947
    934948    if (m_reentryDepth && lastGlobalObject && globalObject != lastGlobalObject)
     
    940954}
    941955
    942 JSValue* Machine::execute(FunctionBodyNode* functionBodyNode, CallFrame* callFrame, JSFunction* function, JSObject* thisObj, const ArgList& args, ScopeChainNode* scopeChain, JSValue** exception)
    943 {
    944     ASSERT(!scopeChain->globalData->exception);
     956JSValue* Machine::execute(FunctionBodyNode* functionBodyNode, ExecState* exec, JSFunction* function, JSObject* thisObj, const ArgList& args, ScopeChainNode* scopeChain, JSValue** exception)
     957{
     958    ASSERT(!exec->hadException());
    945959
    946960    if (m_reentryDepth >= MaxReentryDepth) {
    947         *exception = createStackOverflowError(callFrame);
     961        *exception = createStackOverflowError(exec);
    948962        return jsNull();
    949963    }
     
    953967
    954968    if (!m_registerFile.grow(oldEnd + argc)) {
    955         *exception = createStackOverflowError(callFrame);
     969        *exception = createStackOverflowError(exec);
    956970        return jsNull();
    957971    }
    958972
    959     DynamicGlobalObjectScope globalObjectScope(callFrame, callFrame->globalData().dynamicGlobalObject ? callFrame->globalData().dynamicGlobalObject : scopeChain->globalObject());
    960 
    961     CallFrame* newCallFrame = CallFrame::create(oldEnd);
     973    DynamicGlobalObjectScope globalObjectScope(exec, exec->globalData().dynamicGlobalObject ? exec->globalData().dynamicGlobalObject : scopeChain->globalObject());
     974
     975    Register* argv = oldEnd;
    962976    size_t dst = 0;
    963     newCallFrame[0] = thisObj;
     977    argv[dst] = thisObj;
     978
    964979    ArgList::const_iterator end = args.end();
    965980    for (ArgList::const_iterator it = args.begin(); it != end; ++it)
    966         newCallFrame[++dst] = *it;
     981        argv[++dst] = *it;
    967982
    968983    CodeBlock* codeBlock = &functionBodyNode->byteCode(scopeChain);
    969     callFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc);
    970     if (UNLIKELY(!callFrame)) {
    971         *exception = createStackOverflowError(callFrame);
     984    Register* r = slideRegisterWindowForCall(codeBlock, &m_registerFile, argv, argc + RegisterFile::CallFrameHeaderSize, argc);
     985    if (UNLIKELY(!r)) {
     986        *exception = createStackOverflowError(exec);
    972987        m_registerFile.shrink(oldEnd);
    973988        return jsNull();
    974989    }
    975990    // a 0 codeBlock indicates a built-in caller
    976     callFrame->init(codeBlock, 0, scopeChain, newCallFrame->addHostCallFrameFlag(), 0, argc, function);
     991    initializeCallFrame(r, codeBlock, 0, scopeChain, makeHostCallFramePointer(exec->registers()), 0, argc, function);
    977992
    978993    Profiler** profiler = Profiler::enabledProfilerReference();
    979994    if (*profiler)
    980         (*profiler)->willExecute(callFrame, function);
     995        (*profiler)->willExecute(exec, function);
    981996
    982997    m_reentryDepth++;
    983998#if ENABLE(CTI)
    984999    if (!codeBlock->ctiCode)
    985         CTI::compile(this, callFrame, codeBlock);
    986     JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, callFrame, scopeChain->globalData, exception);
     1000        CTI::compile(this, exec, codeBlock);
     1001    JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, r, scopeChain->globalData, exception);
    9871002#else
    988     JSValue* result = privateExecute(Normal, &m_registerFile, callFrame, exception);
     1003    JSValue* result = privateExecute(Normal, &m_registerFile, r, exception);
    9891004#endif
    9901005    m_reentryDepth--;
     
    9961011}
    9971012
    998 JSValue* Machine::execute(EvalNode* evalNode, CallFrame* callFrame, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue** exception)
    999 {
    1000     return execute(evalNode, callFrame, thisObj, m_registerFile.size() + evalNode->byteCode(scopeChain).numParameters + RegisterFile::CallFrameHeaderSize, scopeChain, exception);
    1001 }
    1002 
    1003 JSValue* Machine::execute(EvalNode* evalNode, CallFrame* callFrame, JSObject* thisObj, int registerOffset, ScopeChainNode* scopeChain, JSValue** exception)
    1004 {
    1005     ASSERT(!scopeChain->globalData->exception);
     1013JSValue* Machine::execute(EvalNode* evalNode, ExecState* exec, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue** exception)
     1014{
     1015    return execute(evalNode, exec, thisObj, m_registerFile.size() + evalNode->byteCode(scopeChain).numParameters + RegisterFile::CallFrameHeaderSize, scopeChain, exception);
     1016}
     1017
     1018JSValue* Machine::execute(EvalNode* evalNode, ExecState* exec, JSObject* thisObj, int registerOffset, ScopeChainNode* scopeChain, JSValue** exception)
     1019{
     1020    ASSERT(!exec->hadException());
    10061021
    10071022    if (m_reentryDepth >= MaxReentryDepth) {
    1008         *exception = createStackOverflowError(callFrame);
     1023        *exception = createStackOverflowError(exec);
    10091024        return jsNull();
    10101025    }
    10111026
    1012     DynamicGlobalObjectScope globalObjectScope(callFrame, callFrame->globalData().dynamicGlobalObject ? callFrame->globalData().dynamicGlobalObject : scopeChain->globalObject());
     1027    DynamicGlobalObjectScope globalObjectScope(exec, exec->globalData().dynamicGlobalObject ? exec->globalData().dynamicGlobalObject : scopeChain->globalObject());
    10131028
    10141029    EvalCodeBlock* codeBlock = &evalNode->byteCode(scopeChain);
     
    10311046        for (Node::VarStack::const_iterator it = varStack.begin(); it != varStackEnd; ++it) {
    10321047            const Identifier& ident = (*it).first;
    1033             if (!variableObject->hasProperty(callFrame, ident)) {
     1048            if (!variableObject->hasProperty(exec, ident)) {
    10341049                PutPropertySlot slot;
    1035                 variableObject->put(callFrame, ident, jsUndefined(), slot);
     1050                variableObject->put(exec, ident, jsUndefined(), slot);
    10361051            }
    10371052        }
     
    10411056        for (Node::FunctionStack::const_iterator it = functionStack.begin(); it != functionStackEnd; ++it) {
    10421057            PutPropertySlot slot;
    1043             variableObject->put(callFrame, (*it)->m_ident, (*it)->makeFunction(callFrame, scopeChain), slot);
     1058            variableObject->put(exec, (*it)->m_ident, (*it)->makeFunction(exec, scopeChain), slot);
    10441059        }
    10451060
     
    10491064    Register* newEnd = m_registerFile.start() + registerOffset + codeBlock->numCalleeRegisters;
    10501065    if (!m_registerFile.grow(newEnd)) {
    1051         *exception = createStackOverflowError(callFrame);
     1066        *exception = createStackOverflowError(exec);
    10521067        return jsNull();
    10531068    }
    10541069
    1055     CallFrame* newCallFrame = CallFrame::create(m_registerFile.start() + registerOffset);
     1070    Register* r = m_registerFile.start() + registerOffset;
    10561071
    10571072    // a 0 codeBlock indicates a built-in caller
    1058     newCallFrame[codeBlock->thisRegister] = thisObj;
    1059     newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), 0, 0, 0);
     1073    r[codeBlock->thisRegister] = thisObj;
     1074    initializeCallFrame(r, codeBlock, 0, scopeChain, makeHostCallFramePointer(exec->registers()), 0, 0, 0);
    10601075
    10611076    if (codeBlock->needsFullScopeChain)
     
    10641079    Profiler** profiler = Profiler::enabledProfilerReference();
    10651080    if (*profiler)
    1066         (*profiler)->willExecute(newCallFrame, evalNode->sourceURL(), evalNode->lineNo());
     1081        (*profiler)->willExecute(exec, evalNode->sourceURL(), evalNode->lineNo());
    10671082
    10681083    m_reentryDepth++;
    10691084#if ENABLE(CTI)
    10701085    if (!codeBlock->ctiCode)
    1071         CTI::compile(this, newCallFrame, codeBlock);
    1072     JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);
     1086        CTI::compile(this, exec, codeBlock);
     1087    JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, r, scopeChain->globalData, exception);
    10731088#else
    1074     JSValue* result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
     1089    JSValue* result = privateExecute(Normal, &m_registerFile, r, exception);
    10751090#endif
    10761091    m_reentryDepth--;
     
    10791094
    10801095    if (*profiler)
    1081         (*profiler)->didExecute(callFrame, evalNode->sourceURL(), evalNode->lineNo());
     1096        (*profiler)->didExecute(exec, evalNode->sourceURL(), evalNode->lineNo());
    10821097
    10831098    m_registerFile.shrink(oldEnd);
     
    10851100}
    10861101
    1087 NEVER_INLINE void Machine::debug(CallFrame* callFrame, DebugHookID debugHookID, int firstLine, int lastLine)
    1088 {
    1089     Debugger* debugger = callFrame->dynamicGlobalObject()->debugger();
     1102NEVER_INLINE void Machine::debug(ExecState* exec, Register* r, DebugHookID debugHookID, int firstLine, int lastLine)
     1103{
     1104    Debugger* debugger = exec->dynamicGlobalObject()->debugger();
    10901105    if (!debugger)
    10911106        return;
    10921107
     1108    CodeBlock* codeBlock = this->codeBlock(r);
     1109    ScopeChainNode* scopeChain = this->scopeChain(r);
     1110    DebuggerCallFrame debuggerCallFrame(exec->dynamicGlobalObject(), codeBlock, scopeChain, r, 0);
     1111
    10931112    switch (debugHookID) {
    10941113        case DidEnterCallFrame:
    1095             debugger->callEvent(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), firstLine);
     1114            debugger->callEvent(debuggerCallFrame, codeBlock->ownerNode->sourceID(), firstLine);
    10961115            return;
    10971116        case WillLeaveCallFrame:
    1098             debugger->returnEvent(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), lastLine);
     1117            debugger->returnEvent(debuggerCallFrame, codeBlock->ownerNode->sourceID(), lastLine);
    10991118            return;
    11001119        case WillExecuteStatement:
    1101             debugger->atStatement(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), firstLine);
     1120            debugger->atStatement(debuggerCallFrame, codeBlock->ownerNode->sourceID(), firstLine);
    11021121            return;
    11031122        case WillExecuteProgram:
    1104             debugger->willExecuteProgram(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), firstLine);
     1123            debugger->willExecuteProgram(debuggerCallFrame, codeBlock->ownerNode->sourceID(), firstLine);
    11051124            return;
    11061125        case DidExecuteProgram:
    1107             debugger->didExecuteProgram(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), lastLine);
     1126            debugger->didExecuteProgram(debuggerCallFrame, codeBlock->ownerNode->sourceID(), lastLine);
    11081127            return;
    11091128        case DidReachBreakpoint:
    1110             debugger->didReachBreakpoint(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), lastLine);
     1129            debugger->didReachBreakpoint(debuggerCallFrame, codeBlock->ownerNode->sourceID(), lastLine);
    11111130            return;
    11121131    }
     
    11981217}
    11991218
    1200 NEVER_INLINE ScopeChainNode* Machine::createExceptionScope(CallFrame* callFrame, const Instruction* vPC)
     1219NEVER_INLINE ScopeChainNode* Machine::createExceptionScope(ExecState* exec, const Instruction* vPC, Register* r)
    12011220{
    12021221    int dst = (++vPC)->u.operand;
    1203     CodeBlock* codeBlock = callFrame->codeBlock();
     1222    CodeBlock* codeBlock = this->codeBlock(r);
    12041223    Identifier& property = codeBlock->identifiers[(++vPC)->u.operand];
    1205     JSValue* value = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    1206     JSObject* scope = new (callFrame) JSStaticScopeObject(callFrame, property, value, DontDelete);
    1207     callFrame[dst] = scope;
    1208 
    1209     return callFrame->scopeChain()->push(scope);
    1210 }
    1211 
    1212 static StructureIDChain* cachePrototypeChain(CallFrame* callFrame, StructureID* structureID)
    1213 {
    1214     JSValue* prototype = structureID->prototypeForLookup(callFrame);
     1224    JSValue* value = r[(++vPC)->u.operand].jsValue(exec);
     1225    JSObject* scope = new (exec) JSStaticScopeObject(exec, property, value, DontDelete);
     1226    r[dst] = scope;
     1227
     1228    return scopeChain(r)->push(scope);
     1229}
     1230
     1231static StructureIDChain* cachePrototypeChain(ExecState* exec, StructureID* structureID)
     1232{
     1233    JSValue* prototype = structureID->prototypeForLookup(exec);
    12151234    if (JSImmediate::isImmediate(prototype))
    12161235        return 0;
     
    12201239}
    12211240
    1222 NEVER_INLINE void Machine::tryCachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const PutPropertySlot& slot)
     1241NEVER_INLINE void Machine::tryCachePutByID(ExecState* exec, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const PutPropertySlot& slot)
    12231242{
    12241243    // Recursive invocation may already have specialized this instruction.
     
    12721291        StructureIDChain* chain = structureID->cachedPrototypeChain();
    12731292        if (!chain) {
    1274             chain = cachePrototypeChain(callFrame, structureID);
     1293            chain = cachePrototypeChain(exec, structureID);
    12751294            if (!chain) {
    12761295                // This happens if someone has manually inserted null into the prototype chain
     
    12971316}
    12981317
    1299 NEVER_INLINE void Machine::tryCacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot)
     1318NEVER_INLINE void Machine::tryCacheGetByID(ExecState* exec, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot)
    13001319{
    13011320    // Recursive invocation may already have specialized this instruction.
     
    13091328    }
    13101329
    1311     if (isJSArray(baseValue) && propertyName == callFrame->propertyNames().length) {
     1330    if (isJSArray(baseValue) && propertyName == exec->propertyNames().length) {
    13121331        vPC[0] = getOpcode(op_get_array_length);
    13131332        return;
    13141333    }
    13151334
    1316     if (isJSString(baseValue) && propertyName == callFrame->propertyNames().length) {
     1335    if (isJSString(baseValue) && propertyName == exec->propertyNames().length) {
    13171336        vPC[0] = getOpcode(op_get_string_length);
    13181337        return;
     
    13561375    }
    13571376
    1358     if (slot.slotBase() == structureID->prototypeForLookup(callFrame)) {
     1377    if (slot.slotBase() == structureID->prototypeForLookup(exec)) {
    13591378        ASSERT(slot.slotBase()->isObject());
    13601379
     
    13801399    JSObject* o = static_cast<JSObject*>(baseValue);
    13811400    while (slot.slotBase() != o) {
    1382         JSValue* v = o->structureID()->prototypeForLookup(callFrame);
     1401        JSValue* v = o->structureID()->prototypeForLookup(exec);
    13831402
    13841403        // If we didn't find base in baseValue's prototype chain, then baseValue
     
    14041423    StructureIDChain* chain = structureID->cachedPrototypeChain();
    14051424    if (!chain)
    1406         chain = cachePrototypeChain(callFrame, structureID);
     1425        chain = cachePrototypeChain(exec, structureID);
    14071426    ASSERT(chain);
    14081427
     
    14221441}
    14231442
    1424 JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile, CallFrame* callFrame, JSValue** exception)
     1443JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile, Register* r, JSValue** exception)
    14251444{
    14261445    // One-time initialization of our address tables. We have to put this code
     
    14471466#endif
    14481467
    1449     JSGlobalData* globalData = &callFrame->globalData();
     1468#define exec CallFrame::create(r)
     1469
     1470    JSGlobalData* globalData = &exec->globalData();
    14501471    JSValue* exceptionValue = 0;
    14511472    Instruction* handlerVPC = 0;
    14521473
    1453     Instruction* vPC = callFrame->codeBlock()->instructions.begin();
     1474    Instruction* vPC = this->codeBlock(r)->instructions.begin();
    14541475    Profiler** enabledProfilerReference = Profiler::enabledProfilerReference();
    14551476    unsigned tickCount = m_ticksUntilNextTimeoutCheck + 1;
     
    14691490#define CHECK_FOR_TIMEOUT() \
    14701491    if (!--tickCount) { \
    1471         if ((exceptionValue = checkTimeout(callFrame->dynamicGlobalObject()))) \
     1492        if ((exceptionValue = checkTimeout(exec->dynamicGlobalObject()))) \
    14721493            goto vm_throw; \
    14731494        tickCount = m_ticksUntilNextTimeoutCheck; \
     
    14751496
    14761497#if HAVE(COMPUTED_GOTO)
    1477     #define NEXT_OPCODE MACHINE_SAMPLING_sample(callFrame->codeBlock(), vPC); goto *vPC->u.opcode
     1498    #define NEXT_OPCODE MACHINE_SAMPLING_sample(this->codeBlock(r), vPC); goto *vPC->u.opcode
    14781499#if DUMP_OPCODE_STATS
    14791500    #define BEGIN_OPCODE(opcode) opcode: OpcodeStats::recordInstruction(opcode);
     
    14831504    NEXT_OPCODE;
    14841505#else
    1485     #define NEXT_OPCODE MACHINE_SAMPLING_sample(callFrame->codeBlock(), vPC); goto interpreterLoopStart
     1506    #define NEXT_OPCODE MACHINE_SAMPLING_sample(this->codeBlock(r), vPC); goto interpreterLoopStart
    14861507#if DUMP_OPCODE_STATS
    14871508    #define BEGIN_OPCODE(opcode) case opcode: OpcodeStats::recordInstruction(opcode);
     
    15011522        */
    15021523        int dst = (++vPC)->u.operand;
    1503         callFrame[dst] = constructEmptyObject(callFrame);
     1524        r[dst] = constructEmptyObject(exec);
    15041525
    15051526        ++vPC;
     
    15171538        int firstArg = (++vPC)->u.operand;
    15181539        int argCount = (++vPC)->u.operand;
    1519         ArgList args(callFrame->registers() + firstArg, argCount);
    1520         callFrame[dst] = constructArray(callFrame, args);
     1540        ArgList args(r + firstArg, argCount);
     1541        r[dst] = constructArray(exec, args);
    15211542
    15221543        ++vPC;
     
    15321553        int dst = (++vPC)->u.operand;
    15331554        int regExp = (++vPC)->u.operand;
    1534         callFrame[dst] = new (globalData) RegExpObject(callFrame->scopeChain()->globalObject()->regExpStructure(), callFrame->codeBlock()->regexps[regExp]);
     1555        r[dst] = new (globalData) RegExpObject(scopeChain(r)->globalObject()->regExpStructure(), codeBlock(r)->regexps[regExp]);
    15351556
    15361557        ++vPC;
     
    15441565        int dst = (++vPC)->u.operand;
    15451566        int src = (++vPC)->u.operand;
    1546         callFrame[dst] = callFrame[src];
     1567        r[dst] = r[src];
    15471568
    15481569        ++vPC;
     
    15571578        */
    15581579        int dst = (++vPC)->u.operand;
    1559         JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    1560         JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1580        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
     1581        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
    15611582        if (JSImmediate::areBothImmediateNumbers(src1, src2))
    1562             callFrame[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2));
     1583            r[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2));
    15631584        else {
    1564             JSValue* result = jsBoolean(equalSlowCase(callFrame, src1, src2));
     1585            JSValue* result = jsBoolean(equalSlowCase(exec, src1, src2));
    15651586            VM_CHECK_EXCEPTION();
    1566             callFrame[dst] = result;
     1587            r[dst] = result;
    15671588        }
    15681589
     
    15771598        */
    15781599        int dst = (++vPC)->u.operand;
    1579         JSValue* src = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1600        JSValue* src = r[(++vPC)->u.operand].jsValue(exec);
    15801601
    15811602        if (src->isUndefinedOrNull()) {
    1582             callFrame[dst] = jsBoolean(true);
     1603            r[dst] = jsBoolean(true);
    15831604            ++vPC;
    15841605            NEXT_OPCODE;
    15851606        }
    15861607       
    1587         callFrame[dst] = jsBoolean(!JSImmediate::isImmediate(src) && src->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
     1608        r[dst] = jsBoolean(!JSImmediate::isImmediate(src) && src->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
    15881609        ++vPC;
    15891610        NEXT_OPCODE;
     
    15971618        */
    15981619        int dst = (++vPC)->u.operand;
    1599         JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    1600         JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1620        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
     1621        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
    16011622        if (JSImmediate::areBothImmediateNumbers(src1, src2))
    1602             callFrame[dst] = jsBoolean(src1 != src2);
     1623            r[dst] = jsBoolean(src1 != src2);
    16031624        else {
    1604             JSValue* result = jsBoolean(!equalSlowCase(callFrame, src1, src2));
     1625            JSValue* result = jsBoolean(!equalSlowCase(exec, src1, src2));
    16051626            VM_CHECK_EXCEPTION();
    1606             callFrame[dst] = result;
     1627            r[dst] = result;
    16071628        }
    16081629
     
    16171638        */
    16181639        int dst = (++vPC)->u.operand;
    1619         JSValue* src = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1640        JSValue* src = r[(++vPC)->u.operand].jsValue(exec);
    16201641
    16211642        if (src->isUndefinedOrNull()) {
    1622             callFrame[dst] = jsBoolean(false);
     1643            r[dst] = jsBoolean(false);
    16231644            ++vPC;
    16241645            NEXT_OPCODE;
    16251646        }
    16261647       
    1627         callFrame[dst] = jsBoolean(JSImmediate::isImmediate(src) || !static_cast<JSCell*>(src)->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
     1648        r[dst] = jsBoolean(JSImmediate::isImmediate(src) || !static_cast<JSCell*>(src)->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
    16281649        ++vPC;
    16291650        NEXT_OPCODE;
     
    16371658        */
    16381659        int dst = (++vPC)->u.operand;
    1639         JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    1640         JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1660        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
     1661        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
    16411662        if (JSImmediate::areBothImmediate(src1, src2))
    1642             callFrame[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2));
     1663            r[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2));
    16431664        else if (JSImmediate::isEitherImmediate(src1, src2) & (src1 != JSImmediate::zeroImmediate()) & (src2 != JSImmediate::zeroImmediate()))
    1644             callFrame[dst] = jsBoolean(false);
     1665            r[dst] = jsBoolean(false);
    16451666        else
    1646             callFrame[dst] = jsBoolean(strictEqualSlowCase(src1, src2));
     1667            r[dst] = jsBoolean(strictEqualSlowCase(src1, src2));
    16471668
    16481669        ++vPC;
     
    16571678        */
    16581679        int dst = (++vPC)->u.operand;
    1659         JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    1660         JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1680        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
     1681        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
    16611682
    16621683        if (JSImmediate::areBothImmediate(src1, src2))
    1663             callFrame[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) != reinterpret_cast<intptr_t>(src2));
     1684            r[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) != reinterpret_cast<intptr_t>(src2));
    16641685        else if (JSImmediate::isEitherImmediate(src1, src2) & (src1 != JSImmediate::zeroImmediate()) & (src2 != JSImmediate::zeroImmediate()))
    1665             callFrame[dst] = jsBoolean(true);
     1686            r[dst] = jsBoolean(true);
    16661687        else
    1667             callFrame[dst] = jsBoolean(!strictEqualSlowCase(src1, src2));
     1688            r[dst] = jsBoolean(!strictEqualSlowCase(src1, src2));
    16681689
    16691690        ++vPC;
     
    16781699        */
    16791700        int dst = (++vPC)->u.operand;
    1680         JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    1681         JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    1682         JSValue* result = jsBoolean(jsLess(callFrame, src1, src2));
     1701        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
     1702        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
     1703        JSValue* result = jsBoolean(jsLess(exec, src1, src2));
    16831704        VM_CHECK_EXCEPTION();
    1684         callFrame[dst] = result;
     1705        r[dst] = result;
    16851706
    16861707        ++vPC;
     
    16951716        */
    16961717        int dst = (++vPC)->u.operand;
    1697         JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    1698         JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    1699         JSValue* result = jsBoolean(jsLessEq(callFrame, src1, src2));
     1718        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
     1719        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
     1720        JSValue* result = jsBoolean(jsLessEq(exec, src1, src2));
    17001721        VM_CHECK_EXCEPTION();
    1701         callFrame[dst] = result;
     1722        r[dst] = result;
    17021723
    17031724        ++vPC;
     
    17111732        */
    17121733        int srcDst = (++vPC)->u.operand;
    1713         JSValue* v = callFrame[srcDst].jsValue(callFrame);
     1734        JSValue* v = r[srcDst].jsValue(exec);
    17141735        if (JSImmediate::canDoFastAdditiveOperations(v))
    1715             callFrame[srcDst] = JSImmediate::incImmediateNumber(v);
     1736            r[srcDst] = JSImmediate::incImmediateNumber(v);
    17161737        else {
    1717             JSValue* result = jsNumber(callFrame, v->toNumber(callFrame) + 1);
     1738            JSValue* result = jsNumber(exec, v->toNumber(exec) + 1);
    17181739            VM_CHECK_EXCEPTION();
    1719             callFrame[srcDst] = result;
     1740            r[srcDst] = result;
    17201741        }
    17211742
     
    17301751        */
    17311752        int srcDst = (++vPC)->u.operand;
    1732         JSValue* v = callFrame[srcDst].jsValue(callFrame);
     1753        JSValue* v = r[srcDst].jsValue(exec);
    17331754        if (JSImmediate::canDoFastAdditiveOperations(v))
    1734             callFrame[srcDst] = JSImmediate::decImmediateNumber(v);
     1755            r[srcDst] = JSImmediate::decImmediateNumber(v);
    17351756        else {
    1736             JSValue* result = jsNumber(callFrame, v->toNumber(callFrame) - 1);
     1757            JSValue* result = jsNumber(exec, v->toNumber(exec) - 1);
    17371758            VM_CHECK_EXCEPTION();
    1738             callFrame[srcDst] = result;
     1759            r[srcDst] = result;
    17391760        }
    17401761
     
    17511772        int dst = (++vPC)->u.operand;
    17521773        int srcDst = (++vPC)->u.operand;
    1753         JSValue* v = callFrame[srcDst].jsValue(callFrame);
     1774        JSValue* v = r[srcDst].jsValue(exec);
    17541775        if (JSImmediate::canDoFastAdditiveOperations(v)) {
    1755             callFrame[dst] = v;
    1756             callFrame[srcDst] = JSImmediate::incImmediateNumber(v);
     1776            r[dst] = v;
     1777            r[srcDst] = JSImmediate::incImmediateNumber(v);
    17571778        } else {
    1758             JSValue* number = callFrame[srcDst].jsValue(callFrame)->toJSNumber(callFrame);
     1779            JSValue* number = r[srcDst].jsValue(exec)->toJSNumber(exec);
    17591780            VM_CHECK_EXCEPTION();
    1760             callFrame[dst] = number;
    1761             callFrame[srcDst] = jsNumber(callFrame, number->uncheckedGetNumber() + 1);
     1781            r[dst] = number;
     1782            r[srcDst] = jsNumber(exec, number->uncheckedGetNumber() + 1);
    17621783        }
    17631784
     
    17741795        int dst = (++vPC)->u.operand;
    17751796        int srcDst = (++vPC)->u.operand;
    1776         JSValue* v = callFrame[srcDst].jsValue(callFrame);
     1797        JSValue* v = r[srcDst].jsValue(exec);
    17771798        if (JSImmediate::canDoFastAdditiveOperations(v)) {
    1778             callFrame[dst] = v;
    1779             callFrame[srcDst] = JSImmediate::decImmediateNumber(v);
     1799            r[dst] = v;
     1800            r[srcDst] = JSImmediate::decImmediateNumber(v);
    17801801        } else {
    1781             JSValue* number = callFrame[srcDst].jsValue(callFrame)->toJSNumber(callFrame);
     1802            JSValue* number = r[srcDst].jsValue(exec)->toJSNumber(exec);
    17821803            VM_CHECK_EXCEPTION();
    1783             callFrame[dst] = number;
    1784             callFrame[srcDst] = jsNumber(callFrame, number->uncheckedGetNumber() - 1);
     1804            r[dst] = number;
     1805            r[srcDst] = jsNumber(exec, number->uncheckedGetNumber() - 1);
    17851806        }
    17861807
     
    17971818        int src = (++vPC)->u.operand;
    17981819
    1799         JSValue* srcVal = callFrame[src].jsValue(callFrame);
     1820        JSValue* srcVal = r[src].jsValue(exec);
    18001821
    18011822        if (LIKELY(JSImmediate::isNumber(srcVal) || static_cast<JSCell*>(srcVal)->structureID()->typeInfo().type() == NumberType)) {
    1802             callFrame[dst] = callFrame[src];
     1823            r[dst] = r[src];
    18031824        } else {
    1804             JSValue* result = srcVal->toJSNumber(callFrame);
     1825            JSValue* result = srcVal->toJSNumber(exec);
    18051826            VM_CHECK_EXCEPTION();
    1806             callFrame[dst] = result;
     1827            r[dst] = result;
    18071828        }
    18081829
     
    18171838        */
    18181839        int dst = (++vPC)->u.operand;
    1819         JSValue* src = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1840        JSValue* src = r[(++vPC)->u.operand].jsValue(exec);
    18201841        double v;
    18211842        if (fastIsNumber(src, v))
    1822             callFrame[dst] = jsNumber(callFrame, -v);
     1843            r[dst] = jsNumber(exec, -v);
    18231844        else {
    1824             JSValue* result = jsNumber(callFrame, -src->toNumber(callFrame));
     1845            JSValue* result = jsNumber(exec, -src->toNumber(exec));
    18251846            VM_CHECK_EXCEPTION();
    1826             callFrame[dst] = result;
     1847            r[dst] = result;
    18271848        }
    18281849
     
    18381859        */
    18391860        int dst = (++vPC)->u.operand;
    1840         JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    1841         JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1861        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
     1862        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
    18421863        if (JSImmediate::canDoFastAdditiveOperations(src1) && JSImmediate::canDoFastAdditiveOperations(src2))
    1843             callFrame[dst] = JSImmediate::addImmediateNumbers(src1, src2);
     1864            r[dst] = JSImmediate::addImmediateNumbers(src1, src2);
    18441865        else {
    1845             JSValue* result = jsAdd(callFrame, src1, src2);
     1866            JSValue* result = jsAdd(exec, src1, src2);
    18461867            VM_CHECK_EXCEPTION();
    1847             callFrame[dst] = result;
     1868            r[dst] = result;
    18481869        }
    18491870        vPC += 2;
     
    18571878        */
    18581879        int dst = (++vPC)->u.operand;
    1859         JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    1860         JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1880        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
     1881        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
    18611882        double left;
    18621883        double right;
    18631884        if (fastIsNumber(src1, left) && fastIsNumber(src2, right))
    1864             callFrame[dst] = jsNumber(callFrame, left * right);
     1885            r[dst] = jsNumber(exec, left * right);
    18651886        else {
    1866             JSValue* result = jsNumber(callFrame, src1->toNumber(callFrame) * src2->toNumber(callFrame));
     1887            JSValue* result = jsNumber(exec, src1->toNumber(exec) * src2->toNumber(exec));
    18671888            VM_CHECK_EXCEPTION();
    1868             callFrame[dst] = result;
     1889            r[dst] = result;
    18691890        }
    18701891
     
    18801901        */
    18811902        int dst = (++vPC)->u.operand;
    1882         JSValue* dividend = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    1883         JSValue* divisor = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1903        JSValue* dividend = r[(++vPC)->u.operand].jsValue(exec);
     1904        JSValue* divisor = r[(++vPC)->u.operand].jsValue(exec);
    18841905        double left;
    18851906        double right;
    18861907        if (fastIsNumber(dividend, left) && fastIsNumber(divisor, right))
    1887             callFrame[dst] = jsNumber(callFrame, left / right);
     1908            r[dst] = jsNumber(exec, left / right);
    18881909        else {
    1889             JSValue* result = jsNumber(callFrame, dividend->toNumber(callFrame) / divisor->toNumber(callFrame));
     1910            JSValue* result = jsNumber(exec, dividend->toNumber(exec) / divisor->toNumber(exec));
    18901911            VM_CHECK_EXCEPTION();
    1891             callFrame[dst] = result;
     1912            r[dst] = result;
    18921913        }
    18931914        ++vPC;
     
    19051926        int divisor = (++vPC)->u.operand;
    19061927
    1907         JSValue* dividendValue = callFrame[dividend].jsValue(callFrame);
    1908         JSValue* divisorValue = callFrame[divisor].jsValue(callFrame);
     1928        JSValue* dividendValue = r[dividend].jsValue(exec);
     1929        JSValue* divisorValue = r[divisor].jsValue(exec);
    19091930
    19101931        if (JSImmediate::areBothImmediateNumbers(dividendValue, divisorValue) && divisorValue != JSImmediate::from(0)) {
    1911             callFrame[dst] = JSImmediate::from(JSImmediate::getTruncatedInt32(dividendValue) % JSImmediate::getTruncatedInt32(divisorValue));
     1932            r[dst] = JSImmediate::from(JSImmediate::getTruncatedInt32(dividendValue) % JSImmediate::getTruncatedInt32(divisorValue));
    19121933            ++vPC;
    19131934            NEXT_OPCODE;
    19141935        }
    19151936
    1916         double d = dividendValue->toNumber(callFrame);
    1917         JSValue* result = jsNumber(callFrame, fmod(d, divisorValue->toNumber(callFrame)));
     1937        double d = dividendValue->toNumber(exec);
     1938        JSValue* result = jsNumber(exec, fmod(d, divisorValue->toNumber(exec)));
    19181939        VM_CHECK_EXCEPTION();
    1919         callFrame[dst] = result;
     1940        r[dst] = result;
    19201941        ++vPC;
    19211942        NEXT_OPCODE;
     
    19291950        */
    19301951        int dst = (++vPC)->u.operand;
    1931         JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    1932         JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1952        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
     1953        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
    19331954        double left;
    19341955        double right;
    19351956        if (JSImmediate::canDoFastAdditiveOperations(src1) && JSImmediate::canDoFastAdditiveOperations(src2))
    1936             callFrame[dst] = JSImmediate::subImmediateNumbers(src1, src2);
     1957            r[dst] = JSImmediate::subImmediateNumbers(src1, src2);
    19371958        else if (fastIsNumber(src1, left) && fastIsNumber(src2, right))
    1938             callFrame[dst] = jsNumber(callFrame, left - right);
     1959            r[dst] = jsNumber(exec, left - right);
    19391960        else {
    1940             JSValue* result = jsNumber(callFrame, src1->toNumber(callFrame) - src2->toNumber(callFrame));
     1961            JSValue* result = jsNumber(exec, src1->toNumber(exec) - src2->toNumber(exec));
    19411962            VM_CHECK_EXCEPTION();
    1942             callFrame[dst] = result;
     1963            r[dst] = result;
    19431964        }
    19441965        vPC += 2;
     
    19531974        */
    19541975        int dst = (++vPC)->u.operand;
    1955         JSValue* val = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    1956         JSValue* shift = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1976        JSValue* val = r[(++vPC)->u.operand].jsValue(exec);
     1977        JSValue* shift = r[(++vPC)->u.operand].jsValue(exec);
    19571978        int32_t left;
    19581979        uint32_t right;
    19591980        if (JSImmediate::areBothImmediateNumbers(val, shift))
    1960             callFrame[dst] = jsNumber(callFrame, JSImmediate::getTruncatedInt32(val) << (JSImmediate::getTruncatedUInt32(shift) & 0x1f));
     1981            r[dst] = jsNumber(exec, JSImmediate::getTruncatedInt32(val) << (JSImmediate::getTruncatedUInt32(shift) & 0x1f));
    19611982        else if (fastToInt32(val, left) && fastToUInt32(shift, right))
    1962             callFrame[dst] = jsNumber(callFrame, left << (right & 0x1f));
     1983            r[dst] = jsNumber(exec, left << (right & 0x1f));
    19631984        else {
    1964             JSValue* result = jsNumber(callFrame, (val->toInt32(callFrame)) << (shift->toUInt32(callFrame) & 0x1f));
     1985            JSValue* result = jsNumber(exec, (val->toInt32(exec)) << (shift->toUInt32(exec) & 0x1f));
    19651986            VM_CHECK_EXCEPTION();
    1966             callFrame[dst] = result;
     1987            r[dst] = result;
    19671988        }
    19681989
     
    19781999        */
    19792000        int dst = (++vPC)->u.operand;
    1980         JSValue* val = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    1981         JSValue* shift = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     2001        JSValue* val = r[(++vPC)->u.operand].jsValue(exec);
     2002        JSValue* shift = r[(++vPC)->u.operand].jsValue(exec);
    19822003        int32_t left;
    19832004        uint32_t right;
    19842005        if (JSImmediate::areBothImmediateNumbers(val, shift))
    1985             callFrame[dst] = JSImmediate::rightShiftImmediateNumbers(val, shift);
     2006            r[dst] = JSImmediate::rightShiftImmediateNumbers(val, shift);
    19862007        else if (fastToInt32(val, left) && fastToUInt32(shift, right))
    1987             callFrame[dst] = jsNumber(callFrame, left >> (right & 0x1f));
     2008            r[dst] = jsNumber(exec, left >> (right & 0x1f));
    19882009        else {
    1989             JSValue* result = jsNumber(callFrame, (val->toInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
     2010            JSValue* result = jsNumber(exec, (val->toInt32(exec)) >> (shift->toUInt32(exec) & 0x1f));
    19902011            VM_CHECK_EXCEPTION();
    1991             callFrame[dst] = result;
     2012            r[dst] = result;
    19922013        }
    19932014
     
    20032024        */
    20042025        int dst = (++vPC)->u.operand;
    2005         JSValue* val = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    2006         JSValue* shift = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     2026        JSValue* val = r[(++vPC)->u.operand].jsValue(exec);
     2027        JSValue* shift = r[(++vPC)->u.operand].jsValue(exec);
    20072028        if (JSImmediate::areBothImmediateNumbers(val, shift) && !JSImmediate::isNegative(val))
    2008             callFrame[dst] = JSImmediate::rightShiftImmediateNumbers(val, shift);
     2029            r[dst] = JSImmediate::rightShiftImmediateNumbers(val, shift);
    20092030        else {
    2010             JSValue* result = jsNumber(callFrame, (val->toUInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
     2031            JSValue* result = jsNumber(exec, (val->toUInt32(exec)) >> (shift->toUInt32(exec) & 0x1f));
    20112032            VM_CHECK_EXCEPTION();
    2012             callFrame[dst] = result;
     2033            r[dst] = result;
    20132034        }
    20142035
     
    20242045        */
    20252046        int dst = (++vPC)->u.operand;
    2026         JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    2027         JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     2047        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
     2048        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
    20282049        int32_t left;
    20292050        int32_t right;
    20302051        if (JSImmediate::areBothImmediateNumbers(src1, src2))
    2031             callFrame[dst] = JSImmediate::andImmediateNumbers(src1, src2);
     2052            r[dst] = JSImmediate::andImmediateNumbers(src1, src2);
    20322053        else if (fastToInt32(src1, left) && fastToInt32(src2, right))
    2033             callFrame[dst] = jsNumber(callFrame, left & right);
     2054            r[dst] = jsNumber(exec, left & right);
    20342055        else {
    2035             JSValue* result = jsNumber(callFrame, src1->toInt32(callFrame) & src2->toInt32(callFrame));
     2056            JSValue* result = jsNumber(exec, src1->toInt32(exec) & src2->toInt32(exec));
    20362057            VM_CHECK_EXCEPTION();
    2037             callFrame[dst] = result;
     2058            r[dst] = result;
    20382059        }
    20392060
     
    20492070        */
    20502071        int dst = (++vPC)->u.operand;
    2051         JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    2052         JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     2072        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
     2073        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
    20532074        int32_t left;
    20542075        int32_t right;
    20552076        if (JSImmediate::areBothImmediateNumbers(src1, src2))
    2056             callFrame[dst] = JSImmediate::xorImmediateNumbers(src1, src2);
     2077            r[dst] = JSImmediate::xorImmediateNumbers(src1, src2);
    20572078        else if (fastToInt32(src1, left) && fastToInt32(src2, right))
    2058             callFrame[dst] = jsNumber(callFrame, left ^ right);
     2079            r[dst] = jsNumber(exec, left ^ right);
    20592080        else {
    2060             JSValue* result = jsNumber(callFrame, src1->toInt32(callFrame) ^ src2->toInt32(callFrame));
     2081            JSValue* result = jsNumber(exec, src1->toInt32(exec) ^ src2->toInt32(exec));
    20612082            VM_CHECK_EXCEPTION();
    2062             callFrame[dst] = result;
     2083            r[dst] = result;
    20632084        }
    20642085
     
    20742095        */
    20752096        int dst = (++vPC)->u.operand;
    2076         JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    2077         JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     2097        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
     2098        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
    20782099        int32_t left;
    20792100        int32_t right;
    20802101        if (JSImmediate::areBothImmediateNumbers(src1, src2))
    2081             callFrame[dst] = JSImmediate::orImmediateNumbers(src1, src2);
     2102            r[dst] = JSImmediate::orImmediateNumbers(src1, src2);
    20822103        else if (fastToInt32(src1, left) && fastToInt32(src2, right))
    2083             callFrame[dst] = jsNumber(callFrame, left | right);
     2104            r[dst] = jsNumber(exec, left | right);
    20842105        else {
    2085             JSValue* result = jsNumber(callFrame, src1->toInt32(callFrame) | src2->toInt32(callFrame));
     2106            JSValue* result = jsNumber(exec, src1->toInt32(exec) | src2->toInt32(exec));
    20862107            VM_CHECK_EXCEPTION();
    2087             callFrame[dst] = result;
     2108            r[dst] = result;
    20882109        }
    20892110
     
    20982119        */
    20992120        int dst = (++vPC)->u.operand;
    2100         JSValue* src = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     2121        JSValue* src = r[(++vPC)->u.operand].jsValue(exec);
    21012122        int32_t value;
    21022123        if (fastToInt32(src, value))
    2103             callFrame[dst] = jsNumber(callFrame, ~value);
     2124            r[dst] = jsNumber(exec, ~value);
    21042125        else {
    2105             JSValue* result = jsNumber(callFrame, ~src->toInt32(callFrame));
     2126            JSValue* result = jsNumber(exec, ~src->toInt32(exec));
    21062127            VM_CHECK_EXCEPTION();
    2107             callFrame[dst] = result;
     2128            r[dst] = result;
    21082129        }
    21092130        ++vPC;
     
    21182139        int dst = (++vPC)->u.operand;
    21192140        int src = (++vPC)->u.operand;
    2120         JSValue* result = jsBoolean(!callFrame[src].jsValue(callFrame)->toBoolean(callFrame));
     2141        JSValue* result = jsBoolean(!r[src].jsValue(exec)->toBoolean(exec));
    21212142        VM_CHECK_EXCEPTION();
    2122         callFrame[dst] = result;
     2143        r[dst] = result;
    21232144
    21242145        ++vPC;
     
    21432164        int baseProto = (++vPC)->u.operand;
    21442165
    2145         JSValue* baseVal = callFrame[base].jsValue(callFrame);
    2146 
    2147         if (isNotObject(callFrame, true, callFrame->codeBlock(), vPC, baseVal, exceptionValue))
     2166        JSValue* baseVal = r[base].jsValue(exec);
     2167
     2168        if (isNotObject(exec, true, codeBlock(r), vPC, baseVal, exceptionValue))
    21482169            goto vm_throw;
    21492170
    21502171        JSObject* baseObj = static_cast<JSObject*>(baseVal);
    2151         callFrame[dst] = jsBoolean(baseObj->structureID()->typeInfo().implementsHasInstance() ? baseObj->hasInstance(callFrame, callFrame[value].jsValue(callFrame), callFrame[baseProto].jsValue(callFrame)) : false);
     2172        r[dst] = jsBoolean(baseObj->structureID()->typeInfo().implementsHasInstance() ? baseObj->hasInstance(exec, r[value].jsValue(exec), r[baseProto].jsValue(exec)) : false);
    21522173
    21532174        ++vPC;
     
    21622183        int dst = (++vPC)->u.operand;
    21632184        int src = (++vPC)->u.operand;
    2164         callFrame[dst] = jsTypeStringForValue(callFrame, callFrame[src].jsValue(callFrame));
     2185        r[dst] = jsTypeStringForValue(exec, r[src].jsValue(exec));
    21652186
    21662187        ++vPC;
     
    21762197        int dst = (++vPC)->u.operand;
    21772198        int src = (++vPC)->u.operand;
    2178         JSValue* v = callFrame[src].jsValue(callFrame);
    2179         callFrame[dst] = jsBoolean(JSImmediate::isImmediate(v) ? v->isUndefined() : v->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
     2199        JSValue* v = r[src].jsValue(exec);
     2200        r[dst] = jsBoolean(JSImmediate::isImmediate(v) ? v->isUndefined() : v->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
    21802201
    21812202        ++vPC;
     
    21912212        int dst = (++vPC)->u.operand;
    21922213        int src = (++vPC)->u.operand;
    2193         callFrame[dst] = jsBoolean(callFrame[src].jsValue(callFrame)->isBoolean());
     2214        r[dst] = jsBoolean(r[src].jsValue(exec)->isBoolean());
    21942215
    21952216        ++vPC;
     
    22052226        int dst = (++vPC)->u.operand;
    22062227        int src = (++vPC)->u.operand;
    2207         callFrame[dst] = jsBoolean(callFrame[src].jsValue(callFrame)->isNumber());
     2228        r[dst] = jsBoolean(r[src].jsValue(exec)->isNumber());
    22082229
    22092230        ++vPC;
     
    22192240        int dst = (++vPC)->u.operand;
    22202241        int src = (++vPC)->u.operand;
    2221         callFrame[dst] = jsBoolean(callFrame[src].jsValue(callFrame)->isString());
     2242        r[dst] = jsBoolean(r[src].jsValue(exec)->isString());
    22222243
    22232244        ++vPC;
     
    22332254        int dst = (++vPC)->u.operand;
    22342255        int src = (++vPC)->u.operand;
    2235         callFrame[dst] = jsBoolean(jsIsObjectType(callFrame[src].jsValue(callFrame)));
     2256        r[dst] = jsBoolean(jsIsObjectType(r[src].jsValue(exec)));
    22362257
    22372258        ++vPC;
     
    22472268        int dst = (++vPC)->u.operand;
    22482269        int src = (++vPC)->u.operand;
    2249         callFrame[dst] = jsBoolean(jsIsFunctionType(callFrame[src].jsValue(callFrame)));
     2270        r[dst] = jsBoolean(jsIsFunctionType(r[src].jsValue(exec)));
    22502271
    22512272        ++vPC;
     
    22652286        int base = (++vPC)->u.operand;
    22662287
    2267         JSValue* baseVal = callFrame[base].jsValue(callFrame);
    2268         if (isNotObject(callFrame, false, callFrame->codeBlock(), vPC, baseVal, exceptionValue))
     2288        JSValue* baseVal = r[base].jsValue(exec);
     2289        if (isNotObject(exec, false, codeBlock(r), vPC, baseVal, exceptionValue))
    22692290            goto vm_throw;
    22702291
    22712292        JSObject* baseObj = static_cast<JSObject*>(baseVal);
    22722293
    2273         JSValue* propName = callFrame[property].jsValue(callFrame);
     2294        JSValue* propName = r[property].jsValue(exec);
    22742295
    22752296        uint32_t i;
    22762297        if (propName->getUInt32(i))
    2277             callFrame[dst] = jsBoolean(baseObj->hasProperty(callFrame, i));
     2298            r[dst] = jsBoolean(baseObj->hasProperty(exec, i));
    22782299        else {
    2279             Identifier property(callFrame, propName->toString(callFrame));
     2300            Identifier property(exec, propName->toString(exec));
    22802301            VM_CHECK_EXCEPTION();
    2281             callFrame[dst] = jsBoolean(baseObj->hasProperty(callFrame, property));
     2302            r[dst] = jsBoolean(baseObj->hasProperty(exec, property));
    22822303        }
    22832304
     
    22922313           dst. If the property is not found, raises an exception.
    22932314        */
    2294         if (UNLIKELY(!resolve(callFrame, vPC, exceptionValue)))
     2315        if (UNLIKELY(!resolve(exec, vPC, r, exceptionValue)))
    22952316            goto vm_throw;
    22962317
     
    23052326         value to register dst. If the property is not found, raises an exception.
    23062327         */
    2307         if (UNLIKELY(!resolveSkip(callFrame, vPC, exceptionValue)))
     2328        if (UNLIKELY(!resolveSkip(exec, vPC, r, exceptionValue)))
    23082329            goto vm_throw;
    23092330
     
    23202341           cache the new structureID and offset
    23212342         */
    2322         if (UNLIKELY(!resolveGlobal(callFrame, vPC, exceptionValue)))
     2343        if (UNLIKELY(!resolveGlobal(exec, vPC, r, exceptionValue)))
    23232344            goto vm_throw;
    23242345       
     
    23372358        int index = (++vPC)->u.operand;
    23382359
    2339         callFrame[dst] = scope->registerAt(index);
     2360        r[dst] = scope->registerAt(index);
    23402361        ++vPC;
    23412362        NEXT_OPCODE;
     
    23512372        int value = (++vPC)->u.operand;
    23522373       
    2353         scope->registerAt(index) = callFrame[value].jsValue(callFrame);
     2374        scope->registerAt(index) = r[value].jsValue(exec);
    23542375        ++vPC;
    23552376        NEXT_OPCODE;
     
    23632384        int dst = (++vPC)->u.operand;
    23642385        int index = (++vPC)->u.operand;
    2365         int skip = (++vPC)->u.operand + callFrame->codeBlock()->needsFullScopeChain;
    2366 
    2367         ScopeChainNode* scopeChain = callFrame->scopeChain();
     2386        int skip = (++vPC)->u.operand + codeBlock(r)->needsFullScopeChain;
     2387
     2388        ScopeChainNode* scopeChain = this->scopeChain(r);
    23682389        ScopeChainIterator iter = scopeChain->begin();
    23692390        ScopeChainIterator end = scopeChain->end();
     
    23762397        ASSERT((*iter)->isVariableObject());
    23772398        JSVariableObject* scope = static_cast<JSVariableObject*>(*iter);
    2378         callFrame[dst] = scope->registerAt(index);
     2399        r[dst] = scope->registerAt(index);
    23792400        ++vPC;
    23802401        NEXT_OPCODE;
     
    23852406         */
    23862407        int index = (++vPC)->u.operand;
    2387         int skip = (++vPC)->u.operand + callFrame->codeBlock()->needsFullScopeChain;
     2408        int skip = (++vPC)->u.operand + codeBlock(r)->needsFullScopeChain;
    23882409        int value = (++vPC)->u.operand;
    23892410
    2390         ScopeChainNode* scopeChain = callFrame->scopeChain();
     2411        ScopeChainNode* scopeChain = this->scopeChain(r);
    23912412        ScopeChainIterator iter = scopeChain->begin();
    23922413        ScopeChainIterator end = scopeChain->end();
     
    23992420        ASSERT((*iter)->isVariableObject());
    24002421        JSVariableObject* scope = static_cast<JSVariableObject*>(*iter);
    2401         scope->registerAt(index) = callFrame[value].jsValue(callFrame);
     2422        scope->registerAt(index) = r[value].jsValue(exec);
    24022423        ++vPC;
    24032424        NEXT_OPCODE;
     
    24112432           will be the global object) is stored in register dst.
    24122433        */
    2413         resolveBase(callFrame, vPC);
     2434        resolveBase(exec, vPC, r);
    24142435
    24152436        vPC += 3;
     
    24282449           avoids duplicate hash lookups.
    24292450        */
    2430         if (UNLIKELY(!resolveBaseAndProperty(callFrame, vPC, exceptionValue)))
     2451        if (UNLIKELY(!resolveBaseAndProperty(exec, vPC, r, exceptionValue)))
    24312452            goto vm_throw;
    24322453
     
    24492470           calls but not for other property lookup.
    24502471        */
    2451         if (UNLIKELY(!resolveBaseAndFunc(callFrame, vPC, exceptionValue)))
     2472        if (UNLIKELY(!resolveBaseAndFunc(exec, vPC, r, exceptionValue)))
    24522473            goto vm_throw;
    24532474
     
    24652486        int property = vPC[3].u.operand;
    24662487
    2467         CodeBlock* codeBlock = callFrame->codeBlock();
     2488        CodeBlock* codeBlock = this->codeBlock(r);
    24682489        Identifier& ident = codeBlock->identifiers[property];
    2469         JSValue* baseValue = callFrame[base].jsValue(callFrame);
     2490        JSValue* baseValue = r[base].jsValue(exec);
    24702491        PropertySlot slot(baseValue);
    2471         JSValue* result = baseValue->get(callFrame, ident, slot);
     2492        JSValue* result = baseValue->get(exec, ident, slot);
    24722493        VM_CHECK_EXCEPTION();
    24732494
    2474         tryCacheGetByID(callFrame, codeBlock, vPC, baseValue, ident, slot);
    2475 
    2476         callFrame[dst] = result;
     2495        tryCacheGetByID(exec, codeBlock, vPC, baseValue, ident, slot);
     2496
     2497        r[dst] = result;
    24772498        vPC += 8;
    24782499        NEXT_OPCODE;
     
    24862507        */
    24872508        int base = vPC[2].u.operand;
    2488         JSValue* baseValue = callFrame[base].jsValue(callFrame);
     2509        JSValue* baseValue = r[base].jsValue(exec);
    24892510
    24902511        if (LIKELY(!JSImmediate::isImmediate(baseValue))) {
     
    24982519                int offset = vPC[5].u.operand;
    24992520
    2500                 ASSERT(baseObject->get(callFrame, callFrame->codeBlock()->identifiers[vPC[3].u.operand]) == baseObject->getDirectOffset(offset));
    2501                 callFrame[dst] = baseObject->getDirectOffset(offset);
     2521                ASSERT(baseObject->get(exec, codeBlock(r)->identifiers[vPC[3].u.operand]) == baseObject->getDirectOffset(offset));
     2522                r[dst] = baseObject->getDirectOffset(offset);
    25022523
    25032524                vPC += 8;
     
    25062527        }
    25072528
    2508         uncacheGetByID(callFrame->codeBlock(), vPC);
     2529        uncacheGetByID(codeBlock(r), vPC);
    25092530        NEXT_OPCODE;
    25102531    }
     
    25172538        */
    25182539        int base = vPC[2].u.operand;
    2519         JSValue* baseValue = callFrame[base].jsValue(callFrame);
     2540        JSValue* baseValue = r[base].jsValue(exec);
    25202541
    25212542        if (LIKELY(!JSImmediate::isImmediate(baseValue))) {
     
    25242545
    25252546            if (LIKELY(baseCell->structureID() == structureID)) {
    2526                 ASSERT(structureID->prototypeForLookup(callFrame)->isObject());
    2527                 JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(callFrame));
     2547                ASSERT(structureID->prototypeForLookup(exec)->isObject());
     2548                JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(exec));
    25282549                StructureID* protoStructureID = vPC[5].u.structureID;
    25292550
     
    25322553                    int offset = vPC[6].u.operand;
    25332554
    2534                     ASSERT(protoObject->get(callFrame, callFrame->codeBlock()->identifiers[vPC[3].u.operand]) == protoObject->getDirectOffset(offset));
    2535                     callFrame[dst] = protoObject->getDirectOffset(offset);
     2555                    ASSERT(protoObject->get(exec, codeBlock(r)->identifiers[vPC[3].u.operand]) == protoObject->getDirectOffset(offset));
     2556                    r[dst] = protoObject->getDirectOffset(offset);
    25362557
    25372558                    vPC += 8;
     
    25412562        }
    25422563
    2543         uncacheGetByID(callFrame->codeBlock(), vPC);
     2564        uncacheGetByID(codeBlock(r), vPC);
    25442565        NEXT_OPCODE;
    25452566    }
     
    25522573        */
    25532574        int base = vPC[2].u.operand;
    2554         JSValue* baseValue = callFrame[base].jsValue(callFrame);
     2575        JSValue* baseValue = r[base].jsValue(exec);
    25552576
    25562577        if (LIKELY(!JSImmediate::isImmediate(baseValue))) {
     
    25652586                JSObject* baseObject = static_cast<JSObject*>(baseCell);
    25662587                while (1) {
    2567                     baseObject = static_cast<JSObject*>(baseObject->structureID()->prototypeForLookup(callFrame));
     2588                    baseObject = static_cast<JSObject*>(baseObject->structureID()->prototypeForLookup(exec));
    25682589                    if (UNLIKELY(baseObject->structureID() != (*it).get()))
    25692590                        break;
     
    25732594                        int offset = vPC[7].u.operand;
    25742595
    2575                         ASSERT(baseObject->get(callFrame, callFrame->codeBlock()->identifiers[vPC[3].u.operand]) == baseObject->getDirectOffset(offset));
    2576                         callFrame[dst] = baseObject->getDirectOffset(offset);
     2596                        ASSERT(baseObject->get(exec, codeBlock(r)->identifiers[vPC[3].u.operand]) == baseObject->getDirectOffset(offset));
     2597                        r[dst] = baseObject->getDirectOffset(offset);
    25772598
    25782599                        vPC += 8;
     
    25832604        }
    25842605
    2585         uncacheGetByID(callFrame->codeBlock(), vPC);
     2606        uncacheGetByID(codeBlock(r), vPC);
    25862607        NEXT_OPCODE;
    25872608    }
     
    25962617        int property = vPC[3].u.operand;
    25972618
    2598         Identifier& ident = callFrame->codeBlock()->identifiers[property];
    2599         JSValue* baseValue = callFrame[base].jsValue(callFrame);
     2619        Identifier& ident = codeBlock(r)->identifiers[property];
     2620        JSValue* baseValue = r[base].jsValue(exec);
    26002621        PropertySlot slot(baseValue);
    2601         JSValue* result = baseValue->get(callFrame, ident, slot);
     2622        JSValue* result = baseValue->get(exec, ident, slot);
    26022623        VM_CHECK_EXCEPTION();
    26032624
    2604         callFrame[dst] = result;
     2625        r[dst] = result;
    26052626        vPC += 8;
    26062627        NEXT_OPCODE;
     
    26152636
    26162637        int base = vPC[2].u.operand;
    2617         JSValue* baseValue = callFrame[base].jsValue(callFrame);
     2638        JSValue* baseValue = r[base].jsValue(exec);
    26182639        if (LIKELY(isJSArray(baseValue))) {
    26192640            int dst = vPC[1].u.operand;
    2620             callFrame[dst] = jsNumber(callFrame, static_cast<JSArray*>(baseValue)->length());
     2641            r[dst] = jsNumber(exec, static_cast<JSArray*>(baseValue)->length());
    26212642            vPC += 8;
    26222643            NEXT_OPCODE;
    26232644        }
    26242645
    2625         uncacheGetByID(callFrame->codeBlock(), vPC);
     2646        uncacheGetByID(codeBlock(r), vPC);
    26262647        NEXT_OPCODE;
    26272648    }
     
    26352656
    26362657        int base = vPC[2].u.operand;
    2637         JSValue* baseValue = callFrame[base].jsValue(callFrame);
     2658        JSValue* baseValue = r[base].jsValue(exec);
    26382659        if (LIKELY(isJSString(baseValue))) {
    26392660            int dst = vPC[1].u.operand;
    2640             callFrame[dst] = jsNumber(callFrame, static_cast<JSString*>(baseValue)->value().size());
     2661            r[dst] = jsNumber(exec, static_cast<JSString*>(baseValue)->value().size());
    26412662            vPC += 8;
    26422663            NEXT_OPCODE;
    26432664        }
    26442665
    2645         uncacheGetByID(callFrame->codeBlock(), vPC);
     2666        uncacheGetByID(codeBlock(r), vPC);
    26462667        NEXT_OPCODE;
    26472668    }
     
    26602681        int value = vPC[3].u.operand;
    26612682
    2662         CodeBlock* codeBlock = callFrame->codeBlock();
    2663         JSValue* baseValue = callFrame[base].jsValue(callFrame);
     2683        CodeBlock* codeBlock = this->codeBlock(r);
     2684        JSValue* baseValue = r[base].jsValue(exec);
    26642685        Identifier& ident = codeBlock->identifiers[property];
    26652686        PutPropertySlot slot;
    2666         baseValue->put(callFrame, ident, callFrame[value].jsValue(callFrame), slot);
     2687        baseValue->put(exec, ident, r[value].jsValue(exec), slot);
    26672688        VM_CHECK_EXCEPTION();
    26682689
    2669         tryCachePutByID(callFrame, codeBlock, vPC, baseValue, slot);
     2690        tryCachePutByID(exec, codeBlock, vPC, baseValue, slot);
    26702691
    26712692        vPC += 8;
     
    26842705         */
    26852706        int base = vPC[1].u.operand;
    2686         JSValue* baseValue = callFrame[base].jsValue(callFrame);
     2707        JSValue* baseValue = r[base].jsValue(exec);
    26872708       
    26882709        if (LIKELY(!JSImmediate::isImmediate(baseValue))) {
     
    26972718                RefPtr<StructureID>* it = vPC[6].u.structureIDChain->head();
    26982719
    2699                 JSObject* proto = static_cast<JSObject*>(baseObject->structureID()->prototypeForLookup(callFrame));
     2720                JSObject* proto = static_cast<JSObject*>(baseObject->structureID()->prototypeForLookup(exec));
    27002721                while (!proto->isNull()) {
    27012722                    if (UNLIKELY(proto->structureID() != (*it).get())) {
    2702                         uncachePutByID(callFrame->codeBlock(), vPC);
     2723                        uncachePutByID(codeBlock(r), vPC);
    27032724                        NEXT_OPCODE;
    27042725                    }
    27052726                    ++it;
    2706                     proto = static_cast<JSObject*>(proto->structureID()->prototypeForLookup(callFrame));
     2727                    proto = static_cast<JSObject*>(proto->structureID()->prototypeForLookup(exec));
    27072728                }
    27082729
     
    27112732                int value = vPC[3].u.operand;
    27122733                unsigned offset = vPC[7].u.operand;
    2713                 ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(callFrame->codeBlock()->identifiers[vPC[2].u.operand])) == offset);
    2714                 baseObject->putDirectOffset(offset, callFrame[value].jsValue(callFrame));
     2734                ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(codeBlock(r)->identifiers[vPC[2].u.operand])) == offset);
     2735                baseObject->putDirectOffset(offset, r[value].jsValue(exec));
    27152736
    27162737                vPC += 8;
     
    27192740        }
    27202741       
    2721         uncachePutByID(callFrame->codeBlock(), vPC);
     2742        uncachePutByID(codeBlock(r), vPC);
    27222743        NEXT_OPCODE;
    27232744    }
     
    27342755        */
    27352756        int base = vPC[1].u.operand;
    2736         JSValue* baseValue = callFrame[base].jsValue(callFrame);
     2757        JSValue* baseValue = r[base].jsValue(exec);
    27372758
    27382759        if (LIKELY(!JSImmediate::isImmediate(baseValue))) {
     
    27462767                unsigned offset = vPC[5].u.operand;
    27472768               
    2748                 ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(callFrame->codeBlock()->identifiers[vPC[2].u.operand])) == offset);
    2749                 baseObject->putDirectOffset(offset, callFrame[value].jsValue(callFrame));
     2769                ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(codeBlock(r)->identifiers[vPC[2].u.operand])) == offset);
     2770                baseObject->putDirectOffset(offset, r[value].jsValue(exec));
    27502771
    27512772                vPC += 8;
     
    27542775        }
    27552776
    2756         uncachePutByID(callFrame->codeBlock(), vPC);
     2777        uncachePutByID(codeBlock(r), vPC);
    27572778        NEXT_OPCODE;
    27582779    }
     
    27702791        int value = vPC[3].u.operand;
    27712792
    2772         JSValue* baseValue = callFrame[base].jsValue(callFrame);
    2773         Identifier& ident = callFrame->codeBlock()->identifiers[property];
     2793        JSValue* baseValue = r[base].jsValue(exec);
     2794        Identifier& ident = codeBlock(r)->identifiers[property];
    27742795        PutPropertySlot slot;
    2775         baseValue->put(callFrame, ident, callFrame[value].jsValue(callFrame), slot);
     2796        baseValue->put(exec, ident, r[value].jsValue(exec), slot);
    27762797        VM_CHECK_EXCEPTION();
    27772798
     
    27912812        int property = (++vPC)->u.operand;
    27922813
    2793         JSObject* baseObj = callFrame[base].jsValue(callFrame)->toObject(callFrame);
    2794         Identifier& ident = callFrame->codeBlock()->identifiers[property];
    2795         JSValue* result = jsBoolean(baseObj->deleteProperty(callFrame, ident));
     2814        JSObject* baseObj = r[base].jsValue(exec)->toObject(exec);
     2815        Identifier& ident = codeBlock(r)->identifiers[property];
     2816        JSValue* result = jsBoolean(baseObj->deleteProperty(exec, ident));
    27962817        VM_CHECK_EXCEPTION();
    2797         callFrame[dst] = result;
     2818        r[dst] = result;
    27982819        ++vPC;
    27992820        NEXT_OPCODE;
     
    28112832        int property = (++vPC)->u.operand;
    28122833       
    2813         JSValue* baseValue = callFrame[base].jsValue(callFrame);
    2814         JSValue* subscript = callFrame[property].jsValue(callFrame);
     2834        JSValue* baseValue = r[base].jsValue(exec);
     2835        JSValue* subscript = r[property].jsValue(exec);
    28152836
    28162837        JSValue* result;
     
    28242845                    result = jsArray->getIndex(i);
    28252846                else
    2826                     result = jsArray->JSArray::get(callFrame, i);
     2847                    result = jsArray->JSArray::get(exec, i);
    28272848            } else if (isJSString(baseValue) && static_cast<JSString*>(baseValue)->canGetIndex(i))
    2828                 result = static_cast<JSString*>(baseValue)->getIndex(&callFrame->globalData(), i);
     2849                result = static_cast<JSString*>(baseValue)->getIndex(&exec->globalData(), i);
    28292850            else
    2830                 result = baseValue->get(callFrame, i);
     2851                result = baseValue->get(exec, i);
    28312852        } else {
    2832             Identifier property(callFrame, subscript->toString(callFrame));
    2833             result = baseValue->get(callFrame, property);
     2853            Identifier property(exec, subscript->toString(exec));
     2854            result = baseValue->get(exec, property);
    28342855        }
    28352856
    28362857        VM_CHECK_EXCEPTION();
    2837         callFrame[dst] = result;
     2858        r[dst] = result;
    28382859        ++vPC;
    28392860        NEXT_OPCODE;
     
    28542875        int value = (++vPC)->u.operand;
    28552876
    2856         JSValue* baseValue = callFrame[base].jsValue(callFrame);
    2857         JSValue* subscript = callFrame[property].jsValue(callFrame);
     2877        JSValue* baseValue = r[base].jsValue(exec);
     2878        JSValue* subscript = r[property].jsValue(exec);
    28582879
    28592880        unsigned i;
     
    28642885                JSArray* jsArray = static_cast<JSArray*>(baseValue);
    28652886                if (jsArray->canSetIndex(i))
    2866                     jsArray->setIndex(i, callFrame[value].jsValue(callFrame));
     2887                    jsArray->setIndex(i, r[value].jsValue(exec));
    28672888                else
    2868                     jsArray->JSArray::put(callFrame, i, callFrame[value].jsValue(callFrame));
     2889                    jsArray->JSArray::put(exec, i, r[value].jsValue(exec));
    28692890            } else
    2870                 baseValue->put(callFrame, i, callFrame[value].jsValue(callFrame));
     2891                baseValue->put(exec, i, r[value].jsValue(exec));
    28712892        } else {
    2872             Identifier property(callFrame, subscript->toString(callFrame));
    2873             if (!globalData->exception) { // Don't put to an object if toString threw an exception.
     2893            Identifier property(exec, subscript->toString(exec));
     2894            if (!exec->hadException()) { // Don't put to an object if toString threw an exception.
    28742895                PutPropertySlot slot;
    2875                 baseValue->put(callFrame, property, callFrame[value].jsValue(callFrame), slot);
     2896                baseValue->put(exec, property, r[value].jsValue(exec), slot);
    28762897            }
    28772898        }
     
    28932914        int property = (++vPC)->u.operand;
    28942915
    2895         JSObject* baseObj = callFrame[base].jsValue(callFrame)->toObject(callFrame); // may throw
    2896 
    2897         JSValue* subscript = callFrame[property].jsValue(callFrame);
     2916        JSObject* baseObj = r[base].jsValue(exec)->toObject(exec); // may throw
     2917
     2918        JSValue* subscript = r[property].jsValue(exec);
    28982919        JSValue* result;
    28992920        uint32_t i;
    29002921        if (subscript->getUInt32(i))
    2901             result = jsBoolean(baseObj->deleteProperty(callFrame, i));
     2922            result = jsBoolean(baseObj->deleteProperty(exec, i));
    29022923        else {
    29032924            VM_CHECK_EXCEPTION();
    2904             Identifier property(callFrame, subscript->toString(callFrame));
     2925            Identifier property(exec, subscript->toString(exec));
    29052926            VM_CHECK_EXCEPTION();
    2906             result = jsBoolean(baseObj->deleteProperty(callFrame, property));
     2927            result = jsBoolean(baseObj->deleteProperty(exec, property));
    29072928        }
    29082929
    29092930        VM_CHECK_EXCEPTION();
    2910         callFrame[dst] = result;
     2931        r[dst] = result;
    29112932        ++vPC;
    29122933        NEXT_OPCODE;
     
    29282949        int value = (++vPC)->u.operand;
    29292950
    2930         callFrame[base].jsValue(callFrame)->put(callFrame, property, callFrame[value].jsValue(callFrame));
     2951        r[base].jsValue(exec)->put(exec, property, r[value].jsValue(exec));
    29312952
    29322953        ++vPC;
     
    29752996        int cond = (++vPC)->u.operand;
    29762997        int target = (++vPC)->u.operand;
    2977         if (callFrame[cond].jsValue(callFrame)->toBoolean(callFrame)) {
     2998        if (r[cond].jsValue(exec)->toBoolean(exec)) {
    29782999            vPC += target;
    29793000            CHECK_FOR_TIMEOUT();
     
    29923013        int cond = (++vPC)->u.operand;
    29933014        int target = (++vPC)->u.operand;
    2994         if (callFrame[cond].jsValue(callFrame)->toBoolean(callFrame)) {
     3015        if (r[cond].jsValue(exec)->toBoolean(exec)) {
    29953016            vPC += target;
    29963017            NEXT_OPCODE;
     
    30083029        int cond = (++vPC)->u.operand;
    30093030        int target = (++vPC)->u.operand;
    3010         if (!callFrame[cond].jsValue(callFrame)->toBoolean(callFrame)) {
     3031        if (!r[cond].jsValue(exec)->toBoolean(exec)) {
    30113032            vPC += target;
    30123033            NEXT_OPCODE;
     
    30273048           the JS timeout is reached.
    30283049         */
    3029         JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    3030         JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     3050        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
     3051        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
    30313052        int target = (++vPC)->u.operand;
    30323053       
    3033         bool result = jsLess(callFrame, src1, src2);
     3054        bool result = jsLess(exec, src1, src2);
    30343055        VM_CHECK_EXCEPTION();
    30353056       
     
    30543075           the JS timeout is reached.
    30553076        */
    3056         JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    3057         JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     3077        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
     3078        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
    30583079        int target = (++vPC)->u.operand;
    30593080       
    3060         bool result = jsLessEq(callFrame, src1, src2);
     3081        bool result = jsLessEq(exec, src1, src2);
    30613082        VM_CHECK_EXCEPTION();
    30623083       
     
    30783099           result of the comparison is false.
    30793100        */
    3080         JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    3081         JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     3101        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
     3102        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
    30823103        int target = (++vPC)->u.operand;
    30833104
    3084         bool result = jsLess(callFrame, src1, src2);
     3105        bool result = jsLess(exec, src1, src2);
    30853106        VM_CHECK_EXCEPTION();
    30863107       
     
    31043125        int tableIndex = (++vPC)->u.operand;
    31053126        int defaultOffset = (++vPC)->u.operand;
    3106         JSValue* scrutinee = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     3127        JSValue* scrutinee = r[(++vPC)->u.operand].jsValue(exec);
    31073128        if (!JSImmediate::isNumber(scrutinee))
    31083129            vPC += defaultOffset;
    31093130        else {
    31103131            int32_t value = JSImmediate::getTruncatedInt32(scrutinee);
    3111             vPC += callFrame->codeBlock()->immediateSwitchJumpTables[tableIndex].offsetForValue(value, defaultOffset);
     3132            vPC += codeBlock(r)->immediateSwitchJumpTables[tableIndex].offsetForValue(value, defaultOffset);
    31123133        }
    31133134        NEXT_OPCODE;
     
    31243145        int tableIndex = (++vPC)->u.operand;
    31253146        int defaultOffset = (++vPC)->u.operand;
    3126         JSValue* scrutinee = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     3147        JSValue* scrutinee = r[(++vPC)->u.operand].jsValue(exec);
    31273148        if (!scrutinee->isString())
    31283149            vPC += defaultOffset;
     
    31323153                vPC += defaultOffset;
    31333154            else
    3134                 vPC += callFrame->codeBlock()->characterSwitchJumpTables[tableIndex].offsetForValue(value->data()[0], defaultOffset);
     3155                vPC += codeBlock(r)->characterSwitchJumpTables[tableIndex].offsetForValue(value->data()[0], defaultOffset);
    31353156        }
    31363157        NEXT_OPCODE;
     
    31473168        int tableIndex = (++vPC)->u.operand;
    31483169        int defaultOffset = (++vPC)->u.operand;
    3149         JSValue* scrutinee = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     3170        JSValue* scrutinee = r[(++vPC)->u.operand].jsValue(exec);
    31503171        if (!scrutinee->isString())
    31513172            vPC += defaultOffset;
    31523173        else
    3153             vPC += callFrame->codeBlock()->stringSwitchJumpTables[tableIndex].offsetForValue(static_cast<JSString*>(scrutinee)->value().rep(), defaultOffset);
     3174            vPC += codeBlock(r)->stringSwitchJumpTables[tableIndex].offsetForValue(static_cast<JSString*>(scrutinee)->value().rep(), defaultOffset);
    31543175        NEXT_OPCODE;
    31553176    }
     
    31653186        int func = (++vPC)->u.operand;
    31663187
    3167         callFrame[dst] = callFrame->codeBlock()->functions[func]->makeFunction(callFrame, callFrame->scopeChain());
     3188        r[dst] = codeBlock(r)->functions[func]->makeFunction(exec, scopeChain(r));
    31683189
    31693190        ++vPC;
     
    31813202        int func = (++vPC)->u.operand;
    31823203
    3183         callFrame[dst] = callFrame->codeBlock()->functionExpressions[func]->makeFunction(callFrame, callFrame->scopeChain());
     3204        r[dst] = codeBlock(r)->functionExpressions[func]->makeFunction(exec, scopeChain(r));
    31843205
    31853206        ++vPC;
     
    32053226        ++vPC; // registerOffset
    32063227
    3207         JSValue* funcVal = callFrame[func].jsValue(callFrame);
    3208         JSValue* baseVal = callFrame[thisVal].jsValue(callFrame);
    3209 
    3210         ScopeChainNode* scopeChain = callFrame->scopeChain();
     3228        JSValue* funcVal = r[func].jsValue(exec);
     3229        JSValue* baseVal = r[thisVal].jsValue(exec);
     3230
     3231        ScopeChainNode* scopeChain = this->scopeChain(r);
    32113232        if (baseVal == scopeChain->globalObject() && funcVal == scopeChain->globalObject()->evalFunction()) {
    3212             JSObject* thisObject = static_cast<JSObject*>(callFrame[callFrame->codeBlock()->thisRegister].jsValue(callFrame));
    3213             JSValue* result = callEval(callFrame, thisObject, scopeChain, registerFile, firstArg, argCount, exceptionValue);
     3233            JSObject* thisObject = static_cast<JSObject*>(r[codeBlock(r)->thisRegister].jsValue(exec));
     3234            JSValue* result = callEval(exec, thisObject, scopeChain, registerFile, r, firstArg, argCount, exceptionValue);
    32143235            if (exceptionValue)
    32153236                goto vm_throw;
    32163237
    3217             callFrame[dst] = result;
     3238            r[dst] = result;
    32183239
    32193240            ++vPC;
     
    32253246        // value.
    32263247        vPC -= 6;
    3227         callFrame[thisVal] = baseVal->toThisObject(callFrame);
     3248        r[thisVal] = baseVal->toThisObject(exec);
    32283249
    32293250#if HAVE(COMPUTED_GOTO)
     
    32793300        int registerOffset = (++vPC)->u.operand;
    32803301
    3281         JSValue* v = callFrame[func].jsValue(callFrame);
     3302        JSValue* v = r[func].jsValue(exec);
    32823303
    32833304        CallData callData;
     
    32893310            CodeBlock* newCodeBlock = &functionBodyNode->byteCode(callDataScopeChain);
    32903311
    3291             callFrame[firstArg] = thisVal == missingThisObjectMarker() ? callFrame->globalThisValue() : callFrame[thisVal].jsValue(callFrame);
     3312            r[firstArg] = thisVal == missingThisObjectMarker() ? exec->globalThisValue() : r[thisVal].jsValue(exec);
    32923313           
    3293             CallFrame* previousCallFrame = callFrame;
    3294 
    3295             callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount);
    3296             if (UNLIKELY(!callFrame)) {
    3297                 callFrame = previousCallFrame;
    3298                 exceptionValue = createStackOverflowError(callFrame);
     3314            Register* savedR = r;
     3315
     3316            r = slideRegisterWindowForCall(newCodeBlock, registerFile, r, registerOffset, argCount);
     3317            if (UNLIKELY(!r)) {
     3318                r = savedR;
     3319                exceptionValue = createStackOverflowError(CallFrame::create(r));
    32993320                goto vm_throw;
    33003321            }
    33013322
    3302             callFrame->init(newCodeBlock, vPC + 1, callDataScopeChain, previousCallFrame, dst, argCount, static_cast<JSFunction*>(v));
     3323            initializeCallFrame(r, newCodeBlock, vPC + 1, callDataScopeChain, savedR, dst, argCount, v);
    33033324   
    33043325            if (*enabledProfilerReference)
    3305                 (*enabledProfilerReference)->willExecute(callFrame, static_cast<JSObject*>(v));
     3326                (*enabledProfilerReference)->willExecute(exec, static_cast<JSObject*>(v));
    33063327
    33073328            vPC = newCodeBlock->instructions.begin();
     
    33153336
    33163337        if (callType == CallTypeHost) {
    3317             JSValue* thisValue = thisVal == missingThisObjectMarker() ? callFrame->globalThisValue() : callFrame[thisVal].jsValue(callFrame);
    3318             ArgList args(callFrame->registers() + firstArg + 1, argCount - 1);
    3319 
    3320             ScopeChainNode* scopeChain = callFrame->scopeChain();
    3321             CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset);
    3322             newCallFrame->init(0, vPC + 1, scopeChain, callFrame, dst, argCount, static_cast<JSFunction*>(v));
     3338            JSValue* thisValue = thisVal == missingThisObjectMarker() ? exec->globalThisValue() : r[thisVal].jsValue(exec);
     3339            ArgList args(r + firstArg + 1, argCount - 1);
     3340
     3341            ScopeChainNode* scopeChain = this->scopeChain(r);
     3342            initializeCallFrame(r + registerOffset, 0, vPC + 1, scopeChain, r, dst, argCount, v);
     3343            ExecState* callFrame = CallFrame::create(r + registerOffset);
    33233344
    33243345            if (*enabledProfilerReference)
    3325                 (*enabledProfilerReference)->willExecute(newCallFrame, static_cast<JSFunction*>(v));
     3346                (*enabledProfilerReference)->willExecute(callFrame, static_cast<JSObject*>(v));
    33263347
    33273348            MACHINE_SAMPLING_callingHostFunction();
    33283349
    3329             JSValue* returnValue = callData.native.function(newCallFrame, static_cast<JSFunction*>(v), thisValue, args);
     3350            JSValue* returnValue = callData.native.function(callFrame, static_cast<JSObject*>(v), thisValue, args);
    33303351            VM_CHECK_EXCEPTION();
    33313352
    3332             newCallFrame[dst] = returnValue;
     3353            r[dst] = returnValue;
    33333354
    33343355            if (*enabledProfilerReference)
    3335                 (*enabledProfilerReference)->didExecute(callFrame, static_cast<JSFunction*>(v));
     3356                (*enabledProfilerReference)->didExecute(CallFrame::create(r), static_cast<JSObject*>(v));
    33363357
    33373358            ++vPC;
     
    33413362        ASSERT(callType == CallTypeNone);
    33423363
    3343         exceptionValue = createNotAFunctionError(callFrame, v, vPC, callFrame->codeBlock());
     3364        exceptionValue = createNotAFunctionError(exec, v, vPC, codeBlock(r));
    33443365        goto vm_throw;
    33453366    }
    33463367    BEGIN_OPCODE(op_tear_off_activation) {
    33473368        int src = (++vPC)->u.operand;
    3348         ASSERT(callFrame->codeBlock()->needsFullScopeChain);
    3349         JSActivation* activation = static_cast<JSActivation*>(callFrame[src].getJSValue());
     3369        JSActivation* activation = static_cast<JSActivation*>(r[src].getJSValue());
     3370        ASSERT(codeBlock(r)->needsFullScopeChain);
    33503371        ASSERT(activation->isObject(&JSActivation::info));
    33513372
     3373        Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue());
     3374        ASSERT(!arguments || arguments->isObject(&Arguments::info));
     3375        activation->copyRegisters(arguments);
     3376
    33523377        ++vPC;
    33533378        NEXT_OPCODE;
    33543379    }
    33553380    BEGIN_OPCODE(op_tear_off_arguments) {
    3356         ASSERT(callFrame->codeBlock()->usesArguments && !callFrame->codeBlock()->needsFullScopeChain);
    3357 
    3358         callFrame->optionalCalleeArguments()->copyRegisters();
     3381        Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue());
     3382        ASSERT(codeBlock(r)->usesArguments && !codeBlock(r)->needsFullScopeChain);
     3383        ASSERT(arguments->isObject(&Arguments::info));
     3384
     3385        arguments->copyRegisters();
    33593386
    33603387        ++vPC;
     
    33743401
    33753402        if (*enabledProfilerReference)
    3376             (*enabledProfilerReference)->didExecute(callFrame, callFrame->callee());
    3377 
    3378         if (callFrame->codeBlock()->needsFullScopeChain)
    3379             callFrame->scopeChain()->deref();
    3380 
    3381         JSValue* returnValue = callFrame[result].jsValue(callFrame);
    3382 
    3383         vPC = callFrame->returnPC();
    3384         int dst = callFrame->returnValueRegister();
    3385         callFrame = callFrame->callerFrame();
     3403            (*enabledProfilerReference)->didExecute(exec, static_cast<JSObject*>(r[RegisterFile::Callee].jsValue(exec)));
     3404
     3405        if (codeBlock(r)->needsFullScopeChain)
     3406            scopeChain(r)->deref();
     3407
     3408        JSValue* returnValue = r[result].jsValue(exec);
     3409
     3410        vPC = r[RegisterFile::ReturnPC].vPC();
     3411        int dst = r[RegisterFile::ReturnValueRegister].i();
     3412        r = r[RegisterFile::CallerRegisters].r();
    33863413       
    3387         if (callFrame->hasHostCallFrameFlag())
     3414        if (isHostCallFrame(r))
    33883415            return returnValue;
    33893416
    3390         callFrame[dst] = returnValue;
     3417        r[dst] = returnValue;
    33913418
    33923419        NEXT_OPCODE;
     
    34043431
    34053432        size_t i = 0;
    3406         CodeBlock* codeBlock = callFrame->codeBlock();
     3433        CodeBlock* codeBlock = this->codeBlock(r);
    34073434       
    34083435        for (size_t count = codeBlock->numVars; i < count; ++i)
    3409             callFrame[i] = jsUndefined();
     3436            r[i] = jsUndefined();
    34103437
    34113438        for (size_t count = codeBlock->constantRegisters.size(), j = 0; j < count; ++i, ++j)
    3412             callFrame[i] = codeBlock->constantRegisters[j];
     3439            r[i] = codeBlock->constantRegisters[j];
    34133440
    34143441        ++vPC;
     
    34293456
    34303457        size_t i = 0;
    3431         CodeBlock* codeBlock = callFrame->codeBlock();
     3458        CodeBlock* codeBlock = this->codeBlock(r);
    34323459
    34333460        for (size_t count = codeBlock->numVars; i < count; ++i)
    3434             callFrame[i] = jsUndefined();
     3461            r[i] = jsUndefined();
    34353462
    34363463        for (size_t count = codeBlock->constantRegisters.size(), j = 0; j < count; ++i, ++j)
    3437             callFrame[i] = codeBlock->constantRegisters[j];
     3464            r[i] = codeBlock->constantRegisters[j];
    34383465
    34393466        int dst = (++vPC)->u.operand;
    3440         JSActivation* activation = new (globalData) JSActivation(callFrame, static_cast<FunctionBodyNode*>(codeBlock->ownerNode));
    3441         callFrame[dst] = activation;
    3442         callFrame->setScopeChain(callFrame->scopeChain()->copy()->push(activation));
     3467        JSActivation* activation = new (globalData) JSActivation(exec, static_cast<FunctionBodyNode*>(codeBlock->ownerNode), r);
     3468        r[dst] = activation;
     3469        r[RegisterFile::ScopeChain] = scopeChain(r)->copy()->push(activation);
    34433470
    34443471        ++vPC;
     
    34473474    BEGIN_OPCODE(op_convert_this) {
    34483475        int thisRegister = (++vPC)->u.operand;
    3449         JSValue* thisVal = callFrame[thisRegister].getJSValue();
     3476        JSValue* thisVal = r[thisRegister].getJSValue();
    34503477        if (thisVal->needsThisConversion())
    3451             callFrame[thisRegister] = thisVal->toThisObject(callFrame);
     3478            r[thisRegister] = thisVal->toThisObject(exec);
    34523479
    34533480        ++vPC;
     
    34653492        */
    34663493
    3467         Arguments* arguments = new (globalData) Arguments(callFrame);
    3468         callFrame->setCalleeArguments(arguments);
    3469         callFrame[RegisterFile::ArgumentsRegister] = arguments;
     3494        Arguments* arguments = new (globalData) Arguments(exec, r);
     3495        r[RegisterFile::OptionalCalleeArguments] = arguments;
     3496        r[RegisterFile::ArgumentsRegister] = arguments;
    34703497       
    34713498        ++vPC;
     
    34943521        int registerOffset = (++vPC)->u.operand;
    34953522
    3496         JSValue* v = callFrame[constr].jsValue(callFrame);
     3523        JSValue* v = r[constr].jsValue(exec);
    34973524
    34983525        ConstructData constructData;
     
    35013528        if (constructType == ConstructTypeJS) {
    35023529            if (*enabledProfilerReference)
    3503                 (*enabledProfilerReference)->willExecute(callFrame, static_cast<JSObject*>(v));
     3530                (*enabledProfilerReference)->willExecute(exec, static_cast<JSObject*>(v));
    35043531
    35053532            ScopeChainNode* callDataScopeChain = constructData.js.scopeChain;
     
    35083535
    35093536            StructureID* structure;
    3510             JSValue* prototype = callFrame[constrProto].jsValue(callFrame);
     3537            JSValue* prototype = r[constrProto].jsValue(exec);
    35113538            if (prototype->isObject())
    35123539                structure = static_cast<JSObject*>(prototype)->inheritorID();
     
    35153542            JSObject* newObject = new (globalData) JSObject(structure);
    35163543
    3517             callFrame[firstArg] = newObject; // "this" value
    3518 
    3519             CallFrame* previousCallFrame = callFrame;
    3520 
    3521             callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount);
    3522             if (UNLIKELY(!callFrame)) {
    3523                 callFrame = previousCallFrame;
    3524                 exceptionValue = createStackOverflowError(callFrame);
     3544            r[firstArg] = newObject; // "this" value
     3545
     3546            Register* savedR = r;
     3547
     3548            r = slideRegisterWindowForCall(newCodeBlock, registerFile, r, registerOffset, argCount);
     3549            if (UNLIKELY(!r)) {
     3550                r = savedR;
     3551                exceptionValue = createStackOverflowError(CallFrame::create(r));
    35253552                goto vm_throw;
    35263553            }
    35273554
    3528             callFrame->init(newCodeBlock, vPC + 1, callDataScopeChain, previousCallFrame, dst, argCount, static_cast<JSFunction*>(v));
     3555            initializeCallFrame(r, newCodeBlock, vPC + 1, callDataScopeChain, savedR, dst, argCount, v);
    35293556   
    35303557            if (*enabledProfilerReference)
    3531                 (*enabledProfilerReference)->didExecute(callFrame, static_cast<JSObject*>(v));
     3558                (*enabledProfilerReference)->didExecute(exec, static_cast<JSObject*>(v));
    35323559
    35333560            vPC = newCodeBlock->instructions.begin();
     
    35413568
    35423569        if (constructType == ConstructTypeHost) {
    3543             ArgList args(callFrame->registers() + firstArg + 1, argCount - 1);
    3544 
    3545             ScopeChainNode* scopeChain = callFrame->scopeChain();
    3546             CallFrame::create(callFrame->registers() + registerOffset)->init(0, vPC + 1, scopeChain, callFrame, dst, argCount, static_cast<JSFunction*>(v));
    3547             callFrame = CallFrame::create(callFrame->registers() + registerOffset);
     3570            ArgList args(r + firstArg + 1, argCount - 1);
     3571
     3572            ScopeChainNode* scopeChain = this->scopeChain(r);
     3573            initializeCallFrame(r + registerOffset, 0, vPC + 1, scopeChain, r, dst, argCount, v);
     3574            r += registerOffset;
    35483575
    35493576            if (*enabledProfilerReference)
    3550                 (*enabledProfilerReference)->willExecute(callFrame, static_cast<JSObject*>(v));
     3577                (*enabledProfilerReference)->willExecute(exec, static_cast<JSObject*>(v));
    35513578
    35523579            MACHINE_SAMPLING_callingHostFunction();
    35533580
    3554             JSValue* returnValue = constructData.native.function(callFrame, static_cast<JSObject*>(v), args);
    3555             callFrame = CallFrame::create(callFrame->registers() - registerOffset);
     3581            JSValue* returnValue = constructData.native.function(exec, static_cast<JSObject*>(v), args);
     3582            r -= registerOffset;
    35563583
    35573584            VM_CHECK_EXCEPTION();
    3558             callFrame[dst] = returnValue;
     3585            r[dst] = returnValue;
    35593586
    35603587            if (*enabledProfilerReference)
    3561                 (*enabledProfilerReference)->didExecute(callFrame, static_cast<JSObject*>(v));
     3588                (*enabledProfilerReference)->didExecute(exec, static_cast<JSObject*>(v));
    35623589
    35633590            ++vPC;
     
    35673594        ASSERT(constructType == ConstructTypeNone);
    35683595
    3569         exceptionValue = createNotAConstructorError(callFrame, v, vPC, callFrame->codeBlock());
     3596        exceptionValue = createNotAConstructorError(exec, v, vPC, codeBlock(r));
    35703597        goto vm_throw;
    35713598    }
     
    35783605
    35793606        int dst = vPC[1].u.operand;;
    3580         if (LIKELY(callFrame[dst].jsValue(callFrame)->isObject())) {
     3607        if (LIKELY(r[dst].jsValue(exec)->isObject())) {
    35813608            vPC += 3;
    35823609            NEXT_OPCODE;
     
    35843611
    35853612        int override = vPC[2].u.operand;
    3586         callFrame[dst] = callFrame[override];
     3613        r[dst] = r[override];
    35873614
    35883615        vPC += 3;
     
    35963623        */
    35973624        int scope = (++vPC)->u.operand;
    3598         JSValue* v = callFrame[scope].jsValue(callFrame);
    3599         JSObject* o = v->toObject(callFrame);
     3625        JSValue* v = r[scope].jsValue(exec);
     3626        JSObject* o = v->toObject(exec);
    36003627        VM_CHECK_EXCEPTION();
    36013628
    3602         callFrame->setScopeChain(callFrame->scopeChain()->push(o));
     3629        r[RegisterFile::ScopeChain] = scopeChain(r)->push(o);
    36033630
    36043631        ++vPC;
     
    36103637           Removes the top item from the current scope chain.
    36113638        */
    3612         callFrame->setScopeChain(callFrame->scopeChain()->pop());
     3639        r[RegisterFile::ScopeChain] = scopeChain(r)->pop();
    36133640
    36143641        ++vPC;
     
    36263653        int base = (++vPC)->u.operand;
    36273654
    3628         callFrame[dst] = JSPropertyNameIterator::create(callFrame, callFrame[base].jsValue(callFrame));
     3655        r[dst] = JSPropertyNameIterator::create(exec, r[base].jsValue(exec));
    36293656        ++vPC;
    36303657        NEXT_OPCODE;
     
    36433670        int target = (++vPC)->u.operand;
    36443671
    3645         JSPropertyNameIterator* it = callFrame[iter].propertyNameIterator();
    3646         if (JSValue* temp = it->next(callFrame)) {
     3672        JSPropertyNameIterator* it = r[iter].jsPropertyNameIterator();
     3673        if (JSValue* temp = it->next(exec)) {
    36473674            CHECK_FOR_TIMEOUT();
    3648             callFrame[dst] = temp;
     3675            r[dst] = temp;
    36493676            vPC += target;
    36503677            NEXT_OPCODE;
     
    36653692        int target = (++vPC)->u.operand;
    36663693
    3667         ScopeChainNode* tmp = callFrame->scopeChain();
     3694        ScopeChainNode* tmp = scopeChain(r);
    36683695        while (count--)
    36693696            tmp = tmp->pop();
    3670         callFrame->setScopeChain(tmp);
     3697        r[RegisterFile::ScopeChain] = tmp;
    36713698
    36723699        vPC += target;
     
    36843711           in dst for GC.
    36853712         */
    3686         callFrame->setScopeChain(createExceptionScope(callFrame, vPC));
     3713        r[RegisterFile::ScopeChain] = createExceptionScope(exec, vPC, r);
    36873714
    36883715        vPC += 4;
     
    37003727        */
    37013728        ASSERT(exceptionValue);
    3702         ASSERT(!globalData->exception);
     3729        ASSERT(!exec->hadException());
    37033730        int ex = (++vPC)->u.operand;
    3704         callFrame[ex] = exceptionValue;
     3731        r[ex] = exceptionValue;
    37053732        exceptionValue = 0;
    37063733
     
    37203747
    37213748        int ex = (++vPC)->u.operand;
    3722         exceptionValue = callFrame[ex].jsValue(callFrame);
    3723 
    3724         handlerVPC = throwException(callFrame, exceptionValue, vPC, true);
     3749        exceptionValue = r[ex].jsValue(exec);
     3750
     3751        handlerVPC = throwException(exec, exceptionValue, vPC, r, true);
    37253752        if (!handlerVPC) {
    37263753            *exception = exceptionValue;
     
    37473774        int dst = (++vPC)->u.operand;
    37483775        int src = (++vPC)->u.operand;
    3749         callFrame[dst] = callFrame->codeBlock()->unexpectedConstants[src];
     3776        r[dst] = codeBlock(r)->unexpectedConstants[src];
    37503777
    37513778        ++vPC;
     
    37643791        int message = (++vPC)->u.operand;
    37653792
    3766         CodeBlock* codeBlock = callFrame->codeBlock();
    3767         callFrame[dst] = Error::create(callFrame, (ErrorType)type, codeBlock->unexpectedConstants[message]->toString(callFrame), codeBlock->lineNumberForVPC(vPC), codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL());
     3793        CodeBlock* codeBlock = this->codeBlock(r);
     3794        r[dst] = Error::create(exec, (ErrorType)type, codeBlock->unexpectedConstants[message]->toString(exec), codeBlock->lineNumberForVPC(vPC), codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL());
    37683795
    37693796        ++vPC;
     
    37773804        */
    37783805
    3779         if (callFrame->codeBlock()->needsFullScopeChain) {
    3780             ScopeChainNode* scopeChain = callFrame->scopeChain();
     3806        if (codeBlock(r)->needsFullScopeChain) {
     3807            ScopeChainNode* scopeChain = this->scopeChain(r);
    37813808            ASSERT(scopeChain->refCount > 1);
    37823809            scopeChain->deref();
    37833810        }
    37843811        int result = (++vPC)->u.operand;
    3785         return callFrame[result].jsValue(callFrame);
     3812        return r[result].jsValue(exec);
    37863813    }
    37873814    BEGIN_OPCODE(op_put_getter) {
     
    38003827        int function = (++vPC)->u.operand;
    38013828
    3802         ASSERT(callFrame[base].jsValue(callFrame)->isObject());
    3803         JSObject* baseObj = static_cast<JSObject*>(callFrame[base].jsValue(callFrame));
    3804         Identifier& ident = callFrame->codeBlock()->identifiers[property];
    3805         ASSERT(callFrame[function].jsValue(callFrame)->isObject());
    3806         baseObj->defineGetter(callFrame, ident, static_cast<JSObject*>(callFrame[function].jsValue(callFrame)));
     3829        ASSERT(r[base].jsValue(exec)->isObject());
     3830        JSObject* baseObj = static_cast<JSObject*>(r[base].jsValue(exec));
     3831        Identifier& ident = codeBlock(r)->identifiers[property];
     3832        ASSERT(r[function].jsValue(exec)->isObject());
     3833        baseObj->defineGetter(exec, ident, static_cast<JSObject*>(r[function].jsValue(exec)));
    38073834
    38083835        ++vPC;
     
    38243851        int function = (++vPC)->u.operand;
    38253852
    3826         ASSERT(callFrame[base].jsValue(callFrame)->isObject());
    3827         JSObject* baseObj = static_cast<JSObject*>(callFrame[base].jsValue(callFrame));
    3828         Identifier& ident = callFrame->codeBlock()->identifiers[property];
    3829         ASSERT(callFrame[function].jsValue(callFrame)->isObject());
    3830         baseObj->defineSetter(callFrame, ident, static_cast<JSObject*>(callFrame[function].jsValue(callFrame)));
     3853        ASSERT(r[base].jsValue(exec)->isObject());
     3854        JSObject* baseObj = static_cast<JSObject*>(r[base].jsValue(exec));
     3855        Identifier& ident = codeBlock(r)->identifiers[property];
     3856        ASSERT(r[function].jsValue(exec)->isObject());
     3857        baseObj->defineSetter(exec, ident, static_cast<JSObject*>(r[function].jsValue(exec)));
    38313858
    38323859        ++vPC;
     
    38413868        int retAddrDst = (++vPC)->u.operand;
    38423869        int target = (++vPC)->u.operand;
    3843         callFrame[retAddrDst] = vPC + 1;
     3870        r[retAddrDst] = vPC + 1;
    38443871
    38453872        vPC += target;
     
    38543881        */
    38553882        int retAddrSrc = (++vPC)->u.operand;
    3856         vPC = callFrame[retAddrSrc].vPC();
     3883        vPC = r[retAddrSrc].vPC();
    38573884        NEXT_OPCODE;
    38583885    }
     
    38673894        int lastLine = (++vPC)->u.operand;
    38683895
    3869         debug(callFrame, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
     3896        debug(exec, r, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
    38703897
    38713898        ++vPC;
     
    38793906            exceptionValue = createInterruptedExecutionException(globalData);
    38803907        }
    3881         handlerVPC = throwException(callFrame, exceptionValue, vPC, false);
     3908        handlerVPC = throwException(exec, exceptionValue, vPC, r, false);
    38823909        if (!handlerVPC) {
    38833910            *exception = exceptionValue;
     
    38953922    #undef VM_CHECK_EXCEPTION
    38963923    #undef CHECK_FOR_TIMEOUT
    3897 }
    3898 
    3899 JSValue* Machine::retrieveArguments(CallFrame* callFrame, JSFunction* function) const
    3900 {
    3901     CallFrame* functionCallFrame = findFunctionCallFrame(callFrame, function);
    3902     if (!functionCallFrame)
     3924    #undef exec
     3925}
     3926
     3927JSValue* Machine::retrieveArguments(ExecState* exec, JSFunction* function) const
     3928{
     3929    Register* r = this->callFrame(exec, function);
     3930    if (!r)
    39033931        return jsNull();
    39043932
    3905     CodeBlock* codeBlock = functionCallFrame->codeBlock();
     3933    CodeBlock* codeBlock = Machine::codeBlock(r);
    39063934    if (codeBlock->usesArguments) {
    39073935        ASSERT(codeBlock->codeType == FunctionCode);
    39083936        SymbolTable& symbolTable = static_cast<FunctionBodyNode*>(codeBlock->ownerNode)->symbolTable();
    3909         int argumentsIndex = symbolTable.get(functionCallFrame->propertyNames().arguments.ustring().rep()).getIndex();
    3910         return functionCallFrame[argumentsIndex].jsValue(callFrame);
    3911     }
    3912 
    3913     Arguments* arguments = functionCallFrame->optionalCalleeArguments();
     3937        int argumentsIndex = symbolTable.get(exec->propertyNames().arguments.ustring().rep()).getIndex();
     3938        return r[argumentsIndex].jsValue(exec);
     3939    }
     3940
     3941    Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue());
    39143942    if (!arguments) {
    3915         arguments = new (functionCallFrame) Arguments(functionCallFrame);
     3943        arguments = new (exec) Arguments(exec, r);
    39163944        arguments->copyRegisters();
    3917         callFrame->setCalleeArguments(arguments);
    3918     }
     3945        r[RegisterFile::OptionalCalleeArguments] = arguments;
     3946    }
     3947    ASSERT(arguments->isObject(&Arguments::info));
    39193948
    39203949    return arguments;
    39213950}
    39223951
    3923 JSValue* Machine::retrieveCaller(CallFrame* callFrame, InternalFunction* function) const
    3924 {
    3925     CallFrame* functionCallFrame = findFunctionCallFrame(callFrame, function);
    3926     if (!functionCallFrame)
     3952JSValue* Machine::retrieveCaller(ExecState* exec, InternalFunction* function) const
     3953{
     3954    Register* r = this->callFrame(exec, function);
     3955    if (!r)
    39273956        return jsNull();
    39283957
    3929     CallFrame* callerFrame = functionCallFrame->callerFrame();
    3930     if (callerFrame->hasHostCallFrameFlag())
     3958    Register* callerR = r[RegisterFile::CallerRegisters].r();
     3959    if (isHostCallFrame(callerR))
    39313960        return jsNull();
    39323961
    3933     JSValue* caller = callerFrame->callee();
     3962    JSValue* caller = callerR[RegisterFile::Callee].jsValue(exec);
    39343963    if (!caller)
    39353964        return jsNull();
     
    39383967}
    39393968
    3940 void Machine::retrieveLastCaller(CallFrame* callFrame, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const
     3969void Machine::retrieveLastCaller(ExecState* exec, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const
    39413970{
    39423971    function = 0;
     
    39443973    sourceURL = UString();
    39453974
    3946     CallFrame* callerFrame = callFrame->callerFrame();
    3947     if (callerFrame->hasHostCallFrameFlag())
     3975    Register* r = exec->registers();
     3976    Register* callerR = r[RegisterFile::CallerRegisters].r();
     3977    if (isHostCallFrame(callerR))
    39483978        return;
    39493979
    3950     CodeBlock* callerCodeBlock = callerFrame->codeBlock();
     3980    CodeBlock* callerCodeBlock = codeBlock(callerR);
    39513981    if (!callerCodeBlock)
    39523982        return;
    39533983
    3954     Instruction* vPC = vPCForPC(callerCodeBlock, callFrame->returnPC());
     3984    Instruction* vPC = vPCForPC(callerCodeBlock, r[RegisterFile::ReturnPC].v());
    39553985    lineNumber = callerCodeBlock->lineNumberForVPC(vPC - 1);
    39563986    sourceID = callerCodeBlock->ownerNode->sourceID();
    39573987    sourceURL = callerCodeBlock->ownerNode->sourceURL();
    3958     function = callerFrame->callee();
    3959 }
    3960 
    3961 CallFrame* Machine::findFunctionCallFrame(CallFrame* callFrame, InternalFunction* function)
    3962 {
    3963     for (CallFrame* candidate = callFrame; candidate; candidate = candidate->callerFrame()->removeHostCallFrameFlag()) {
    3964         if (candidate->callee() == function)
    3965             return candidate;
    3966     }
     3988
     3989    JSValue* caller = callerR[RegisterFile::Callee].getJSValue();
     3990    if (!caller)
     3991        return;
     3992
     3993    function = caller;
     3994}
     3995
     3996Register* Machine::callFrame(ExecState* exec, InternalFunction* function) const
     3997{
     3998    for (Register* r = exec->registers(); r; r = stripHostCallFrameBit(r[RegisterFile::CallerRegisters].r()))
     3999        if (r[RegisterFile::Callee].getJSValue() == function)
     4000            return r;
    39674001    return 0;
    39684002}
    39694003
    3970 void Machine::getArgumentsData(CallFrame* callFrame, JSFunction*& function, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc)
    3971 {
    3972     function = callFrame->callee();
     4004void Machine::getArgumentsData(Register* callFrame, JSFunction*& function, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc)
     4005{
     4006    function = static_cast<JSFunction*>(callFrame[RegisterFile::Callee].getJSValue());
     4007    ASSERT(function->inherits(&JSFunction::info));
    39734008   
    39744009    CodeBlock* codeBlock = &function->m_body->generatedByteCode();
    39754010    int numParameters = codeBlock->numParameters;
    3976     argc = callFrame->argumentCount();
     4011    argc = callFrame[RegisterFile::ArgumentCount].i();
    39774012
    39784013    if (argc <= numParameters)
    3979         argv = callFrame->registers() - RegisterFile::CallFrameHeaderSize - numParameters + 1; // + 1 to skip "this"
     4014        argv = callFrame - RegisterFile::CallFrameHeaderSize - numParameters + 1; // + 1 to skip "this"
    39804015    else
    3981         argv = callFrame->registers() - RegisterFile::CallFrameHeaderSize - numParameters - argc + 1; // + 1 to skip "this"
     4016        argv = callFrame - RegisterFile::CallFrameHeaderSize - numParameters - argc + 1; // + 1 to skip "this"
    39824017
    39834018    argc -= 1; // - 1 to skip "this"
     
    39924027}
    39934028
    3994 NEVER_INLINE void Machine::tryCTICachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const PutPropertySlot& slot)
     4029NEVER_INLINE void Machine::tryCTICachePutByID(ExecState* exec, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const PutPropertySlot& slot)
    39954030{
    39964031    // The interpreter checks for recursion here; I do not believe this can occur in CTI.
     
    40344069        StructureIDChain* chain = structureID->cachedPrototypeChain();
    40354070        if (!chain) {
    4036             chain = cachePrototypeChain(callFrame, structureID);
     4071            chain = cachePrototypeChain(exec, structureID);
    40374072            if (!chain) {
    40384073                // This happens if someone has manually inserted null into the prototype chain
     
    40444079        vPC[7] = slot.cachedOffset();
    40454080        codeBlock->refStructureIDs(vPC);
    4046         CTI::compilePutByIdTransition(this, callFrame, codeBlock, structureID->previousID(), structureID, slot.cachedOffset(), chain, returnAddress);
     4081        CTI::compilePutByIdTransition(this, exec, codeBlock, structureID->previousID(), structureID, slot.cachedOffset(), chain, returnAddress);
    40474082        return;
    40484083    }
     
    40544089
    40554090#if USE(CTI_REPATCH_PIC)
    4056     UNUSED_PARAM(callFrame);
     4091    UNUSED_PARAM(exec);
    40574092    CTI::patchPutByIdReplace(codeBlock, structureID, slot.cachedOffset(), returnAddress);
    40584093#else
    4059     CTI::compilePutByIdReplace(this, callFrame, codeBlock, structureID, slot.cachedOffset(), returnAddress);
     4094    CTI::compilePutByIdReplace(this, exec, codeBlock, structureID, slot.cachedOffset(), returnAddress);
    40604095#endif
    40614096}
    40624097
    4063 void* Machine::getCTIArrayLengthTrampoline(CallFrame* callFrame, CodeBlock* codeBlock)
     4098void* Machine::getCTIArrayLengthTrampoline(ExecState* exec, CodeBlock* codeBlock)
    40644099{
    40654100    if (!m_ctiArrayLengthTrampoline)
    4066         m_ctiArrayLengthTrampoline = CTI::compileArrayLengthTrampoline(this, callFrame, codeBlock);
     4101        m_ctiArrayLengthTrampoline = CTI::compileArrayLengthTrampoline(this, exec, codeBlock);
    40674102       
    40684103    return m_ctiArrayLengthTrampoline;
    40694104}
    40704105
    4071 void* Machine::getCTIStringLengthTrampoline(CallFrame* callFrame, CodeBlock* codeBlock)
     4106void* Machine::getCTIStringLengthTrampoline(ExecState* exec, CodeBlock* codeBlock)
    40724107{
    40734108    if (!m_ctiStringLengthTrampoline)
    4074         m_ctiStringLengthTrampoline = CTI::compileStringLengthTrampoline(this, callFrame, codeBlock);
     4109        m_ctiStringLengthTrampoline = CTI::compileStringLengthTrampoline(this, exec, codeBlock);
    40754110       
    40764111    return m_ctiStringLengthTrampoline;
    40774112}
    40784113
    4079 NEVER_INLINE void Machine::tryCTICacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot)
     4114NEVER_INLINE void Machine::tryCTICacheGetByID(ExecState* exec, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot)
    40804115{
    40814116    // FIXME: Write a test that proves we need to check for recursion here just
     
    40884123    }
    40894124
    4090     if (isJSArray(baseValue) && propertyName == callFrame->propertyNames().length) {
     4125    if (isJSArray(baseValue) && propertyName == exec->propertyNames().length) {
    40914126#if USE(CTI_REPATCH_PIC)
    4092         CTI::compilePatchGetArrayLength(this, callFrame, codeBlock, returnAddress);
     4127        CTI::compilePatchGetArrayLength(this, exec, codeBlock, returnAddress);
    40934128#else
    4094         ctiRepatchCallByReturnAddress(returnAddress, getCTIArrayLengthTrampoline(callFrame, codeBlock));
     4129        ctiRepatchCallByReturnAddress(returnAddress, getCTIArrayLengthTrampoline(exec, codeBlock));
    40954130#endif
    40964131        return;
    40974132    }
    4098     if (isJSString(baseValue) && propertyName == callFrame->propertyNames().length) {
     4133    if (isJSString(baseValue) && propertyName == exec->propertyNames().length) {
    40994134        // The tradeoff of compiling an repatched inline string length access routine does not seem
    41004135        // to pay off, so we currently only do this for arrays.
    4101         ctiRepatchCallByReturnAddress(returnAddress, getCTIStringLengthTrampoline(callFrame, codeBlock));
     4136        ctiRepatchCallByReturnAddress(returnAddress, getCTIStringLengthTrampoline(exec, codeBlock));
    41024137        return;
    41034138    }
     
    41354170        CTI::patchGetByIdSelf(codeBlock, structureID, slot.cachedOffset(), returnAddress);
    41364171#else
    4137         CTI::compileGetByIdSelf(this, callFrame, codeBlock, structureID, slot.cachedOffset(), returnAddress);
     4172        CTI::compileGetByIdSelf(this, exec, codeBlock, structureID, slot.cachedOffset(), returnAddress);
    41384173#endif
    41394174        return;
    41404175    }
    41414176
    4142     if (slot.slotBase() == structureID->prototypeForLookup(callFrame)) {
     4177    if (slot.slotBase() == structureID->prototypeForLookup(exec)) {
    41434178        ASSERT(slot.slotBase()->isObject());
    41444179
     
    41594194        codeBlock->refStructureIDs(vPC);
    41604195
    4161         CTI::compileGetByIdProto(this, callFrame, codeBlock, structureID, slotBaseObject->structureID(), slot.cachedOffset(), returnAddress);
     4196        CTI::compileGetByIdProto(this, exec, codeBlock, structureID, slotBaseObject->structureID(), slot.cachedOffset(), returnAddress);
    41624197        return;
    41634198    }
     
    41664201    JSObject* o = static_cast<JSObject*>(baseValue);
    41674202    while (slot.slotBase() != o) {
    4168         JSValue* v = o->structureID()->prototypeForLookup(callFrame);
     4203        JSValue* v = o->structureID()->prototypeForLookup(exec);
    41694204
    41704205        // If we didn't find slotBase in baseValue's prototype chain, then baseValue
     
    41914226    StructureIDChain* chain = structureID->cachedPrototypeChain();
    41924227    if (!chain)
    4193         chain = cachePrototypeChain(callFrame, structureID);
     4228        chain = cachePrototypeChain(exec, structureID);
    41944229
    41954230    ASSERT(chain);
     
    42014236    codeBlock->refStructureIDs(vPC);
    42024237
    4203     CTI::compileGetByIdChain(this, callFrame, codeBlock, structureID, chain, count, slot.cachedOffset(), returnAddress);
     4238    CTI::compileGetByIdChain(this, exec, codeBlock, structureID, chain, count, slot.cachedOffset(), returnAddress);
    42044239}
    42054240
     
    42564291{
    42574292    JSValue* v1 = ARG_src1;
    4258     CallFrame* callFrame = ARG_callFrame;
    4259 
    4260     JSObject* result = v1->toThisObject(callFrame);
     4293    ExecState* exec = ARG_exec;
     4294
     4295    JSObject* result = v1->toThisObject(exec);
    42614296    VM_CHECK_EXCEPTION_AT_END();
    42624297    return result;
     
    42654300void Machine::cti_op_end(CTI_ARGS)
    42664301{
    4267     ScopeChainNode* scopeChain = ARG_callFrame->scopeChain();
     4302    Register* r = ARG_r;
     4303    ScopeChainNode* scopeChain = Machine::scopeChain(r);
    42684304    ASSERT(scopeChain->refCount > 1);
    42694305    scopeChain->deref();
     
    42824318        return jsNumber(ARG_globalData, left + right);
    42834319   
    4284     CallFrame* callFrame = ARG_callFrame;
     4320    ExecState* exec = ARG_exec;
    42854321
    42864322    bool leftIsString = v1->isString();
     
    42884324        RefPtr<UString::Rep> value = concatenate(static_cast<JSString*>(v1)->value().rep(), static_cast<JSString*>(v2)->value().rep());
    42894325        if (UNLIKELY(!value)) {
    4290             throwOutOfMemoryError(callFrame);
     4326            throwOutOfMemoryError(exec);
    42914327            VM_THROW_EXCEPTION();
    42924328        }
     
    43014337
    43024338        if (UNLIKELY(!value)) {
    4303             throwOutOfMemoryError(callFrame);
     4339            throwOutOfMemoryError(exec);
    43044340            VM_THROW_EXCEPTION();
    43054341        }
     
    43084344
    43094345    // All other cases are pretty uncommon
    4310     JSValue* result = jsAddSlowCase(callFrame, v1, v2);
     4346    JSValue* result = jsAddSlowCase(exec, v1, v2);
    43114347    VM_CHECK_EXCEPTION_AT_END();
    43124348    return result;
     
    43174353    JSValue* v = ARG_src1;
    43184354
    4319     CallFrame* callFrame = ARG_callFrame;
    4320     JSValue* result = jsNumber(ARG_globalData, v->toNumber(callFrame) + 1);
     4355    ExecState* exec = ARG_exec;
     4356    JSValue* result = jsNumber(ARG_globalData, v->toNumber(exec) + 1);
    43214357    VM_CHECK_EXCEPTION_AT_END();
    43224358    return result;
     
    43254361void Machine::cti_timeout_check(CTI_ARGS)
    43264362{
    4327     if (ARG_globalData->machine->checkTimeout(ARG_callFrame->dynamicGlobalObject())) {
     4363    if (ARG_globalData->machine->checkTimeout(ARG_exec->dynamicGlobalObject())) {
    43284364        ARG_globalData->exception = createInterruptedExecutionException(ARG_globalData);
    43294365        VM_THROW_EXCEPTION_AT_END();
     
    43354371    JSValue* src1 = ARG_src1;
    43364372    JSValue* src2 = ARG_src2;
    4337     CallFrame* callFrame = ARG_callFrame;
    4338 
    4339     bool result = jsLess(callFrame, src1, src2);
     4373    ExecState* exec = ARG_exec;
     4374
     4375    bool result = jsLess(exec, src1, src2);
    43404376    VM_CHECK_EXCEPTION_AT_END();
    43414377    return result;
     
    43464382    JSValue* src1 = ARG_src1;
    43474383    JSValue* src2 = ARG_src2;
    4348     CallFrame* callFrame = ARG_callFrame;
    4349 
    4350     bool result = jsLessEq(callFrame, src1, src2);
     4384    ExecState* exec = ARG_exec;
     4385
     4386    bool result = jsLessEq(exec, src1, src2);
    43514387    VM_CHECK_EXCEPTION_AT_END();
    43524388    return result;
     
    43554391JSValue* Machine::cti_op_new_object(CTI_ARGS)
    43564392{
    4357     return constructEmptyObject(ARG_callFrame);;
     4393    return constructEmptyObject(ARG_exec);;
    43584394}
    43594395
    43604396void Machine::cti_op_put_by_id(CTI_ARGS)
    43614397{
    4362     CallFrame* callFrame = ARG_callFrame;
     4398    ExecState* exec = ARG_exec;
    43634399    Identifier& ident = *ARG_id2;
    43644400
    43654401    PutPropertySlot slot;
    4366     ARG_src1->put(callFrame, ident, ARG_src3, slot);
     4402    ARG_src1->put(exec, ident, ARG_src3, slot);
    43674403
    43684404    ctiRepatchCallByReturnAddress(CTI_RETURN_ADDRESS, (void*)cti_op_put_by_id_second);
     
    43734409void Machine::cti_op_put_by_id_second(CTI_ARGS)
    43744410{
     4411    ExecState* exec = ARG_exec;
     4412    Identifier& ident = *ARG_id2;
     4413
     4414    JSValue* baseValue = ARG_src1;
    43754415    PutPropertySlot slot;
    4376     ARG_src1->put(ARG_callFrame, *ARG_id2, ARG_src3, slot);
    4377     ARG_globalData->machine->tryCTICachePutByID(ARG_callFrame, ARG_callFrame->codeBlock(), CTI_RETURN_ADDRESS, ARG_src1, slot);
     4416    baseValue->put(exec, ident, ARG_src3, slot);
     4417
     4418    Register* r = ARG_r;
     4419    ARG_globalData->machine->tryCTICachePutByID(exec, codeBlock(r), CTI_RETURN_ADDRESS, baseValue, slot);
     4420
    43784421    VM_CHECK_EXCEPTION_AT_END();
    43794422}
     
    43814424void Machine::cti_op_put_by_id_generic(CTI_ARGS)
    43824425{
     4426    ExecState* exec = ARG_exec;
     4427    Identifier& ident = *ARG_id2;
     4428
    43834429    PutPropertySlot slot;
    4384     ARG_src1->put(ARG_callFrame, *ARG_id2, ARG_src3, slot);
     4430    ARG_src1->put(exec, ident, ARG_src3, slot);
     4431
    43854432    VM_CHECK_EXCEPTION_AT_END();
    43864433}
     
    43884435void Machine::cti_op_put_by_id_fail(CTI_ARGS)
    43894436{
    4390     CallFrame* callFrame = ARG_callFrame;
     4437    ExecState* exec = ARG_exec;
    43914438    Identifier& ident = *ARG_id2;
    43924439
    43934440    PutPropertySlot slot;
    4394     ARG_src1->put(callFrame, ident, ARG_src3, slot);
     4441    ARG_src1->put(exec, ident, ARG_src3, slot);
    43954442
    43964443    // should probably uncachePutByID() ... this would mean doing a vPC lookup - might be worth just bleeding this until the end.
     
    44024449JSValue* Machine::cti_op_get_by_id(CTI_ARGS)
    44034450{
    4404     CallFrame* callFrame = ARG_callFrame;
     4451    ExecState* exec = ARG_exec;
    44054452    Identifier& ident = *ARG_id2;
    44064453
    44074454    JSValue* baseValue = ARG_src1;
    44084455    PropertySlot slot(baseValue);
    4409     JSValue* result = baseValue->get(callFrame, ident, slot);
     4456    JSValue* result = baseValue->get(exec, ident, slot);
    44104457
    44114458    ctiRepatchCallByReturnAddress(CTI_RETURN_ADDRESS, (void*)cti_op_get_by_id_second);
     
    44174464JSValue* Machine::cti_op_get_by_id_second(CTI_ARGS)
    44184465{
    4419     CallFrame* callFrame = ARG_callFrame;
     4466    ExecState* exec = ARG_exec;
    44204467    Identifier& ident = *ARG_id2;
    44214468
    44224469    JSValue* baseValue = ARG_src1;
    44234470    PropertySlot slot(baseValue);
    4424     JSValue* result = baseValue->get(callFrame, ident, slot);
    4425 
    4426     ARG_globalData->machine->tryCTICacheGetByID(callFrame, callFrame->codeBlock(), CTI_RETURN_ADDRESS, baseValue, ident, slot);
     4471    JSValue* result = baseValue->get(exec, ident, slot);
     4472
     4473    Register* r = ARG_r;
     4474    ARG_globalData->machine->tryCTICacheGetByID(exec, codeBlock(r), CTI_RETURN_ADDRESS, baseValue, ident, slot);
    44274475
    44284476    VM_CHECK_EXCEPTION_AT_END();
     
    44324480JSValue* Machine::cti_op_get_by_id_generic(CTI_ARGS)
    44334481{
    4434     CallFrame* callFrame = ARG_callFrame;
     4482    ExecState* exec = ARG_exec;
    44354483    Identifier& ident = *ARG_id2;
    44364484
    44374485    JSValue* baseValue = ARG_src1;
    44384486    PropertySlot slot(baseValue);
    4439     JSValue* result = baseValue->get(callFrame, ident, slot);
     4487    JSValue* result = baseValue->get(exec, ident, slot);
    44404488
    44414489    VM_CHECK_EXCEPTION_AT_END();
     
    44454493JSValue* Machine::cti_op_get_by_id_fail(CTI_ARGS)
    44464494{
    4447     CallFrame* callFrame = ARG_callFrame;
     4495    ExecState* exec = ARG_exec;
    44484496    Identifier& ident = *ARG_id2;
    44494497
    44504498    JSValue* baseValue = ARG_src1;
    44514499    PropertySlot slot(baseValue);
    4452     JSValue* result = baseValue->get(callFrame, ident, slot);
     4500    JSValue* result = baseValue->get(exec, ident, slot);
    44534501
    44544502    // should probably uncacheGetByID() ... this would mean doing a vPC lookup - might be worth just bleeding this until the end.
     
    44614509JSValue* Machine::cti_op_instanceof(CTI_ARGS)
    44624510{
    4463     CallFrame* callFrame = ARG_callFrame;
     4511    ExecState* exec = ARG_exec;
    44644512    JSValue* value = ARG_src1;
    44654513    JSValue* baseVal = ARG_src2;
     
    44754523
    44764524    if (!baseVal->isObject()) {
    4477         CallFrame* callFrame = ARG_callFrame;
    4478         CodeBlock* codeBlock = callFrame->codeBlock();
     4525        Register* r = ARG_r;
     4526        CodeBlock* codeBlock = Machine::codeBlock(r);
    44794527        ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    44804528        unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
    4481         ARG_globalData->exception = createInvalidParamError(callFrame, "instanceof", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock);
     4529        ARG_globalData->exception = createInvalidParamError(exec, "instanceof", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock);
    44824530        VM_THROW_EXCEPTION();
    44834531    }
     
    44874535
    44884536    if (!proto->isObject()) {
    4489         throwError(callFrame, TypeError, "instanceof called on an object with an invalid prototype property.");
     4537        throwError(exec, TypeError, "instanceof called on an object with an invalid prototype property.");
    44904538        VM_THROW_EXCEPTION();
    44914539    }
     
    44944542        return jsBoolean(false);
    44954543
    4496     JSValue* result = jsBoolean(static_cast<JSObject*>(baseCell)->hasInstance(callFrame, valueCell, protoCell));
     4544    JSValue* result = jsBoolean(static_cast<JSObject*>(baseCell)->hasInstance(exec, valueCell, protoCell));
    44974545    VM_CHECK_EXCEPTION_AT_END();
    44984546
     
    45024550JSValue* Machine::cti_op_del_by_id(CTI_ARGS)
    45034551{
    4504     CallFrame* callFrame = ARG_callFrame;
     4552    ExecState* exec = ARG_exec;
    45054553    Identifier& ident = *ARG_id2;
    45064554   
    4507     JSObject* baseObj = ARG_src1->toObject(callFrame);
    4508 
    4509     JSValue* result = jsBoolean(baseObj->deleteProperty(callFrame, ident));
     4555    JSObject* baseObj = ARG_src1->toObject(exec);
     4556
     4557    JSValue* result = jsBoolean(baseObj->deleteProperty(exec, ident));
    45104558    VM_CHECK_EXCEPTION_AT_END();
    45114559    return result;
     
    45224570        return jsNumber(ARG_globalData, left * right);
    45234571
    4524     CallFrame* callFrame = ARG_callFrame;
    4525     JSValue* result = jsNumber(ARG_globalData, src1->toNumber(callFrame) * src2->toNumber(callFrame));
     4572    ExecState* exec = ARG_exec;
     4573    JSValue* result = jsNumber(ARG_globalData, src1->toNumber(exec) * src2->toNumber(exec));
    45264574    VM_CHECK_EXCEPTION_AT_END();
    45274575    return result;
     
    45304578JSValue* Machine::cti_op_new_func(CTI_ARGS)
    45314579{
    4532     return ARG_func1->makeFunction(ARG_callFrame, ARG_callFrame->scopeChain());
     4580    return ARG_func1->makeFunction(ARG_exec, Machine::scopeChain(ARG_r));
    45334581}
    45344582
     
    45414589
    45424590    if (UNLIKELY(*ARG_profilerReference != 0))
    4543         (*ARG_profilerReference)->willExecute(ARG_callFrame, static_cast<JSFunction*>(ARG_src1));
     4591        (*ARG_profilerReference)->willExecute(CallFrame::create(ARG_r), static_cast<JSObject*>(ARG_src1));
    45444592
    45454593    ScopeChainNode* callDataScopeChain = static_cast<JSFunction*>(ARG_src1)->m_scopeChain.node();
    45464594    CodeBlock* newCodeBlock = &static_cast<JSFunction*>(ARG_src1)->m_body->byteCode(callDataScopeChain);
    45474595
    4548     CallFrame* callFrame = slideRegisterWindowForCall(newCodeBlock, ARG_registerFile, ARG_callFrame, ARG_int2, ARG_int3);
    4549     if (UNLIKELY(!callFrame)) {
    4550         ARG_globalData->exception = createStackOverflowError(ARG_callFrame);
     4596    Register* r = slideRegisterWindowForCall(newCodeBlock, ARG_registerFile, ARG_r, ARG_int2, ARG_int3);
     4597    if (UNLIKELY(!r)) {
     4598        ARG_globalData->exception = createStackOverflowError(CallFrame::create(ARG_r));
    45514599        VM_THROW_EXCEPTION_2();
    45524600    }
    45534601
    4554     VoidPtrPair pair = { newCodeBlock, callFrame };
     4602    VoidPtrPair pair = { newCodeBlock, r };
    45554603    return pair;
    45564604}
     
    45584606void* Machine::cti_vm_compile(CTI_ARGS)
    45594607{
    4560     CodeBlock* codeBlock = ARG_callFrame->codeBlock();
     4608    Register* r = ARG_r;
     4609    CodeBlock* codeBlock = Machine::codeBlock(r);
     4610
    45614611    if (!codeBlock->ctiCode)
    4562         CTI::compile(ARG_globalData->machine, ARG_callFrame, codeBlock);
     4612        CTI::compile(ARG_globalData->machine, CallFrame::create(r), codeBlock);
     4613
    45634614    return codeBlock->ctiCode;
    45644615}
     
    45664617JSValue* Machine::cti_op_push_activation(CTI_ARGS)
    45674618{
    4568     JSActivation* activation = new (ARG_globalData) JSActivation(ARG_callFrame, static_cast<FunctionBodyNode*>(ARG_callFrame->codeBlock()->ownerNode));
    4569     ARG_callFrame->setScopeChain(ARG_callFrame->scopeChain()->copy()->push(activation));
     4619    ExecState* exec = ARG_exec;
     4620    Register* r = ARG_r;
     4621    CodeBlock* codeBlock = Machine::codeBlock(r);
     4622    ScopeChainNode* scopeChain = Machine::scopeChain(r);
     4623
     4624    JSActivation* activation = new (ARG_globalData) JSActivation(exec, static_cast<FunctionBodyNode*>(codeBlock->ownerNode), r);
     4625    r[RegisterFile::ScopeChain] = scopeChain->copy()->push(activation);
    45704626    return activation;
    45714627}
     
    45834639        int registerOffset = ARG_int2;
    45844640        int argCount = ARG_int3;
    4585         CallFrame* previousCallFrame = ARG_callFrame;
    4586         CallFrame* callFrame = CallFrame::create(previousCallFrame->registers() + registerOffset);
    4587 
    4588         callFrame->init(0, ARG_instr4 + 1, previousCallFrame->scopeChain(), previousCallFrame, 0, argCount, static_cast<JSFunction*>(funcVal));
    4589         ARG_setCallFrame(callFrame);
     4641        Register* savedR = ARG_r;
     4642        Register* r = savedR + registerOffset;
     4643
     4644        initializeCallFrame(r, 0, ARG_instr4 + 1, scopeChain(savedR), savedR, 0, argCount, funcVal);
     4645        ARG_setR(r);
    45904646
    45914647        if (*ARG_profilerReference)
    4592             (*ARG_profilerReference)->willExecute(callFrame, static_cast<JSFunction*>(funcVal));
    4593 
    4594         Register* argv = ARG_callFrame->registers() - RegisterFile::CallFrameHeaderSize - argCount;
     4648            (*ARG_profilerReference)->willExecute(CallFrame::create(r), static_cast<JSObject*>(funcVal));
     4649
     4650        Register* argv = r - RegisterFile::CallFrameHeaderSize - argCount;
    45954651        ArgList argList(argv + 1, argCount - 1);
    45964652
    45974653        CTI_MACHINE_SAMPLING_callingHostFunction();
    45984654
    4599         JSValue* returnValue = callData.native.function(callFrame, static_cast<JSFunction*>(funcVal), argv[0].jsValue(callFrame), argList);
    4600         ARG_setCallFrame(previousCallFrame);
     4655        JSValue* returnValue = callData.native.function(CallFrame::create(r), static_cast<JSObject*>(funcVal), argv[0].jsValue(CallFrame::create(r)), argList);
     4656        ARG_setR(savedR);
    46014657        VM_CHECK_EXCEPTION();
    46024658
    46034659        if (*ARG_profilerReference)
    4604             (*ARG_profilerReference)->didExecute(previousCallFrame, static_cast<JSFunction*>(funcVal));
     4660            (*ARG_profilerReference)->didExecute(CallFrame::create(savedR), static_cast<JSObject*>(funcVal));
    46054661
    46064662        return returnValue;
     
    46094665    ASSERT(callType == CallTypeNone);
    46104666
    4611     ARG_globalData->exception = createNotAFunctionError(ARG_callFrame, funcVal, ARG_instr4, ARG_callFrame->codeBlock());
     4667    ARG_globalData->exception = createNotAFunctionError(CallFrame::create(ARG_r), funcVal, ARG_instr4, codeBlock(ARG_r));
    46124668    VM_THROW_EXCEPTION();
    46134669}
     
    46154671void Machine::cti_op_create_arguments(CTI_ARGS)
    46164672{
    4617     Arguments* arguments = new (ARG_globalData) Arguments(ARG_callFrame);
    4618     ARG_callFrame->setCalleeArguments(arguments);
    4619     ARG_callFrame[RegisterFile::ArgumentsRegister] = arguments;
     4673    ExecState* exec = ARG_exec;
     4674    Register* r = ARG_r;
     4675
     4676    Arguments* arguments = new (ARG_globalData) Arguments(exec, r);
     4677    r[RegisterFile::OptionalCalleeArguments] = arguments;
     4678    r[RegisterFile::ArgumentsRegister] = arguments;
    46204679}
    46214680
    46224681void Machine::cti_op_tear_off_activation(CTI_ARGS)
    46234682{
    4624     ASSERT(ARG_callFrame->codeBlock()->needsFullScopeChain);
    4625     ASSERT(ARG_src1->isObject(&JSActivation::info));
    4626     static_cast<JSActivation*>(ARG_src1)->copyRegisters(ARG_callFrame->optionalCalleeArguments());
     4683    Register* r = ARG_r;
     4684
     4685    JSActivation* activation = static_cast<JSActivation*>(ARG_src1);
     4686    ASSERT(codeBlock(r)->needsFullScopeChain);
     4687    ASSERT(activation->isObject(&JSActivation::info));
     4688
     4689    Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue());
     4690    ASSERT(!arguments || arguments->isObject(&Arguments::info));
     4691    activation->copyRegisters(arguments);
    46274692}
    46284693
    46294694void Machine::cti_op_tear_off_arguments(CTI_ARGS)
    46304695{
    4631     ASSERT(ARG_callFrame->codeBlock()->usesArguments && !ARG_callFrame->codeBlock()->needsFullScopeChain);
    4632     ARG_callFrame->optionalCalleeArguments()->copyRegisters();
     4696    Register* r = ARG_r;
     4697
     4698    Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue());
     4699    ASSERT(codeBlock(r)->usesArguments && !codeBlock(r)->needsFullScopeChain);
     4700    ASSERT(arguments->isObject(&Arguments::info));
     4701
     4702    arguments->copyRegisters();
    46334703}
    46344704
    46354705void Machine::cti_op_ret_profiler(CTI_ARGS)
    46364706{
     4707    ExecState* exec = ARG_exec;
     4708
     4709    Register* r = ARG_r;
    46374710    ASSERT(*ARG_profilerReference);
    4638     (*ARG_profilerReference)->didExecute(ARG_callFrame, ARG_callFrame->callee());
     4711    (*ARG_profilerReference)->didExecute(exec, static_cast<JSObject*>(r[RegisterFile::Callee].jsValue(exec)));
    46394712}
    46404713
    46414714void Machine::cti_op_ret_scopeChain(CTI_ARGS)
    46424715{
    4643     ASSERT(ARG_callFrame->codeBlock()->needsFullScopeChain);
    4644     ARG_callFrame->scopeChain()->deref();
     4716    Register* r = ARG_r;
     4717    ASSERT(codeBlock(r)->needsFullScopeChain);
     4718    scopeChain(r)->deref();
    46454719}
    46464720
    46474721JSValue* Machine::cti_op_new_array(CTI_ARGS)
    46484722{
    4649     ArgList argList(ARG_registers1, ARG_int2);
    4650     return constructArray(ARG_callFrame, argList);
     4723    ArgList argsList(ARG_registers1, ARG_int2);
     4724    return constructArray(ARG_exec, argsList);
    46514725}
    46524726
    46534727JSValue* Machine::cti_op_resolve(CTI_ARGS)
    46544728{
    4655     CallFrame* callFrame = ARG_callFrame;
    4656     ScopeChainNode* scopeChain = callFrame->scopeChain();
     4729    ExecState* exec = ARG_exec;
     4730    Register* r = ARG_r;
     4731    ScopeChainNode* scopeChain = Machine::scopeChain(r);
    46574732
    46584733    ScopeChainIterator iter = scopeChain->begin();
     
    46644739        JSObject* o = *iter;
    46654740        PropertySlot slot(o);
    4666         if (o->getPropertySlot(callFrame, ident, slot)) {
    4667             JSValue* result = slot.getValue(callFrame, ident);
     4741        if (o->getPropertySlot(exec, ident, slot)) {
     4742            JSValue* result = slot.getValue(exec, ident);
    46684743            VM_CHECK_EXCEPTION_AT_END();
    46694744            return result;
     
    46714746    } while (++iter != end);
    46724747
    4673     CodeBlock* codeBlock = callFrame->codeBlock();
     4748    CodeBlock* codeBlock = Machine::codeBlock(r);
    46744749    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    46754750    unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
    4676     ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock);
     4751    exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));
    46774752    VM_THROW_EXCEPTION();
    46784753}
     
    46814756{
    46824757    RegisterFile* registerFile = ARG_registerFile;
    4683     CallFrame* callFrame = ARG_callFrame;
     4758    Register* r = ARG_r;
    46844759
    46854760    JSFunction* constructor = static_cast<JSFunction*>(ARG_src1);
     
    46954770
    46964771    if (*ARG_profilerReference)
    4697         (*ARG_profilerReference)->willExecute(callFrame, constructor);
     4772        (*ARG_profilerReference)->willExecute(CallFrame::create(r), constructor);
    46984773
    46994774    ScopeChainNode* callDataScopeChain = constructor->m_scopeChain.node();
     
    47084783    JSObject* newObject = new (ARG_globalData) JSObject(structure);
    47094784
    4710     callFrame[firstArg] = newObject; // "this" value
    4711 
    4712     callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount);
    4713     if (UNLIKELY(!callFrame)) {
    4714         ARG_globalData->exception = createStackOverflowError(ARG_callFrame);
     4785    r[firstArg] = newObject; // "this" value
     4786
     4787    r = slideRegisterWindowForCall(newCodeBlock, registerFile, r, registerOffset, argCount);
     4788    if (UNLIKELY(!r)) {
     4789        ARG_globalData->exception = createStackOverflowError(CallFrame::create(ARG_r));
    47154790        VM_THROW_EXCEPTION_2();
    47164791    }
    47174792
    4718     VoidPtrPair pair = { newCodeBlock, callFrame };
     4793    VoidPtrPair pair = { newCodeBlock, r };
    47194794    return pair;
    47204795}
     
    47224797JSValue* Machine::cti_op_construct_NotJSConstruct(CTI_ARGS)
    47234798{
    4724     CallFrame* callFrame = ARG_callFrame;
     4799    ExecState* exec = ARG_exec;
     4800    Register* r = ARG_r;
    47254801
    47264802    JSValue* constrVal = ARG_src1;
     
    47354811    if (constructType == ConstructTypeHost) {
    47364812        if (*ARG_profilerReference)
    4737             (*ARG_profilerReference)->willExecute(callFrame, constructor);
    4738 
    4739         ArgList argList(callFrame->registers() + firstArg + 1, argCount - 1);
     4813            (*ARG_profilerReference)->willExecute(exec, constructor);
     4814
     4815        ArgList argList(r + firstArg + 1, argCount - 1);
    47404816
    47414817        CTI_MACHINE_SAMPLING_callingHostFunction();
    47424818
    4743         JSValue* returnValue = constructData.native.function(callFrame, constructor, argList);
     4819        JSValue* returnValue = constructData.native.function(exec, constructor, argList);
    47444820        VM_CHECK_EXCEPTION();
    47454821
    47464822        if (*ARG_profilerReference)
    4747             (*ARG_profilerReference)->didExecute(callFrame, constructor);
     4823            (*ARG_profilerReference)->didExecute(exec, constructor);
    47484824
    47494825        return returnValue;
     
    47524828    ASSERT(constructType == ConstructTypeNone);
    47534829
    4754     ARG_globalData->exception = createNotAConstructorError(callFrame, constrVal, ARG_instr6, callFrame->codeBlock());
     4830    exec->setException(createNotAConstructorError(exec, constrVal, ARG_instr6, codeBlock(r)));
    47554831    VM_THROW_EXCEPTION();
    47564832}
     
    47584834JSValue* Machine::cti_op_get_by_val(CTI_ARGS)
    47594835{
    4760     CallFrame* callFrame = ARG_callFrame;
     4836    ExecState* exec = ARG_exec;
    47614837    Machine* machine = ARG_globalData->machine;
    47624838
     
    47744850                result = jsArray->getIndex(i);
    47754851            else
    4776                 result = jsArray->JSArray::get(callFrame, i);
     4852                result = jsArray->JSArray::get(exec, i);
    47774853        } else if (machine->isJSString(baseValue) && static_cast<JSString*>(baseValue)->canGetIndex(i))
    47784854            result = static_cast<JSString*>(baseValue)->getIndex(ARG_globalData, i);
    47794855        else
    4780             result = baseValue->get(callFrame, i);
     4856            result = baseValue->get(exec, i);
    47814857    } else {
    4782         Identifier property(callFrame, subscript->toString(callFrame));
    4783         result = baseValue->get(callFrame, property);
     4858        Identifier property(exec, subscript->toString(exec));
     4859        result = baseValue->get(exec, property);
    47844860    }
    47854861
     
    47904866VoidPtrPair Machine::cti_op_resolve_func(CTI_ARGS)
    47914867{
    4792     CallFrame* callFrame = ARG_callFrame;
    4793     ScopeChainNode* scopeChain = callFrame->scopeChain();
     4868    ExecState* exec = ARG_exec;
     4869    Register* r = ARG_r;
     4870    ScopeChainNode* scopeChain = Machine::scopeChain(r);
    47944871
    47954872    ScopeChainIterator iter = scopeChain->begin();
     
    48054882        base = *iter;
    48064883        PropertySlot slot(base);
    4807         if (base->getPropertySlot(callFrame, ident, slot)) {           
     4884        if (base->getPropertySlot(exec, ident, slot)) {           
    48084885            // ECMA 11.2.3 says that if we hit an activation the this value should be null.
    48094886            // However, section 10.2.3 says that in the case where the value provided
     
    48134890            // that in host objects you always get a valid object for this.
    48144891            // We also handle wrapper substitution for the global object at the same time.
    4815             JSObject* thisObj = base->toThisObject(callFrame);
    4816             JSValue* result = slot.getValue(callFrame, ident);
     4892            JSObject* thisObj = base->toThisObject(exec);
     4893            JSValue* result = slot.getValue(exec, ident);
    48174894            VM_CHECK_EXCEPTION_AT_END();
    48184895
     
    48234900    } while (iter != end);
    48244901
    4825     CodeBlock* codeBlock = callFrame->codeBlock();
     4902    CodeBlock* codeBlock = Machine::codeBlock(r);
    48264903    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    48274904    unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
    4828     ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock);
     4905    exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));
    48294906    VM_THROW_EXCEPTION_2();
    48304907}
     
    48404917        return jsNumber(ARG_globalData, left - right);
    48414918
    4842     CallFrame* callFrame = ARG_callFrame;
    4843     JSValue* result = jsNumber(ARG_globalData, src1->toNumber(callFrame) - src2->toNumber(callFrame));
     4919    ExecState* exec = ARG_exec;
     4920    JSValue* result = jsNumber(ARG_globalData, src1->toNumber(exec) - src2->toNumber(exec));
    48444921    VM_CHECK_EXCEPTION_AT_END();
    48454922    return result;
     
    48484925void Machine::cti_op_put_by_val(CTI_ARGS)
    48494926{
    4850     CallFrame* callFrame = ARG_callFrame;
     4927    ExecState* exec = ARG_exec;
    48514928    Machine* machine = ARG_globalData->machine;
    48524929
     
    48644941                jsArray->setIndex(i, value);
    48654942            else
    4866                 jsArray->JSArray::put(callFrame, i, value);
     4943                jsArray->JSArray::put(exec, i, value);
    48674944        } else
    4868             baseValue->put(callFrame, i, value);
     4945            baseValue->put(exec, i, value);
    48694946    } else {
    4870         Identifier property(callFrame, subscript->toString(callFrame));
     4947        Identifier property(exec, subscript->toString(exec));
    48714948        if (!ARG_globalData->exception) { // Don't put to an object if toString threw an exception.
    48724949            PutPropertySlot slot;
    4873             baseValue->put(callFrame, property, value, slot);
     4950            baseValue->put(exec, property, value, slot);
    48744951        }
    48754952    }
     
    48804957void Machine::cti_op_put_by_val_array(CTI_ARGS)
    48814958{
    4882     CallFrame* callFrame = ARG_callFrame;
     4959    ExecState* exec = ARG_exec;
    48834960
    48844961    JSValue* baseValue = ARG_src1;
     
    48894966
    48904967    if (LIKELY(i >= 0))
    4891         static_cast<JSArray*>(baseValue)->JSArray::put(callFrame, i, value);
     4968        static_cast<JSArray*>(baseValue)->JSArray::put(exec, i, value);
    48924969    else {
    4893         Identifier property(callFrame, JSImmediate::from(i)->toString(callFrame));
     4970        Identifier property(exec, JSImmediate::from(i)->toString(exec));
    48944971        // FIXME: can toString throw an exception here?
    48954972        if (!ARG_globalData->exception) { // Don't put to an object if toString threw an exception.
    48964973            PutPropertySlot slot;
    4897             baseValue->put(callFrame, property, value, slot);
     4974            baseValue->put(exec, property, value, slot);
    48984975        }
    48994976    }
     
    49044981JSValue* Machine::cti_op_lesseq(CTI_ARGS)
    49054982{
    4906     CallFrame* callFrame = ARG_callFrame;
    4907     JSValue* result = jsBoolean(jsLessEq(callFrame, ARG_src1, ARG_src2));
     4983    ExecState* exec = ARG_exec;
     4984    JSValue* result = jsBoolean(jsLessEq(exec, ARG_src1, ARG_src2));
    49084985    VM_CHECK_EXCEPTION_AT_END();
    49094986    return result;
     
    49144991    JSValue* src1 = ARG_src1;
    49154992
    4916     CallFrame* callFrame = ARG_callFrame;
    4917 
    4918     bool result = src1->toBoolean(callFrame);
     4993    ExecState* exec = ARG_exec;
     4994
     4995    bool result = src1->toBoolean(exec);
    49194996    VM_CHECK_EXCEPTION_AT_END();
    49204997    return result;
     
    49295006        return jsNumber(ARG_globalData, -v);
    49305007
    4931     CallFrame* callFrame = ARG_callFrame;
    4932     JSValue* result = jsNumber(ARG_globalData, -src->toNumber(callFrame));
     5008    ExecState* exec = ARG_exec;
     5009    JSValue* result = jsNumber(ARG_globalData, -src->toNumber(exec));
    49335010    VM_CHECK_EXCEPTION_AT_END();
    49345011    return result;
     
    49375014JSValue* Machine::cti_op_resolve_base(CTI_ARGS)
    49385015{
    4939     return inlineResolveBase(ARG_callFrame, *ARG_id1, ARG_callFrame->scopeChain());
     5016    return inlineResolveBase(ARG_exec, *ARG_id1, scopeChain(ARG_r));
    49405017}
    49415018
    49425019JSValue* Machine::cti_op_resolve_skip(CTI_ARGS)
    49435020{
    4944     CallFrame* callFrame = ARG_callFrame;
    4945     ScopeChainNode* scopeChain = callFrame->scopeChain();
     5021    ExecState* exec = ARG_exec;
     5022    Register* r = ARG_r;
     5023    ScopeChainNode* scopeChain = Machine::scopeChain(r);
    49465024
    49475025    int skip = ARG_int2;
     
    49585036        JSObject* o = *iter;
    49595037        PropertySlot slot(o);
    4960         if (o->getPropertySlot(callFrame, ident, slot)) {
    4961             JSValue* result = slot.getValue(callFrame, ident);
     5038        if (o->getPropertySlot(exec, ident, slot)) {
     5039            JSValue* result = slot.getValue(exec, ident);
    49625040            VM_CHECK_EXCEPTION_AT_END();
    49635041            return result;
     
    49655043    } while (++iter != end);
    49665044
    4967     CodeBlock* codeBlock = callFrame->codeBlock();
     5045    CodeBlock* codeBlock = Machine::codeBlock(r);
    49685046    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    49695047    unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
    4970     ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock);
     5048    exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));
    49715049    VM_THROW_EXCEPTION();
    49725050}
     
    49745052JSValue* Machine::cti_op_resolve_global(CTI_ARGS)
    49755053{
    4976     CallFrame* callFrame = ARG_callFrame;
     5054    ExecState* exec = ARG_exec;
    49775055    JSGlobalObject* globalObject = static_cast<JSGlobalObject*>(ARG_src1);
    49785056    Identifier& ident = *ARG_id2;
     
    49815059
    49825060    PropertySlot slot(globalObject);
    4983     if (globalObject->getPropertySlot(callFrame, ident, slot)) {
    4984         JSValue* result = slot.getValue(callFrame, ident);
     5061    if (globalObject->getPropertySlot(exec, ident, slot)) {
     5062        JSValue* result = slot.getValue(exec, ident);
    49855063        if (slot.isCacheable()) {
    49865064            if (vPC[4].u.structureID)
     
    49965074    }
    49975075   
    4998     ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, vPC, callFrame->codeBlock());
     5076    Register* r = ARG_r;
     5077    exec->setException(createUndefinedVariableError(exec, ident, vPC, codeBlock(r)));   
    49995078    VM_THROW_EXCEPTION();
    50005079}
     
    50105089        return jsNumber(ARG_globalData, left / right);
    50115090
    5012     CallFrame* callFrame = ARG_callFrame;
    5013     JSValue* result = jsNumber(ARG_globalData, src1->toNumber(callFrame) / src2->toNumber(callFrame));
     5091    ExecState* exec = ARG_exec;
     5092    JSValue* result = jsNumber(ARG_globalData, src1->toNumber(exec) / src2->toNumber(exec));
    50145093    VM_CHECK_EXCEPTION_AT_END();
    50155094    return result;
     
    50205099    JSValue* v = ARG_src1;
    50215100
    5022     CallFrame* callFrame = ARG_callFrame;
    5023     JSValue* result = jsNumber(ARG_globalData, v->toNumber(callFrame) - 1);
     5101    ExecState* exec = ARG_exec;
     5102    JSValue* result = jsNumber(ARG_globalData, v->toNumber(exec) - 1);
    50245103    VM_CHECK_EXCEPTION_AT_END();
    50255104    return result;
     
    50305109    JSValue* src1 = ARG_src1;
    50315110    JSValue* src2 = ARG_src2;
    5032     CallFrame* callFrame = ARG_callFrame;
    5033 
    5034     bool result = jsLess(callFrame, src1, src2);
     5111    ExecState* exec = ARG_exec;
     5112
     5113    bool result = jsLess(exec, src1, src2);
    50355114    VM_CHECK_EXCEPTION_AT_END();
    50365115    return result;
     
    50415120    JSValue* src = ARG_src1;
    50425121
    5043     CallFrame* callFrame = ARG_callFrame;
    5044 
    5045     JSValue* result = jsBoolean(!src->toBoolean(callFrame));
     5122    ExecState* exec = ARG_exec;
     5123
     5124    JSValue* result = jsBoolean(!src->toBoolean(exec));
    50465125    VM_CHECK_EXCEPTION_AT_END();
    50475126    return result;
     
    50525131    JSValue* src1 = ARG_src1;
    50535132
    5054     CallFrame* callFrame = ARG_callFrame;
    5055 
    5056     bool result = src1->toBoolean(callFrame);
     5133    ExecState* exec = ARG_exec;
     5134
     5135    bool result = src1->toBoolean(exec);
    50575136    VM_CHECK_EXCEPTION_AT_END();
    50585137    return result;
     
    50635142    JSValue* v = ARG_src1;
    50645143
    5065     CallFrame* callFrame = ARG_callFrame;
    5066 
    5067     JSValue* number = v->toJSNumber(callFrame);
     5144    ExecState* exec = ARG_exec;
     5145
     5146    JSValue* number = v->toJSNumber(exec);
    50685147    VM_CHECK_EXCEPTION_2();
    50695148
     
    50775156    JSValue* src2 = ARG_src2;
    50785157
    5079     CallFrame* callFrame = ARG_callFrame;
     5158    ExecState* exec = ARG_exec;
    50805159
    50815160    ASSERT(!JSImmediate::areBothImmediateNumbers(src1, src2));
    5082     JSValue* result = jsBoolean(equalSlowCaseInline(callFrame, src1, src2));
     5161    JSValue* result = jsBoolean(equalSlowCaseInline(exec, src1, src2));
    50835162    VM_CHECK_EXCEPTION_AT_END();
    50845163    return result;
     
    50975176        return jsNumber(ARG_globalData, left << (right & 0x1f));
    50985177
    5099     CallFrame* callFrame = ARG_callFrame;
    5100     JSValue* result = jsNumber(ARG_globalData, (val->toInt32(callFrame)) << (shift->toUInt32(callFrame) & 0x1f));
     5178    ExecState* exec = ARG_exec;
     5179    JSValue* result = jsNumber(ARG_globalData, (val->toInt32(exec)) << (shift->toUInt32(exec) & 0x1f));
    51015180    VM_CHECK_EXCEPTION_AT_END();
    51025181    return result;
     
    51135192        return jsNumber(ARG_globalData, left & right);
    51145193
    5115     CallFrame* callFrame = ARG_callFrame;
    5116     JSValue* result = jsNumber(ARG_globalData, src1->toInt32(callFrame) & src2->toInt32(callFrame));
     5194    ExecState* exec = ARG_exec;
     5195    JSValue* result = jsNumber(ARG_globalData, src1->toInt32(exec) & src2->toInt32(exec));
    51175196    VM_CHECK_EXCEPTION_AT_END();
    51185197    return result;
     
    51315210        return jsNumber(ARG_globalData, left >> (right & 0x1f));
    51325211
    5133     CallFrame* callFrame = ARG_callFrame;
    5134     JSValue* result = jsNumber(ARG_globalData, (val->toInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
     5212    ExecState* exec = ARG_exec;
     5213    JSValue* result = jsNumber(ARG_globalData, (val->toInt32(exec)) >> (shift->toUInt32(exec) & 0x1f));
    51355214    VM_CHECK_EXCEPTION_AT_END();
    51365215    return result;
     
    51455224        return jsNumber(ARG_globalData, ~value);
    51465225           
    5147     CallFrame* callFrame = ARG_callFrame;
    5148     JSValue* result = jsNumber(ARG_globalData, ~src->toInt32(callFrame));
     5226    ExecState* exec = ARG_exec;
     5227    JSValue* result = jsNumber(ARG_globalData, ~src->toInt32(exec));
    51495228    VM_CHECK_EXCEPTION_AT_END();
    51505229    return result;
     
    51535232VoidPtrPair Machine::cti_op_resolve_with_base(CTI_ARGS)
    51545233{
    5155     CallFrame* callFrame = ARG_callFrame;
    5156     ScopeChainNode* scopeChain = callFrame->scopeChain();
     5234    ExecState* exec = ARG_exec;
     5235    Register* r = ARG_r;
     5236    ScopeChainNode* scopeChain = Machine::scopeChain(r);
    51575237
    51585238    ScopeChainIterator iter = scopeChain->begin();
     
    51685248        base = *iter;
    51695249        PropertySlot slot(base);
    5170         if (base->getPropertySlot(callFrame, ident, slot)) {
    5171             JSValue* result = slot.getValue(callFrame, ident);
     5250        if (base->getPropertySlot(exec, ident, slot)) {
     5251            JSValue* result = slot.getValue(exec, ident);
    51725252            VM_CHECK_EXCEPTION_AT_END();
    51735253
     
    51785258    } while (iter != end);
    51795259
    5180     CodeBlock* codeBlock = callFrame->codeBlock();
     5260    CodeBlock* codeBlock = Machine::codeBlock(r);
    51815261    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    51825262    unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
    5183     ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock);
     5263    exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));
    51845264    VM_THROW_EXCEPTION_2();
    51855265}
     
    51875267JSValue* Machine::cti_op_new_func_exp(CTI_ARGS)
    51885268{
    5189     return ARG_funcexp1->makeFunction(ARG_callFrame, ARG_callFrame->scopeChain());
     5269    return ARG_funcexp1->makeFunction(ARG_exec, scopeChain(ARG_r));
    51905270}
    51915271
     
    51955275    JSValue* divisorValue = ARG_src2;
    51965276
    5197     CallFrame* callFrame = ARG_callFrame;
    5198     double d = dividendValue->toNumber(callFrame);
    5199     JSValue* result = jsNumber(ARG_globalData, fmod(d, divisorValue->toNumber(callFrame)));
     5277    ExecState* exec = ARG_exec;
     5278    double d = dividendValue->toNumber(exec);
     5279    JSValue* result = jsNumber(ARG_globalData, fmod(d, divisorValue->toNumber(exec)));
    52005280    VM_CHECK_EXCEPTION_AT_END();
    52015281    return result;
     
    52045284JSValue* Machine::cti_op_less(CTI_ARGS)
    52055285{
    5206     CallFrame* callFrame = ARG_callFrame;
    5207     JSValue* result = jsBoolean(jsLess(callFrame, ARG_src1, ARG_src2));
     5286    ExecState* exec = ARG_exec;
     5287    JSValue* result = jsBoolean(jsLess(exec, ARG_src1, ARG_src2));
    52085288    VM_CHECK_EXCEPTION_AT_END();
    52095289    return result;
     
    52175297    ASSERT(!JSImmediate::areBothImmediateNumbers(src1, src2));
    52185298
    5219     CallFrame* callFrame = ARG_callFrame;
    5220     JSValue* result = jsBoolean(!equalSlowCaseInline(callFrame, src1, src2));
     5299    ExecState* exec = ARG_exec;
     5300    JSValue* result = jsBoolean(!equalSlowCaseInline(exec, src1, src2));
    52215301    VM_CHECK_EXCEPTION_AT_END();
    52225302    return result;
     
    52275307    JSValue* v = ARG_src1;
    52285308
    5229     CallFrame* callFrame = ARG_callFrame;
    5230 
    5231     JSValue* number = v->toJSNumber(callFrame);
     5309    ExecState* exec = ARG_exec;
     5310
     5311    JSValue* number = v->toJSNumber(exec);
    52325312    VM_CHECK_EXCEPTION_2();
    52335313
     
    52415321    JSValue* shift = ARG_src2;
    52425322
    5243     CallFrame* callFrame = ARG_callFrame;
     5323    ExecState* exec = ARG_exec;
    52445324
    52455325    if (JSImmediate::areBothImmediateNumbers(val, shift) && !JSImmediate::isNegative(val))
    52465326        return JSImmediate::rightShiftImmediateNumbers(val, shift);
    52475327    else {
    5248         JSValue* result = jsNumber(ARG_globalData, (val->toUInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
     5328        JSValue* result = jsNumber(ARG_globalData, (val->toUInt32(exec)) >> (shift->toUInt32(exec) & 0x1f));
    52495329        VM_CHECK_EXCEPTION_AT_END();
    52505330        return result;
     
    52575337    JSValue* src2 = ARG_src2;
    52585338
    5259     CallFrame* callFrame = ARG_callFrame;
    5260 
    5261     JSValue* result = jsNumber(ARG_globalData, src1->toInt32(callFrame) ^ src2->toInt32(callFrame));
     5339    ExecState* exec = ARG_exec;
     5340
     5341    JSValue* result = jsNumber(ARG_globalData, src1->toInt32(exec) ^ src2->toInt32(exec));
    52625342    VM_CHECK_EXCEPTION_AT_END();
    52635343    return result;
     
    52665346JSValue* Machine::cti_op_new_regexp(CTI_ARGS)
    52675347{
    5268     return new (ARG_globalData) RegExpObject(ARG_callFrame->lexicalGlobalObject()->regExpStructure(), ARG_regexp1);
     5348    return new (ARG_globalData) RegExpObject(scopeChain(ARG_r)->globalObject()->regExpStructure(), ARG_regexp1);
    52695349}
    52705350
     
    52745354    JSValue* src2 = ARG_src2;
    52755355
    5276     CallFrame* callFrame = ARG_callFrame;
    5277 
    5278     JSValue* result = jsNumber(ARG_globalData, src1->toInt32(callFrame) | src2->toInt32(callFrame));
     5356    ExecState* exec = ARG_exec;
     5357
     5358    JSValue* result = jsNumber(ARG_globalData, src1->toInt32(exec) | src2->toInt32(exec));
    52795359    VM_CHECK_EXCEPTION_AT_END();
    52805360    return result;
     
    52835363JSValue* Machine::cti_op_call_eval(CTI_ARGS)
    52845364{
    5285     CallFrame* callFrame = ARG_callFrame;
     5365    ExecState* exec = ARG_exec;
    52865366    RegisterFile* registerFile = ARG_registerFile;
    5287     CodeBlock* codeBlock = callFrame->codeBlock();
    5288     ScopeChainNode* scopeChain = callFrame->scopeChain();
     5367    Register* r = ARG_r;
     5368    CodeBlock* codeBlock = Machine::codeBlock(r);
     5369    ScopeChainNode* scopeChain = Machine::scopeChain(r);
    52895370
    52905371    Machine* machine = ARG_globalData->machine;
     
    52965377
    52975378    if (baseVal == scopeChain->globalObject() && funcVal == scopeChain->globalObject()->evalFunction()) {
    5298         JSObject* thisObject = static_cast<JSObject*>(callFrame[codeBlock->thisRegister].jsValue(callFrame));
     5379        JSObject* thisObject = static_cast<JSObject*>(r[codeBlock->thisRegister].jsValue(exec));
    52995380        JSValue* exceptionValue = 0;
    5300         JSValue* result = machine->callEval(callFrame, thisObject, scopeChain, registerFile, registerOffset - RegisterFile::CallFrameHeaderSize - argCount, argCount, exceptionValue);
     5381        JSValue* result = machine->callEval(exec, thisObject, scopeChain, registerFile,  r, registerOffset - RegisterFile::CallFrameHeaderSize - argCount, argCount, exceptionValue);
    53015382        VM_CHECK_EXCEPTION_ARG(exceptionValue);
    53025383        return result;
     
    53085389void* Machine::cti_op_throw(CTI_ARGS)
    53095390{
    5310     CallFrame* callFrame = ARG_callFrame;
    5311     CodeBlock* codeBlock = callFrame->codeBlock();
     5391    ExecState* exec = ARG_exec;
     5392    Register* r = ARG_r;
     5393    CodeBlock* codeBlock = Machine::codeBlock(r);
    53125394
    53135395    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
     
    53175399    ASSERT(exceptionValue);
    53185400
    5319     Instruction* handlerVPC = ARG_globalData->machine->throwException(callFrame, exceptionValue, codeBlock->instructions.begin() + vPCIndex, true);
     5401    Instruction* handlerVPC = ARG_globalData->machine->throwException(exec, exceptionValue, codeBlock->instructions.begin() + vPCIndex, r, true);
    53205402
    53215403    if (!handlerVPC) {
     
    53245406    }
    53255407
    5326     ARG_setCallFrame(callFrame);
    5327     void* catchRoutine = callFrame->codeBlock()->nativeExceptionCodeForHandlerVPC(handlerVPC);
     5408    ARG_setR(r);
     5409    void* catchRoutine = Machine::codeBlock(r)->nativeExceptionCodeForHandlerVPC(handlerVPC);
    53285410    ASSERT(catchRoutine);
    53295411    ctiSetReturnAddress(&CTI_RETURN_ADDRESS, catchRoutine);
     
    53335415JSPropertyNameIterator* Machine::cti_op_get_pnames(CTI_ARGS)
    53345416{
    5335     return JSPropertyNameIterator::create(ARG_callFrame, ARG_src1);
     5417    return JSPropertyNameIterator::create(ARG_exec, ARG_src1);
    53365418}
    53375419
     
    53395421{
    53405422    JSPropertyNameIterator* it = ARG_pni1;
    5341     JSValue* temp = it->next(ARG_callFrame);
     5423    JSValue* temp = it->next(ARG_exec);
    53425424    if (!temp)
    53435425        it->invalidate();
     
    53475429void Machine::cti_op_push_scope(CTI_ARGS)
    53485430{
    5349     JSObject* o = ARG_src1->toObject(ARG_callFrame);
     5431    ExecState* exec = ARG_exec;
     5432    JSValue* v = ARG_src1;
     5433
     5434    JSObject* o = v->toObject(exec);
    53505435    VM_CHECK_EXCEPTION_VOID();
    5351     ARG_callFrame->setScopeChain(ARG_callFrame->scopeChain()->push(o));
     5436
     5437    Register* r = ARG_r;
     5438    r[RegisterFile::ScopeChain] = scopeChain(r)->push(o);
    53525439}
    53535440
    53545441void Machine::cti_op_pop_scope(CTI_ARGS)
    53555442{
    5356     CallFrame* callFrame = ARG_callFrame;
    5357     callFrame->setScopeChain(callFrame->scopeChain()->pop());
     5443    Register* r = ARG_r;
     5444    r[RegisterFile::ScopeChain] = scopeChain(r)->pop();
    53585445}
    53595446
    53605447JSValue* Machine::cti_op_typeof(CTI_ARGS)
    53615448{
    5362     return jsTypeStringForValue(ARG_callFrame, ARG_src1);
     5449    return jsTypeStringForValue(ARG_exec, ARG_src1);
    53635450}
    53645451
     
    54215508{
    54225509    JSValue* src = ARG_src1;
    5423     CallFrame* callFrame = ARG_callFrame;
    5424 
    5425     JSValue* result = src->toJSNumber(callFrame);
     5510    ExecState* exec = ARG_exec;
     5511
     5512    JSValue* result = src->toJSNumber(exec);
    54265513    VM_CHECK_EXCEPTION_AT_END();
    54275514    return result;
     
    54305517JSValue* Machine::cti_op_in(CTI_ARGS)
    54315518{
    5432     CallFrame* callFrame = ARG_callFrame;
     5519    ExecState* exec = ARG_exec;
    54335520    JSValue* baseVal = ARG_src2;
    54345521
    54355522    if (!baseVal->isObject()) {
    5436         CallFrame* callFrame = ARG_callFrame;
    5437         CodeBlock* codeBlock = callFrame->codeBlock();
     5523        Register* r = ARG_r;
     5524        CodeBlock* codeBlock = Machine::codeBlock(r);
    54385525        ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    54395526        unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
    5440         ARG_globalData->exception = createInvalidParamError(callFrame, "in", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock);
     5527        exec->setException(createInvalidParamError(exec, "in", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock));
    54415528        VM_THROW_EXCEPTION();
    54425529    }
     
    54475534    uint32_t i;
    54485535    if (propName->getUInt32(i))
    5449         return jsBoolean(baseObj->hasProperty(callFrame, i));
    5450 
    5451     Identifier property(callFrame, propName->toString(callFrame));
     5536        return jsBoolean(baseObj->hasProperty(exec, i));
     5537
     5538    Identifier property(exec, propName->toString(exec));
    54525539    VM_CHECK_EXCEPTION();
    5453     return jsBoolean(baseObj->hasProperty(callFrame, property));
     5540    return jsBoolean(baseObj->hasProperty(exec, property));
    54545541}
    54555542
    54565543JSValue* Machine::cti_op_push_new_scope(CTI_ARGS)
    54575544{
    5458     JSObject* scope = new (ARG_globalData) JSStaticScopeObject(ARG_callFrame, *ARG_id1, ARG_src2, DontDelete);
    5459 
    5460     CallFrame* callFrame = ARG_callFrame;
    5461     callFrame->setScopeChain(callFrame->scopeChain()->push(scope));
     5545    JSObject* scope = new (ARG_globalData) JSStaticScopeObject(ARG_exec, *ARG_id1, ARG_src2, DontDelete);
     5546
     5547    Register* r = ARG_r;
     5548    r[RegisterFile::ScopeChain] = scopeChain(r)->push(scope);
    54625549    return scope;
    54635550}
     
    54665553{
    54675554    unsigned count = ARG_int1;
    5468     CallFrame* callFrame = ARG_callFrame;
    5469 
    5470     ScopeChainNode* tmp = callFrame->scopeChain();
     5555    Register* r = ARG_r;
     5556
     5557    ScopeChainNode* tmp = scopeChain(r);
    54715558    while (count--)
    54725559        tmp = tmp->pop();
    5473     callFrame->setScopeChain(tmp);
     5560    r[RegisterFile::ScopeChain] = tmp;
    54745561}
    54755562
    54765563void Machine::cti_op_put_by_index(CTI_ARGS)
    54775564{
    5478     CallFrame* callFrame = ARG_callFrame;
     5565    ExecState* exec = ARG_exec;
    54795566    unsigned property = ARG_int2;
    54805567
    5481     ARG_src1->put(callFrame, property, ARG_src3);
     5568    ARG_src1->put(exec, property, ARG_src3);
    54825569}
    54835570
     
    54865573    JSValue* scrutinee = ARG_src1;
    54875574    unsigned tableIndex = ARG_int2;
    5488     CallFrame* callFrame = ARG_callFrame;
    5489     CodeBlock* codeBlock = callFrame->codeBlock();
     5575    Register* r = ARG_r;
     5576    CodeBlock* codeBlock = Machine::codeBlock(r);
    54905577
    54915578    if (JSImmediate::isNumber(scrutinee)) {
     
    55015588    JSValue* scrutinee = ARG_src1;
    55025589    unsigned tableIndex = ARG_int2;
    5503     CallFrame* callFrame = ARG_callFrame;
    5504     CodeBlock* codeBlock = callFrame->codeBlock();
     5590    Register* r = ARG_r;
     5591    CodeBlock* codeBlock = Machine::codeBlock(r);
    55055592
    55065593    void* result = codeBlock->characterSwitchJumpTables[tableIndex].ctiDefault;
     
    55195606    JSValue* scrutinee = ARG_src1;
    55205607    unsigned tableIndex = ARG_int2;
    5521     CallFrame* callFrame = ARG_callFrame;
    5522     CodeBlock* codeBlock = callFrame->codeBlock();
     5608    Register* r = ARG_r;
     5609    CodeBlock* codeBlock = Machine::codeBlock(r);
    55235610
    55245611    void* result = codeBlock->stringSwitchJumpTables[tableIndex].ctiDefault;
     
    55345621JSValue* Machine::cti_op_del_by_val(CTI_ARGS)
    55355622{
    5536     CallFrame* callFrame = ARG_callFrame;
     5623    ExecState* exec = ARG_exec;
    55375624
    55385625    JSValue* baseValue = ARG_src1;
    5539     JSObject* baseObj = baseValue->toObject(callFrame); // may throw
     5626    JSObject* baseObj = baseValue->toObject(exec); // may throw
    55405627
    55415628    JSValue* subscript = ARG_src2;
     
    55435630    uint32_t i;
    55445631    if (subscript->getUInt32(i))
    5545         result = jsBoolean(baseObj->deleteProperty(callFrame, i));
     5632        result = jsBoolean(baseObj->deleteProperty(exec, i));
    55465633    else {
    55475634        VM_CHECK_EXCEPTION();
    5548         Identifier property(callFrame, subscript->toString(callFrame));
     5635        Identifier property(exec, subscript->toString(exec));
    55495636        VM_CHECK_EXCEPTION();
    5550         result = jsBoolean(baseObj->deleteProperty(callFrame, property));
     5637        result = jsBoolean(baseObj->deleteProperty(exec, property));
    55515638    }
    55525639
     
    55575644void Machine::cti_op_put_getter(CTI_ARGS)
    55585645{
    5559     CallFrame* callFrame = ARG_callFrame;
     5646    ExecState* exec = ARG_exec;
    55605647
    55615648    ASSERT(ARG_src1->isObject());
     
    55635650    Identifier& ident = *ARG_id2;
    55645651    ASSERT(ARG_src3->isObject());
    5565     baseObj->defineGetter(callFrame, ident, static_cast<JSObject*>(ARG_src3));
     5652    baseObj->defineGetter(exec, ident, static_cast<JSObject*>(ARG_src3));
    55665653}
    55675654
    55685655void Machine::cti_op_put_setter(CTI_ARGS)
    55695656{
    5570     CallFrame* callFrame = ARG_callFrame;
     5657    ExecState* exec = ARG_exec;
    55715658
    55725659    ASSERT(ARG_src1->isObject());
     
    55745661    Identifier& ident = *ARG_id2;
    55755662    ASSERT(ARG_src3->isObject());
    5576     baseObj->defineSetter(callFrame, ident, static_cast<JSObject*>(ARG_src3));
     5663    baseObj->defineSetter(exec, ident, static_cast<JSObject*>(ARG_src3));
    55775664}
    55785665
    55795666JSValue* Machine::cti_op_new_error(CTI_ARGS)
    55805667{
    5581     CallFrame* callFrame = ARG_callFrame;
    5582     CodeBlock* codeBlock = callFrame->codeBlock();
     5668    ExecState* exec = ARG_exec;
     5669    Register* r = ARG_r;
     5670    CodeBlock* codeBlock = Machine::codeBlock(r);
    55835671    unsigned type = ARG_int1;
    55845672    JSValue* message = ARG_src2;
    55855673    unsigned lineNumber = ARG_int3;
    55865674
    5587     return Error::create(callFrame, static_cast<ErrorType>(type), message->toString(callFrame), lineNumber, codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL());
     5675    return Error::create(exec, static_cast<ErrorType>(type), message->toString(exec), lineNumber, codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL());
    55885676}
    55895677
    55905678void Machine::cti_op_debug(CTI_ARGS)
    55915679{
    5592     CallFrame* callFrame = ARG_callFrame;
     5680    ExecState* exec = ARG_exec;
     5681    Register* r = ARG_r;
    55935682
    55945683    int debugHookID = ARG_int1;
     
    55965685    int lastLine = ARG_int3;
    55975686
    5598     ARG_globalData->machine->debug(callFrame, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
     5687    ARG_globalData->machine->debug(exec, r, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
    55995688}
    56005689
    56015690void* Machine::cti_vm_throw(CTI_ARGS)
    56025691{
    5603     CallFrame* callFrame = ARG_callFrame;
    5604     CodeBlock* codeBlock = callFrame->codeBlock();
     5692    ExecState* exec = ARG_exec;
     5693    Register* r = ARG_r;
     5694    CodeBlock* codeBlock = Machine::codeBlock(r);
    56055695
    56065696    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(ARG_globalData->throwReturnAddress));
     
    56115701    ARG_globalData->exception = 0;
    56125702
    5613     Instruction* handlerVPC = ARG_globalData->machine->throwException(callFrame, exceptionValue, codeBlock->instructions.begin() + vPCIndex, false);
     5703    Instruction* handlerVPC = ARG_globalData->machine->throwException(exec, exceptionValue, codeBlock->instructions.begin() + vPCIndex, r, false);
    56145704
    56155705    if (!handlerVPC) {
     
    56185708    }
    56195709
    5620     ARG_setCallFrame(callFrame);
    5621     void* catchRoutine = callFrame->codeBlock()->nativeExceptionCodeForHandlerVPC(handlerVPC);
     5710    ARG_setR(r);
     5711    void* catchRoutine = Machine::codeBlock(r)->nativeExceptionCodeForHandlerVPC(handlerVPC);
    56225712    ASSERT(catchRoutine);
    56235713    ctiSetReturnAddress(&CTI_RETURN_ADDRESS, catchRoutine);
Note: See TracChangeset for help on using the changeset viewer.