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


Ignore:
Timestamp:
Oct 8, 2008, 5:40:43 PM (17 years ago)
Author:
Darin Adler
Message:

JavaScriptCore:

2008-10-08 Darin Adler <Darin Adler>

Reviewed by Cameron Zwarich.

Add CallFrame as a synonym for ExecState. Arguably, some day we should switch every
client over to the new name.

Use CallFrame* consistently rather than Register* or ExecState* in low-level code such
as Machine.cpp and CTI.cpp. Similarly, use callFrame rather than r as its name and use
accessor functions to get at things in the frame.

Eliminate other uses of ExecState* that aren't needed, replacing in some cases with
JSGlobalData* and in other cases eliminating them entirely.

  • API/JSObjectRef.cpp: (JSObjectMakeFunctionWithCallback): (JSObjectMakeFunction): (JSObjectHasProperty): (JSObjectGetProperty): (JSObjectSetProperty): (JSObjectDeleteProperty):
  • API/OpaqueJSString.cpp:
  • API/OpaqueJSString.h:
  • VM/CTI.cpp: (JSC::CTI::getConstant): (JSC::CTI::emitGetArg): (JSC::CTI::emitGetPutArg): (JSC::CTI::getConstantImmediateNumericArg): (JSC::CTI::printOpcodeOperandTypes): (JSC::CTI::CTI): (JSC::CTI::compileOpCall): (JSC::CTI::compileBinaryArithOp): (JSC::CTI::privateCompileMainPass): (JSC::CTI::privateCompile): (JSC::CTI::privateCompileGetByIdProto): (JSC::CTI::privateCompileGetByIdChain): (JSC::CTI::compileRegExp):
  • VM/CTI.h:
  • VM/CodeBlock.h:
  • VM/CodeGenerator.cpp: (JSC::CodeGenerator::emitEqualityOp): (JSC::CodeGenerator::emitLoad): (JSC::CodeGenerator::emitUnexpectedLoad): (JSC::CodeGenerator::emitConstruct):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (JSC::jsLess): (JSC::jsLessEq): (JSC::jsAddSlowCase): (JSC::jsAdd): (JSC::jsTypeStringForValue): (JSC::Machine::resolve): (JSC::Machine::resolveSkip): (JSC::Machine::resolveGlobal): (JSC::inlineResolveBase): (JSC::Machine::resolveBase): (JSC::Machine::resolveBaseAndProperty): (JSC::Machine::resolveBaseAndFunc): (JSC::Machine::slideRegisterWindowForCall): (JSC::isNotObject): (JSC::Machine::callEval): (JSC::Machine::dumpCallFrame): (JSC::Machine::dumpRegisters): (JSC::Machine::unwindCallFrame): (JSC::Machine::throwException): (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope): (JSC::Machine::execute): (JSC::Machine::debug): (JSC::Machine::createExceptionScope): (JSC::cachePrototypeChain): (JSC::Machine::tryCachePutByID): (JSC::Machine::tryCacheGetByID): (JSC::Machine::privateExecute): (JSC::Machine::retrieveArguments): (JSC::Machine::retrieveCaller): (JSC::Machine::retrieveLastCaller): (JSC::Machine::findFunctionCallFrame): (JSC::Machine::getArgumentsData): (JSC::Machine::tryCTICachePutByID): (JSC::Machine::getCTIArrayLengthTrampoline): (JSC::Machine::getCTIStringLengthTrampoline): (JSC::Machine::tryCTICacheGetByID): (JSC::Machine::cti_op_convert_this): (JSC::Machine::cti_op_end): (JSC::Machine::cti_op_add): (JSC::Machine::cti_op_pre_inc): (JSC::Machine::cti_timeout_check): (JSC::Machine::cti_op_loop_if_less): (JSC::Machine::cti_op_loop_if_lesseq): (JSC::Machine::cti_op_new_object): (JSC::Machine::cti_op_put_by_id): (JSC::Machine::cti_op_put_by_id_second): (JSC::Machine::cti_op_put_by_id_generic): (JSC::Machine::cti_op_put_by_id_fail): (JSC::Machine::cti_op_get_by_id): (JSC::Machine::cti_op_get_by_id_second): (JSC::Machine::cti_op_get_by_id_generic): (JSC::Machine::cti_op_get_by_id_fail): (JSC::Machine::cti_op_instanceof): (JSC::Machine::cti_op_del_by_id): (JSC::Machine::cti_op_mul): (JSC::Machine::cti_op_new_func): (JSC::Machine::cti_op_call_JSFunction): (JSC::Machine::cti_vm_compile): (JSC::Machine::cti_op_push_activation): (JSC::Machine::cti_op_call_NotJSFunction): (JSC::Machine::cti_op_create_arguments): (JSC::Machine::cti_op_tear_off_activation): (JSC::Machine::cti_op_tear_off_arguments): (JSC::Machine::cti_op_ret_profiler): (JSC::Machine::cti_op_ret_scopeChain): (JSC::Machine::cti_op_new_array): (JSC::Machine::cti_op_resolve): (JSC::Machine::cti_op_construct_JSConstruct): (JSC::Machine::cti_op_construct_NotJSConstruct): (JSC::Machine::cti_op_get_by_val): (JSC::Machine::cti_op_resolve_func): (JSC::Machine::cti_op_sub): (JSC::Machine::cti_op_put_by_val): (JSC::Machine::cti_op_put_by_val_array): (JSC::Machine::cti_op_lesseq): (JSC::Machine::cti_op_loop_if_true): (JSC::Machine::cti_op_negate): (JSC::Machine::cti_op_resolve_base): (JSC::Machine::cti_op_resolve_skip): (JSC::Machine::cti_op_resolve_global): (JSC::Machine::cti_op_div): (JSC::Machine::cti_op_pre_dec): (JSC::Machine::cti_op_jless): (JSC::Machine::cti_op_not): (JSC::Machine::cti_op_jtrue): (JSC::Machine::cti_op_post_inc): (JSC::Machine::cti_op_eq): (JSC::Machine::cti_op_lshift): (JSC::Machine::cti_op_bitand): (JSC::Machine::cti_op_rshift): (JSC::Machine::cti_op_bitnot): (JSC::Machine::cti_op_resolve_with_base): (JSC::Machine::cti_op_new_func_exp): (JSC::Machine::cti_op_mod): (JSC::Machine::cti_op_less): (JSC::Machine::cti_op_neq): (JSC::Machine::cti_op_post_dec): (JSC::Machine::cti_op_urshift): (JSC::Machine::cti_op_bitxor): (JSC::Machine::cti_op_new_regexp): (JSC::Machine::cti_op_bitor): (JSC::Machine::cti_op_call_eval): (JSC::Machine::cti_op_throw): (JSC::Machine::cti_op_get_pnames): (JSC::Machine::cti_op_next_pname): (JSC::Machine::cti_op_push_scope): (JSC::Machine::cti_op_pop_scope): (JSC::Machine::cti_op_typeof): (JSC::Machine::cti_op_to_jsnumber): (JSC::Machine::cti_op_in): (JSC::Machine::cti_op_push_new_scope): (JSC::Machine::cti_op_jmp_scopes): (JSC::Machine::cti_op_put_by_index): (JSC::Machine::cti_op_switch_imm): (JSC::Machine::cti_op_switch_char): (JSC::Machine::cti_op_switch_string): (JSC::Machine::cti_op_del_by_val): (JSC::Machine::cti_op_put_getter): (JSC::Machine::cti_op_put_setter): (JSC::Machine::cti_op_new_error): (JSC::Machine::cti_op_debug): (JSC::Machine::cti_vm_throw):
  • VM/Machine.h:
  • VM/Register.h:
  • VM/RegisterFile.h:
  • kjs/Arguments.h:
  • kjs/DebuggerCallFrame.cpp: (JSC::DebuggerCallFrame::functionName): (JSC::DebuggerCallFrame::type): (JSC::DebuggerCallFrame::thisObject): (JSC::DebuggerCallFrame::evaluate):
  • kjs/DebuggerCallFrame.h:
  • kjs/ExecState.cpp: (JSC::CallFrame::thisValue):
  • kjs/ExecState.h:
  • kjs/FunctionConstructor.cpp: (JSC::constructFunction):
  • kjs/JSActivation.cpp: (JSC::JSActivation::JSActivation): (JSC::JSActivation::argumentsGetter):
  • kjs/JSActivation.h:
  • kjs/JSGlobalObject.cpp: (JSC::JSGlobalObject::init):
  • kjs/JSGlobalObjectFunctions.cpp: (JSC::globalFuncEval):
  • kjs/JSVariableObject.h:
  • kjs/Parser.cpp: (JSC::Parser::parse):
  • kjs/RegExpConstructor.cpp: (JSC::constructRegExp):
  • kjs/RegExpPrototype.cpp: (JSC::regExpProtoFuncCompile):
  • kjs/Shell.cpp: (prettyPrintScript):
  • kjs/StringPrototype.cpp: (JSC::stringProtoFuncMatch): (JSC::stringProtoFuncSearch):
  • kjs/identifier.cpp: (JSC::Identifier::checkSameIdentifierTable):
  • kjs/interpreter.cpp: (JSC::Interpreter::checkSyntax): (JSC::Interpreter::evaluate):
  • kjs/nodes.cpp: (JSC::ThrowableExpressionData::emitThrowError): (JSC::RegExpNode::emitCode): (JSC::ArrayNode::emitCode): (JSC::InstanceOfNode::emitCode):
  • kjs/nodes.h:
  • kjs/regexp.cpp: (JSC::RegExp::RegExp): (JSC::RegExp::create):
  • kjs/regexp.h:
  • profiler/HeavyProfile.h:
  • profiler/Profile.h:
  • wrec/WREC.cpp:
  • wrec/WREC.h:

WebKit/mac:

2008-10-08 Darin Adler <Darin Adler>

Reviewed by Cameron Zwarich.

  • WebView/WebScriptDebugger.mm: (WebScriptDebugger::WebScriptDebugger): Update since DebuggerCallFrame is simpler now.
File:
1 edited

Legend:

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

    r37430 r37433  
    163163}
    164164
    165 static inline bool jsLess(ExecState* exec, JSValue* v1, JSValue* v2)
     165static inline bool jsLess(CallFrame* callFrame, JSValue* v1, JSValue* v2)
    166166{
    167167    if (JSImmediate::areBothImmediateNumbers(v1, v2))
     
    173173        return n1 < n2;
    174174
    175     Machine* machine = exec->machine();
     175    Machine* machine = callFrame->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(exec, n1, p1);
    182     bool wasNotString2 = v2->getPrimitiveNumber(exec, n2, p2);
     181    bool wasNotString1 = v1->getPrimitiveNumber(callFrame, n1, p1);
     182    bool wasNotString2 = v2->getPrimitiveNumber(callFrame, n2, p2);
    183183
    184184    if (wasNotString1 | wasNotString2)
     
    188188}
    189189
    190 static inline bool jsLessEq(ExecState* exec, JSValue* v1, JSValue* v2)
     190static inline bool jsLessEq(CallFrame* callFrame, JSValue* v1, JSValue* v2)
    191191{
    192192    if (JSImmediate::areBothImmediateNumbers(v1, v2))
     
    198198        return n1 <= n2;
    199199
    200     Machine* machine = exec->machine();
     200    Machine* machine = callFrame->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(exec, n1, p1);
    207     bool wasNotString2 = v2->getPrimitiveNumber(exec, n2, p2);
     206    bool wasNotString1 = v1->getPrimitiveNumber(callFrame, n1, p1);
     207    bool wasNotString2 = v2->getPrimitiveNumber(callFrame, n2, p2);
    208208
    209209    if (wasNotString1 | wasNotString2)
     
    213213}
    214214
    215 static NEVER_INLINE JSValue* jsAddSlowCase(ExecState* exec, JSValue* v1, JSValue* v2)
     215static NEVER_INLINE JSValue* jsAddSlowCase(CallFrame* callFrame, JSValue* v1, JSValue* v2)
    216216{
    217217    // exception for the Date exception in defaultValue()
    218     JSValue* p1 = v1->toPrimitive(exec);
    219     JSValue* p2 = v2->toPrimitive(exec);
     218    JSValue* p1 = v1->toPrimitive(callFrame);
     219    JSValue* p2 = v2->toPrimitive(callFrame);
    220220
    221221    if (p1->isString() || p2->isString()) {
    222         RefPtr<UString::Rep> value = concatenate(p1->toString(exec).rep(), p2->toString(exec).rep());
     222        RefPtr<UString::Rep> value = concatenate(p1->toString(callFrame).rep(), p2->toString(callFrame).rep());
    223223        if (!value)
    224             return throwOutOfMemoryError(exec);
    225         return jsString(exec, value.release());
    226     }
    227 
    228     return jsNumber(exec, p1->toNumber(exec) + p2->toNumber(exec));
     224            return throwOutOfMemoryError(callFrame);
     225        return jsString(callFrame, value.release());
     226    }
     227
     228    return jsNumber(callFrame, p1->toNumber(callFrame) + p2->toNumber(callFrame));
    229229}
    230230
     
    238238//    4000    Add case: 3 5
    239239
    240 static ALWAYS_INLINE JSValue* jsAdd(ExecState* exec, JSValue* v1, JSValue* v2)
     240static ALWAYS_INLINE JSValue* jsAdd(CallFrame* callFrame, JSValue* v1, JSValue* v2)
    241241{
    242242    double left;
     
    245245    bool rightIsNumber = fastIsNumber(v2, right);
    246246    if (rightIsNumber && fastIsNumber(v1, left))
    247         return jsNumber(exec, left + right);
     247        return jsNumber(callFrame, 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(exec);
    254         return jsString(exec, value.release());
     253            return throwOutOfMemoryError(callFrame);
     254        return jsString(callFrame, value.release());
    255255    }
    256256
     
    261261
    262262        if (!value)
    263             return throwOutOfMemoryError(exec);
    264         return jsString(exec, value.release());
     263            return throwOutOfMemoryError(callFrame);
     264        return jsString(callFrame, value.release());
    265265    }
    266266
    267267    // All other cases are pretty uncommon
    268     return jsAddSlowCase(exec, v1, v2);
    269 }
    270 
    271 static JSValue* jsTypeStringForValue(ExecState* exec, JSValue* v)
     268    return jsAddSlowCase(callFrame, v1, v2);
     269}
     270
     271static JSValue* jsTypeStringForValue(CallFrame* callFrame, JSValue* v)
    272272{
    273273    if (v->isUndefined())
    274         return jsNontrivialString(exec, "undefined");
     274        return jsNontrivialString(callFrame, "undefined");
    275275    if (v->isBoolean())
    276         return jsNontrivialString(exec, "boolean");
     276        return jsNontrivialString(callFrame, "boolean");
    277277    if (v->isNumber())
    278         return jsNontrivialString(exec, "number");
     278        return jsNontrivialString(callFrame, "number");
    279279    if (v->isString())
    280         return jsNontrivialString(exec, "string");
     280        return jsNontrivialString(callFrame, "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(exec, "undefined");
     285            return jsNontrivialString(callFrame, "undefined");
    286286        CallData callData;
    287287        if (static_cast<JSObject*>(v)->getCallData(callData) != CallTypeNone)
    288             return jsNontrivialString(exec, "function");
    289     }
    290     return jsNontrivialString(exec, "object");
     288            return jsNontrivialString(callFrame, "function");
     289    }
     290    return jsNontrivialString(callFrame, "object");
    291291}
    292292
     
    319319}
    320320
    321 NEVER_INLINE bool Machine::resolve(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)
     321NEVER_INLINE bool Machine::resolve(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)
    322322{
    323323    int dst = (vPC + 1)->u.operand;
    324324    int property = (vPC + 2)->u.operand;
    325325
    326     ScopeChainNode* scopeChain = this->scopeChain(r);
     326    ScopeChainNode* scopeChain = callFrame->scopeChain();
    327327    ScopeChainIterator iter = scopeChain->begin();
    328328    ScopeChainIterator end = scopeChain->end();
    329329    ASSERT(iter != end);
    330330
    331     CodeBlock* codeBlock = this->codeBlock(r);
     331    CodeBlock* codeBlock = callFrame->codeBlock();
    332332    Identifier& ident = codeBlock->identifiers[property];
    333333    do {
    334334        JSObject* o = *iter;
    335335        PropertySlot slot(o);
    336         if (o->getPropertySlot(exec, ident, slot)) {
    337             JSValue* result = slot.getValue(exec, ident);
    338             exceptionValue = exec->exception();
     336        if (o->getPropertySlot(callFrame, ident, slot)) {
     337            JSValue* result = slot.getValue(callFrame, ident);
     338            exceptionValue = callFrame->globalData().exception;
    339339            if (exceptionValue)
    340340                return false;
    341             r[dst] = result;
     341            callFrame[dst] = result;
    342342            return true;
    343343        }
    344344    } while (++iter != end);
    345     exceptionValue = createUndefinedVariableError(exec, ident, vPC, codeBlock);
     345    exceptionValue = createUndefinedVariableError(callFrame, ident, vPC, codeBlock);
    346346    return false;
    347347}
    348348
    349 NEVER_INLINE bool Machine::resolveSkip(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)
    350 {
    351     CodeBlock* codeBlock = this->codeBlock(r);
     349NEVER_INLINE bool Machine::resolveSkip(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)
     350{
     351    CodeBlock* codeBlock = callFrame->codeBlock();
    352352
    353353    int dst = (vPC + 1)->u.operand;
     
    355355    int skip = (vPC + 3)->u.operand + codeBlock->needsFullScopeChain;
    356356
    357     ScopeChainNode* scopeChain = this->scopeChain(r);
     357    ScopeChainNode* scopeChain = callFrame->scopeChain();
    358358    ScopeChainIterator iter = scopeChain->begin();
    359359    ScopeChainIterator end = scopeChain->end();
     
    367367        JSObject* o = *iter;
    368368        PropertySlot slot(o);
    369         if (o->getPropertySlot(exec, ident, slot)) {
    370             JSValue* result = slot.getValue(exec, ident);
    371             exceptionValue = exec->exception();
     369        if (o->getPropertySlot(callFrame, ident, slot)) {
     370            JSValue* result = slot.getValue(callFrame, ident);
     371            exceptionValue = callFrame->globalData().exception;
    372372            if (exceptionValue)
    373373                return false;
    374             r[dst] = result;
     374            callFrame[dst] = result;
    375375            return true;
    376376        }
    377377    } while (++iter != end);
    378     exceptionValue = createUndefinedVariableError(exec, ident, vPC, codeBlock);
     378    exceptionValue = createUndefinedVariableError(callFrame, ident, vPC, codeBlock);
    379379    return false;
    380380}
    381381
    382 NEVER_INLINE bool Machine::resolveGlobal(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)
     382NEVER_INLINE bool Machine::resolveGlobal(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)
    383383{
    384384    int dst = (vPC + 1)->u.operand;
     
    390390
    391391    if (structureID == globalObject->structureID()) {
    392         r[dst] = globalObject->getDirectOffset(offset);
     392        callFrame[dst] = globalObject->getDirectOffset(offset);
    393393        return true;
    394394    }
    395395
    396     CodeBlock* codeBlock = this->codeBlock(r);
     396    CodeBlock* codeBlock = callFrame->codeBlock();
    397397    Identifier& ident = codeBlock->identifiers[property];
    398398    PropertySlot slot(globalObject);
    399     if (globalObject->getPropertySlot(exec, ident, slot)) {
    400         JSValue* result = slot.getValue(exec, ident);
     399    if (globalObject->getPropertySlot(callFrame, ident, slot)) {
     400        JSValue* result = slot.getValue(callFrame, ident);
    401401        if (slot.isCacheable()) {
    402402            if (vPC[4].u.structureID)
     
    405405            vPC[4] = globalObject->structureID();
    406406            vPC[5] = slot.cachedOffset();
    407             r[dst] = result;
     407            callFrame[dst] = result;
    408408            return true;
    409409        }
    410410
    411         exceptionValue = exec->exception();
     411        exceptionValue = callFrame->globalData().exception;
    412412        if (exceptionValue)
    413413            return false;
    414         r[dst] = result;
     414        callFrame[dst] = result;
    415415        return true;
    416416    }
    417417
    418     exceptionValue = createUndefinedVariableError(exec, ident, vPC, codeBlock);
     418    exceptionValue = createUndefinedVariableError(callFrame, ident, vPC, codeBlock);
    419419    return false;
    420420}
    421421
    422 ALWAYS_INLINE static JSValue* inlineResolveBase(ExecState* exec, Identifier& property, ScopeChainNode* scopeChain)
     422ALWAYS_INLINE static JSValue* inlineResolveBase(CallFrame* callFrame, Identifier& property, ScopeChainNode* scopeChain)
    423423{
    424424    ScopeChainIterator iter = scopeChain->begin();
     
    432432    while (true) {
    433433        base = *iter;
    434         if (next == end || base->getPropertySlot(exec, property, slot))
     434        if (next == end || base->getPropertySlot(callFrame, property, slot))
    435435            return base;
    436436
     
    443443}
    444444
    445 NEVER_INLINE void Machine::resolveBase(ExecState* exec, Instruction* vPC, Register* r)
     445NEVER_INLINE void Machine::resolveBase(CallFrame* callFrame, Instruction* vPC)
    446446{
    447447    int dst = (vPC + 1)->u.operand;
    448448    int property = (vPC + 2)->u.operand;
    449     CodeBlock* codeBlock = this->codeBlock(r);
    450     ScopeChainNode* scopeChain = this->scopeChain(r);
    451     r[dst] = inlineResolveBase(exec, codeBlock->identifiers[property], scopeChain);
    452 }
    453 
    454 NEVER_INLINE bool Machine::resolveBaseAndProperty(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)
     449    callFrame[dst] = inlineResolveBase(callFrame, callFrame->codeBlock()->identifiers[property], callFrame->scopeChain());
     450}
     451
     452NEVER_INLINE bool Machine::resolveBaseAndProperty(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)
    455453{
    456454    int baseDst = (vPC + 1)->u.operand;
     
    458456    int property = (vPC + 3)->u.operand;
    459457
    460     ScopeChainNode* scopeChain = this->scopeChain(r);
     458    ScopeChainNode* scopeChain = callFrame->scopeChain();
    461459    ScopeChainIterator iter = scopeChain->begin();
    462460    ScopeChainIterator end = scopeChain->end();
     
    466464    ASSERT(iter != end);
    467465
    468     CodeBlock* codeBlock = this->codeBlock(r);
     466    CodeBlock* codeBlock = callFrame->codeBlock();
    469467    Identifier& ident = codeBlock->identifiers[property];
    470468    JSObject* base;
     
    472470        base = *iter;
    473471        PropertySlot slot(base);
    474         if (base->getPropertySlot(exec, ident, slot)) {
    475             JSValue* result = slot.getValue(exec, ident);
    476             exceptionValue = exec->exception();
     472        if (base->getPropertySlot(callFrame, ident, slot)) {
     473            JSValue* result = slot.getValue(callFrame, ident);
     474            exceptionValue = callFrame->globalData().exception;
    477475            if (exceptionValue)
    478476                return false;
    479             r[propDst] = result;
    480             r[baseDst] = base;
     477            callFrame[propDst] = result;
     478            callFrame[baseDst] = base;
    481479            return true;
    482480        }
     
    484482    } while (iter != end);
    485483
    486     exceptionValue = createUndefinedVariableError(exec, ident, vPC, codeBlock);
     484    exceptionValue = createUndefinedVariableError(callFrame, ident, vPC, codeBlock);
    487485    return false;
    488486}
    489487
    490 NEVER_INLINE bool Machine::resolveBaseAndFunc(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)
     488NEVER_INLINE bool Machine::resolveBaseAndFunc(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)
    491489{
    492490    int baseDst = (vPC + 1)->u.operand;
     
    494492    int property = (vPC + 3)->u.operand;
    495493
    496     ScopeChainNode* scopeChain = this->scopeChain(r);
     494    ScopeChainNode* scopeChain = callFrame->scopeChain();
    497495    ScopeChainIterator iter = scopeChain->begin();
    498496    ScopeChainIterator end = scopeChain->end();
     
    502500    ASSERT(iter != end);
    503501
    504     CodeBlock* codeBlock = this->codeBlock(r);
     502    CodeBlock* codeBlock = callFrame->codeBlock();
    505503    Identifier& ident = codeBlock->identifiers[property];
    506504    JSObject* base;
     
    508506        base = *iter;
    509507        PropertySlot slot(base);
    510         if (base->getPropertySlot(exec, ident, slot)) {           
     508        if (base->getPropertySlot(callFrame, ident, slot)) {           
    511509            // ECMA 11.2.3 says that if we hit an activation the this value should be null.
    512510            // However, section 10.2.3 says that in the case where the value provided
     
    516514            // that in host objects you always get a valid object for this.
    517515            // We also handle wrapper substitution for the global object at the same time.
    518             JSObject* thisObj = base->toThisObject(exec);
    519             JSValue* result = slot.getValue(exec, ident);
    520             exceptionValue = exec->exception();
     516            JSObject* thisObj = base->toThisObject(callFrame);
     517            JSValue* result = slot.getValue(callFrame, ident);
     518            exceptionValue = callFrame->globalData().exception;
    521519            if (exceptionValue)
    522520                return false;
    523521
    524             r[baseDst] = thisObj;
    525             r[funcDst] = result;
     522            callFrame[baseDst] = thisObj;
     523            callFrame[funcDst] = result;
    526524            return true;
    527525        }
     
    529527    } while (iter != end);
    530528
    531     exceptionValue = createUndefinedVariableError(exec, ident, vPC, codeBlock);
     529    exceptionValue = createUndefinedVariableError(callFrame, ident, vPC, codeBlock);
    532530    return false;
    533531}
    534532
    535 ALWAYS_INLINE Register* slideRegisterWindowForCall(CodeBlock* newCodeBlock, RegisterFile* registerFile, Register* r, size_t registerOffset, int argc)
    536 {
     533ALWAYS_INLINE CallFrame* Machine::slideRegisterWindowForCall(CodeBlock* newCodeBlock, RegisterFile* registerFile, CallFrame* callFrame, size_t registerOffset, int argc)
     534{
     535    Register* r = callFrame->registers();
    537536    Register* newEnd = r + registerOffset + newCodeBlock->numCalleeRegisters;
    538537
     
    566565    }
    567566
    568     return r;
    569 }
    570 
    571 static NEVER_INLINE bool isNotObject(ExecState* exec, bool forInstanceOf, CodeBlock* codeBlock, const Instruction* vPC, JSValue* value, JSValue*& exceptionData)
     567    return CallFrame::create(r);
     568}
     569
     570static NEVER_INLINE bool isNotObject(CallFrame* callFrame, bool forInstanceOf, CodeBlock* codeBlock, const Instruction* vPC, JSValue* value, JSValue*& exceptionData)
    572571{
    573572    if (value->isObject())
    574573        return false;
    575     exceptionData = createInvalidParamError(exec, forInstanceOf ? "instanceof" : "in" , value, vPC, codeBlock);
     574    exceptionData = createInvalidParamError(callFrame, forInstanceOf ? "instanceof" : "in" , value, vPC, codeBlock);
    576575    return true;
    577576}
    578577
    579 NEVER_INLINE JSValue* Machine::callEval(ExecState* exec, JSObject* thisObj, ScopeChainNode* scopeChain, RegisterFile* registerFile, Register* r, int argv, int argc, JSValue*& exceptionValue)
     578NEVER_INLINE JSValue* Machine::callEval(CallFrame* callFrame, JSObject* thisObj, ScopeChainNode* scopeChain, RegisterFile* registerFile, int argv, int argc, JSValue*& exceptionValue)
    580579{
    581580    if (argc < 2)
    582581        return jsUndefined();
    583582
    584     JSValue* program = r[argv + 1].jsValue(exec);
     583    JSValue* program = callFrame[argv + 1].jsValue(callFrame);
    585584
    586585    if (!program->isString())
     
    589588    Profiler** profiler = Profiler::enabledProfilerReference();
    590589    if (*profiler)
    591         (*profiler)->willExecute(exec, scopeChain->globalObject()->evalFunction());
     590        (*profiler)->willExecute(callFrame, scopeChain->globalObject()->evalFunction());
    592591
    593592    UString programSource = static_cast<JSString*>(program)->value();
    594593
    595     CodeBlock* codeBlock = this->codeBlock(r);
    596     RefPtr<EvalNode> evalNode = codeBlock->evalCodeCache.get(exec, programSource, scopeChain, exceptionValue);
     594    CodeBlock* codeBlock = callFrame->codeBlock();
     595    RefPtr<EvalNode> evalNode = codeBlock->evalCodeCache.get(callFrame, programSource, scopeChain, exceptionValue);
    597596
    598597    JSValue* result = 0;
    599598    if (evalNode)
    600         result = exec->globalData().machine->execute(evalNode.get(), exec, thisObj, r - registerFile->start() + argv + 1 + RegisterFile::CallFrameHeaderSize, scopeChain, &exceptionValue);
     599        result = callFrame->globalData().machine->execute(evalNode.get(), callFrame, thisObj, callFrame->registers() - registerFile->start() + argv + 1 + RegisterFile::CallFrameHeaderSize, scopeChain, &exceptionValue);
    601600
    602601    if (*profiler)
    603         (*profiler)->didExecute(exec, scopeChain->globalObject()->evalFunction());
     602        (*profiler)->didExecute(callFrame, scopeChain->globalObject()->evalFunction());
    604603
    605604    return result;
     
    653652#ifndef NDEBUG
    654653
    655 void Machine::dumpCallFrame(const RegisterFile* registerFile, const Register* r)
    656 {
    657     JSGlobalObject* globalObject = scopeChain(r)->globalObject();
    658 
    659     CodeBlock* codeBlock = this->codeBlock(r);
     654void Machine::dumpCallFrame(const RegisterFile* registerFile, CallFrame* callFrame)
     655{
     656    JSGlobalObject* globalObject = callFrame->scopeChain()->globalObject();
     657
     658    CodeBlock* codeBlock = callFrame->codeBlock();
    660659    codeBlock->dump(globalObject->globalExec());
    661660
    662     dumpRegisters(registerFile, r);
    663 }
    664 
    665 void Machine::dumpRegisters(const RegisterFile* registerFile, const Register* r)
     661    dumpRegisters(registerFile, callFrame);
     662}
     663
     664void Machine::dumpRegisters(const RegisterFile* registerFile, CallFrame* callFrame)
    666665{
    667666    printf("Register frame: \n\n");
     
    670669    printf("----------------------------------------------------\n");
    671670
    672     CodeBlock* codeBlock = this->codeBlock(r);
     671    CodeBlock* codeBlock = callFrame->codeBlock();
    673672    const Register* it;
    674673    const Register* end;
     
    684683    }
    685684   
    686     it = r - RegisterFile::CallFrameHeaderSize - codeBlock->numParameters;
     685    it = callFrame->registers() - RegisterFile::CallFrameHeaderSize - codeBlock->numParameters;
    687686    printf("[this]                     | %10p | %10p \n", it, (*it).v()); ++it;
    688687    end = it + max(codeBlock->numParameters - 1, 0); // - 1 to skip "this"
     
    740739#endif
    741740
    742 //#if !defined(NDEBUG) || ENABLE(SAMPLING_TOOL)
    743 
    744741bool Machine::isOpcode(Opcode opcode)
    745742{
     
    753750}
    754751
    755 //#endif
    756 
    757 NEVER_INLINE bool Machine::unwindCallFrame(ExecState*& exec, JSValue* exceptionValue, const Instruction*& vPC, CodeBlock*& codeBlock, Register*& r)
     752NEVER_INLINE bool Machine::unwindCallFrame(CallFrame*& callFrame, JSValue* exceptionValue, const Instruction*& vPC, CodeBlock*& codeBlock)
    758753{
    759754    CodeBlock* oldCodeBlock = codeBlock;
    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))
     755    ScopeChainNode* scopeChain = callFrame->scopeChain();
     756
     757    if (Debugger* debugger = callFrame->dynamicGlobalObject()->debugger()) {
     758        DebuggerCallFrame debuggerCallFrame(callFrame, exceptionValue);
     759        if (callFrame->callee())
    765760            debugger->returnEvent(debuggerCallFrame, codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->lastLine());
    766761        else
     
    769764
    770765    if (Profiler* profiler = *Profiler::enabledProfilerReference()) {
    771         if (r[RegisterFile::Callee].jsValue(exec))
    772             profiler->didExecute(exec, static_cast<JSObject*>(r[RegisterFile::Callee].jsValue(exec)));
     766        if (callFrame->callee())
     767            profiler->didExecute(callFrame, callFrame->callee());
    773768        else
    774             profiler->didExecute(exec, codeBlock->ownerNode->sourceURL(), codeBlock->ownerNode->lineNo());
     769            profiler->didExecute(callFrame, codeBlock->ownerNode->sourceURL(), codeBlock->ownerNode->lineNo());
    775770    }
    776771
     
    779774        while (!scopeChain->object->isObject(&JSActivation::info))
    780775            scopeChain = scopeChain->pop();
    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));
     776        static_cast<JSActivation*>(scopeChain->object)->copyRegisters(callFrame->optionalCalleeArguments());
     777    } else if (Arguments* arguments = callFrame->optionalCalleeArguments()) {
    790778        if (!arguments->isTornOff())
    791779            arguments->copyRegisters();
     
    795783        scopeChain->deref();
    796784
    797     void* returnPC = r[RegisterFile::ReturnPC].v();
    798     r = r[RegisterFile::CallerRegisters].r();
    799     exec = CallFrame::create(r);
    800     if (isHostCallFrame(r))
     785    void* returnPC = callFrame->returnPC();
     786    callFrame = callFrame->callerFrame();
     787    if (callFrame->hasHostCallFrameFlag())
    801788        return false;
    802789
    803     codeBlock = this->codeBlock(r);
     790    codeBlock = callFrame->codeBlock();
    804791    vPC = vPCForPC(codeBlock, returnPC);
    805792    return true;
    806793}
    807794
    808 NEVER_INLINE Instruction* Machine::throwException(ExecState* exec, JSValue*& exceptionValue, const Instruction* vPC, Register*& r, bool explicitThrow)
     795NEVER_INLINE Instruction* Machine::throwException(CallFrame*& callFrame, JSValue*& exceptionValue, const Instruction* vPC, bool explicitThrow)
    809796{
    810797    // Set up the exception object
    811798   
    812     CodeBlock* codeBlock = this->codeBlock(r);
     799    CodeBlock* codeBlock = callFrame->codeBlock();
    813800    if (exceptionValue->isObject()) {
    814801        JSObject* exception = static_cast<JSObject*>(exceptionValue);
    815802        if (exception->isNotAnObjectErrorStub()) {
    816             exception = createNotAnObjectError(exec, static_cast<JSNotAnObjectErrorStub*>(exception), vPC, codeBlock);
     803            exception = createNotAnObjectError(callFrame, static_cast<JSNotAnObjectErrorStub*>(exception), vPC, codeBlock);
    817804            exceptionValue = exception;
    818805        } else {
    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))) {
     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))) {
    825812                if (explicitThrow) {
    826813                    int startOffset = 0;
     
    828815                    int divotPoint = 0;
    829816                    int line = codeBlock->expressionRangeForVPC(vPC, divotPoint, startOffset, endOffset);
    830                     exception->putWithAttributes(exec, Identifier(exec, "line"), jsNumber(exec, line), ReadOnly | DontDelete);
     817                    exception->putWithAttributes(callFrame, Identifier(callFrame, "line"), jsNumber(callFrame, line), ReadOnly | DontDelete);
    831818                   
    832819                    // We only hit this path for error messages and throw statements, which don't have a specific failure position
    833820                    // So we just give the full range of the error/throw statement.
    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);
     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);
    836823                } else
    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);
     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);
    840827            }
    841828           
    842829            if (exception->isWatchdogException()) {
    843                 while (unwindCallFrame(exec, exceptionValue, vPC, codeBlock, r)) {
     830                while (unwindCallFrame(callFrame, exceptionValue, vPC, codeBlock)) {
    844831                    // Don't need handler checks or anything, we just want to unroll all the JS callframes possible.
    845832                }
     
    849836    }
    850837
    851     if (Debugger* debugger = exec->dynamicGlobalObject()->debugger()) {
    852         ScopeChainNode* scopeChain = this->scopeChain(r);
    853         DebuggerCallFrame debuggerCallFrame(exec->dynamicGlobalObject(), codeBlock, scopeChain, r, exceptionValue);
     838    if (Debugger* debugger = callFrame->dynamicGlobalObject()->debugger()) {
     839        DebuggerCallFrame debuggerCallFrame(callFrame, exceptionValue);
    854840        debugger->exception(debuggerCallFrame, codeBlock->ownerNode->sourceID(), codeBlock->lineNumberForVPC(vPC));
    855841    }
     
    861847
    862848    while (!codeBlock->getHandlerForVPC(vPC, handlerVPC, scopeDepth)) {
    863         if (!unwindCallFrame(exec, exceptionValue, vPC, codeBlock, r))
     849        if (!unwindCallFrame(callFrame, exceptionValue, vPC, codeBlock))
    864850            return 0;
    865851    }
     
    867853    // Now unwind the scope chain within the exception handler's call frame.
    868854
    869     ScopeChain sc(this->scopeChain(r));
     855    ScopeChain sc(callFrame->scopeChain());
    870856    int scopeDelta = depth(codeBlock, sc) - scopeDepth;
    871857    ASSERT(scopeDelta >= 0);
    872858    while (scopeDelta--)
    873859        sc.pop();
    874     r[RegisterFile::ScopeChain] = sc.node();
     860    callFrame->setScopeChain(sc.node());
    875861
    876862    return handlerVPC;
    877863}
    878864
    879 class DynamicGlobalObjectScope {
     865class DynamicGlobalObjectScope : Noncopyable {
    880866public:
    881     DynamicGlobalObjectScope(ExecState* exec, JSGlobalObject* dynamicGlobalObject)
    882         : m_exec(exec)
    883         , m_savedGlobalObject(exec->globalData().dynamicGlobalObject)
     867    DynamicGlobalObjectScope(CallFrame* callFrame, JSGlobalObject* dynamicGlobalObject)
     868        : m_dynamicGlobalObjectSlot(callFrame->globalData().dynamicGlobalObject)
     869        , m_savedDynamicGlobalObject(m_dynamicGlobalObjectSlot)
    884870    {
    885         exec->globalData().dynamicGlobalObject = dynamicGlobalObject;
     871        m_dynamicGlobalObjectSlot = dynamicGlobalObject;
    886872    }
    887873
    888874    ~DynamicGlobalObjectScope()
    889875    {
    890         m_exec->globalData().dynamicGlobalObject = m_savedGlobalObject;
     876        m_dynamicGlobalObjectSlot = m_savedDynamicGlobalObject;
    891877    }
    892878
    893879private:
    894     ExecState* m_exec;
    895     JSGlobalObject* m_savedGlobalObject;
     880    JSGlobalObject*& m_dynamicGlobalObjectSlot;
     881    JSGlobalObject* m_savedDynamicGlobalObject;
    896882};
    897883
    898 JSValue* Machine::execute(ProgramNode* programNode, ExecState* exec, ScopeChainNode* scopeChain, JSObject* thisObj, JSValue** exception)
    899 {
    900     ASSERT(!exec->hadException());
     884JSValue* Machine::execute(ProgramNode* programNode, CallFrame* callFrame, ScopeChainNode* scopeChain, JSObject* thisObj, JSValue** exception)
     885{
     886    ASSERT(!scopeChain->globalData->exception);
    901887
    902888    if (m_reentryDepth >= MaxReentryDepth) {
    903         *exception = createStackOverflowError(exec);
     889        *exception = createStackOverflowError(callFrame);
    904890        return jsNull();
    905891    }
     
    910896    Register* newEnd = oldEnd + codeBlock->numParameters + RegisterFile::CallFrameHeaderSize + codeBlock->numCalleeRegisters;
    911897    if (!m_registerFile.grow(newEnd)) {
    912         *exception = createStackOverflowError(exec);
     898        *exception = createStackOverflowError(callFrame);
    913899        return jsNull();
    914900    }
    915901
    916     DynamicGlobalObjectScope globalObjectScope(exec, scopeChain->globalObject());
     902    DynamicGlobalObjectScope globalObjectScope(callFrame, scopeChain->globalObject());
    917903
    918904    JSGlobalObject* lastGlobalObject = m_registerFile.globalObject();
    919     JSGlobalObject* globalObject = exec->dynamicGlobalObject();
     905    JSGlobalObject* globalObject = callFrame->dynamicGlobalObject();
    920906    globalObject->copyGlobalsTo(m_registerFile);
    921907
    922     Register* r = oldEnd + codeBlock->numParameters + RegisterFile::CallFrameHeaderSize;
    923     r[codeBlock->thisRegister] = thisObj;
    924     initializeCallFrame(r, codeBlock, 0, scopeChain, makeHostCallFramePointer(0), 0, 0, 0);
     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);
    925911
    926912    if (codeBlock->needsFullScopeChain)
    927         scopeChain = scopeChain->copy();
     913        scopeChain->ref();
    928914
    929915    Profiler** profiler = Profiler::enabledProfilerReference();
    930916    if (*profiler)
    931         (*profiler)->willExecute(exec, programNode->sourceURL(), programNode->lineNo());
     917        (*profiler)->willExecute(newCallFrame, programNode->sourceURL(), programNode->lineNo());
    932918
    933919    m_reentryDepth++;
    934920#if ENABLE(CTI)
    935921    if (!codeBlock->ctiCode)
    936         CTI::compile(this, exec, codeBlock);
    937     JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, r, scopeChain->globalData, exception);
     922        CTI::compile(this, newCallFrame, codeBlock);
     923    JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);
    938924#else
    939     JSValue* result = privateExecute(Normal, &m_registerFile, r, exception);
     925    JSValue* result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
    940926#endif
    941927    m_reentryDepth--;
     
    944930
    945931    if (*profiler)
    946         (*profiler)->didExecute(exec, programNode->sourceURL(), programNode->lineNo());
     932        (*profiler)->didExecute(callFrame, programNode->sourceURL(), programNode->lineNo());
    947933
    948934    if (m_reentryDepth && lastGlobalObject && globalObject != lastGlobalObject)
     
    954940}
    955941
    956 JSValue* Machine::execute(FunctionBodyNode* functionBodyNode, ExecState* exec, JSFunction* function, JSObject* thisObj, const ArgList& args, ScopeChainNode* scopeChain, JSValue** exception)
    957 {
    958     ASSERT(!exec->hadException());
     942JSValue* Machine::execute(FunctionBodyNode* functionBodyNode, CallFrame* callFrame, JSFunction* function, JSObject* thisObj, const ArgList& args, ScopeChainNode* scopeChain, JSValue** exception)
     943{
     944    ASSERT(!scopeChain->globalData->exception);
    959945
    960946    if (m_reentryDepth >= MaxReentryDepth) {
    961         *exception = createStackOverflowError(exec);
     947        *exception = createStackOverflowError(callFrame);
    962948        return jsNull();
    963949    }
     
    967953
    968954    if (!m_registerFile.grow(oldEnd + argc)) {
    969         *exception = createStackOverflowError(exec);
     955        *exception = createStackOverflowError(callFrame);
    970956        return jsNull();
    971957    }
    972958
    973     DynamicGlobalObjectScope globalObjectScope(exec, exec->globalData().dynamicGlobalObject ? exec->globalData().dynamicGlobalObject : scopeChain->globalObject());
    974 
    975     Register* argv = oldEnd;
     959    DynamicGlobalObjectScope globalObjectScope(callFrame, callFrame->globalData().dynamicGlobalObject ? callFrame->globalData().dynamicGlobalObject : scopeChain->globalObject());
     960
     961    CallFrame* newCallFrame = CallFrame::create(oldEnd);
    976962    size_t dst = 0;
    977     argv[dst] = thisObj;
    978 
     963    newCallFrame[0] = thisObj;
    979964    ArgList::const_iterator end = args.end();
    980965    for (ArgList::const_iterator it = args.begin(); it != end; ++it)
    981         argv[++dst] = *it;
     966        newCallFrame[++dst] = *it;
    982967
    983968    CodeBlock* codeBlock = &functionBodyNode->byteCode(scopeChain);
    984     Register* r = slideRegisterWindowForCall(codeBlock, &m_registerFile, argv, argc + RegisterFile::CallFrameHeaderSize, argc);
    985     if (UNLIKELY(!r)) {
    986         *exception = createStackOverflowError(exec);
     969    newCallFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc);
     970    if (UNLIKELY(!newCallFrame)) {
     971        *exception = createStackOverflowError(callFrame);
    987972        m_registerFile.shrink(oldEnd);
    988973        return jsNull();
    989974    }
    990975    // a 0 codeBlock indicates a built-in caller
    991     initializeCallFrame(r, codeBlock, 0, scopeChain, makeHostCallFramePointer(exec->registers()), 0, argc, function);
     976    newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), 0, argc, function);
    992977
    993978    Profiler** profiler = Profiler::enabledProfilerReference();
    994979    if (*profiler)
    995         (*profiler)->willExecute(exec, function);
     980        (*profiler)->willExecute(newCallFrame, function);
    996981
    997982    m_reentryDepth++;
    998983#if ENABLE(CTI)
    999984    if (!codeBlock->ctiCode)
    1000         CTI::compile(this, exec, codeBlock);
    1001     JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, r, scopeChain->globalData, exception);
     985        CTI::compile(this, newCallFrame, codeBlock);
     986    JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);
    1002987#else
    1003     JSValue* result = privateExecute(Normal, &m_registerFile, r, exception);
     988    JSValue* result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
    1004989#endif
    1005990    m_reentryDepth--;
     
    1011996}
    1012997
    1013 JSValue* 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 
    1018 JSValue* Machine::execute(EvalNode* evalNode, ExecState* exec, JSObject* thisObj, int registerOffset, ScopeChainNode* scopeChain, JSValue** exception)
    1019 {
    1020     ASSERT(!exec->hadException());
     998JSValue* 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
     1003JSValue* Machine::execute(EvalNode* evalNode, CallFrame* callFrame, JSObject* thisObj, int registerOffset, ScopeChainNode* scopeChain, JSValue** exception)
     1004{
     1005    ASSERT(!scopeChain->globalData->exception);
    10211006
    10221007    if (m_reentryDepth >= MaxReentryDepth) {
    1023         *exception = createStackOverflowError(exec);
     1008        *exception = createStackOverflowError(callFrame);
    10241009        return jsNull();
    10251010    }
    10261011
    1027     DynamicGlobalObjectScope globalObjectScope(exec, exec->globalData().dynamicGlobalObject ? exec->globalData().dynamicGlobalObject : scopeChain->globalObject());
     1012    DynamicGlobalObjectScope globalObjectScope(callFrame, callFrame->globalData().dynamicGlobalObject ? callFrame->globalData().dynamicGlobalObject : scopeChain->globalObject());
    10281013
    10291014    EvalCodeBlock* codeBlock = &evalNode->byteCode(scopeChain);
     
    10461031        for (Node::VarStack::const_iterator it = varStack.begin(); it != varStackEnd; ++it) {
    10471032            const Identifier& ident = (*it).first;
    1048             if (!variableObject->hasProperty(exec, ident)) {
     1033            if (!variableObject->hasProperty(callFrame, ident)) {
    10491034                PutPropertySlot slot;
    1050                 variableObject->put(exec, ident, jsUndefined(), slot);
     1035                variableObject->put(callFrame, ident, jsUndefined(), slot);
    10511036            }
    10521037        }
     
    10561041        for (Node::FunctionStack::const_iterator it = functionStack.begin(); it != functionStackEnd; ++it) {
    10571042            PutPropertySlot slot;
    1058             variableObject->put(exec, (*it)->m_ident, (*it)->makeFunction(exec, scopeChain), slot);
     1043            variableObject->put(callFrame, (*it)->m_ident, (*it)->makeFunction(callFrame, scopeChain), slot);
    10591044        }
    10601045
     
    10641049    Register* newEnd = m_registerFile.start() + registerOffset + codeBlock->numCalleeRegisters;
    10651050    if (!m_registerFile.grow(newEnd)) {
    1066         *exception = createStackOverflowError(exec);
     1051        *exception = createStackOverflowError(callFrame);
    10671052        return jsNull();
    10681053    }
    10691054
    1070     Register* r = m_registerFile.start() + registerOffset;
     1055    CallFrame* newCallFrame = CallFrame::create(m_registerFile.start() + registerOffset);
    10711056
    10721057    // a 0 codeBlock indicates a built-in caller
    1073     r[codeBlock->thisRegister] = thisObj;
    1074     initializeCallFrame(r, codeBlock, 0, scopeChain, makeHostCallFramePointer(exec->registers()), 0, 0, 0);
     1058    newCallFrame[codeBlock->thisRegister] = thisObj;
     1059    newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), 0, 0, 0);
    10751060
    10761061    if (codeBlock->needsFullScopeChain)
    1077         scopeChain = scopeChain->copy();
     1062        scopeChain->ref();
    10781063
    10791064    Profiler** profiler = Profiler::enabledProfilerReference();
    10801065    if (*profiler)
    1081         (*profiler)->willExecute(exec, evalNode->sourceURL(), evalNode->lineNo());
     1066        (*profiler)->willExecute(newCallFrame, evalNode->sourceURL(), evalNode->lineNo());
    10821067
    10831068    m_reentryDepth++;
    10841069#if ENABLE(CTI)
    10851070    if (!codeBlock->ctiCode)
    1086         CTI::compile(this, exec, codeBlock);
    1087     JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, r, scopeChain->globalData, exception);
     1071        CTI::compile(this, newCallFrame, codeBlock);
     1072    JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);
    10881073#else
    1089     JSValue* result = privateExecute(Normal, &m_registerFile, r, exception);
     1074    JSValue* result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
    10901075#endif
    10911076    m_reentryDepth--;
     
    10941079
    10951080    if (*profiler)
    1096         (*profiler)->didExecute(exec, evalNode->sourceURL(), evalNode->lineNo());
     1081        (*profiler)->didExecute(callFrame, evalNode->sourceURL(), evalNode->lineNo());
    10971082
    10981083    m_registerFile.shrink(oldEnd);
     
    11001085}
    11011086
    1102 NEVER_INLINE void Machine::debug(ExecState* exec, Register* r, DebugHookID debugHookID, int firstLine, int lastLine)
    1103 {
    1104     Debugger* debugger = exec->dynamicGlobalObject()->debugger();
     1087NEVER_INLINE void Machine::debug(CallFrame* callFrame, DebugHookID debugHookID, int firstLine, int lastLine)
     1088{
     1089    Debugger* debugger = callFrame->dynamicGlobalObject()->debugger();
    11051090    if (!debugger)
    11061091        return;
    11071092
    1108     CodeBlock* codeBlock = this->codeBlock(r);
    1109     ScopeChainNode* scopeChain = this->scopeChain(r);
    1110     DebuggerCallFrame debuggerCallFrame(exec->dynamicGlobalObject(), codeBlock, scopeChain, r, 0);
    1111 
    11121093    switch (debugHookID) {
    11131094        case DidEnterCallFrame:
    1114             debugger->callEvent(debuggerCallFrame, codeBlock->ownerNode->sourceID(), firstLine);
     1095            debugger->callEvent(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), firstLine);
    11151096            return;
    11161097        case WillLeaveCallFrame:
    1117             debugger->returnEvent(debuggerCallFrame, codeBlock->ownerNode->sourceID(), lastLine);
     1098            debugger->returnEvent(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), lastLine);
    11181099            return;
    11191100        case WillExecuteStatement:
    1120             debugger->atStatement(debuggerCallFrame, codeBlock->ownerNode->sourceID(), firstLine);
     1101            debugger->atStatement(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), firstLine);
    11211102            return;
    11221103        case WillExecuteProgram:
    1123             debugger->willExecuteProgram(debuggerCallFrame, codeBlock->ownerNode->sourceID(), firstLine);
     1104            debugger->willExecuteProgram(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), firstLine);
    11241105            return;
    11251106        case DidExecuteProgram:
    1126             debugger->didExecuteProgram(debuggerCallFrame, codeBlock->ownerNode->sourceID(), lastLine);
     1107            debugger->didExecuteProgram(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), lastLine);
    11271108            return;
    11281109        case DidReachBreakpoint:
    1129             debugger->didReachBreakpoint(debuggerCallFrame, codeBlock->ownerNode->sourceID(), lastLine);
     1110            debugger->didReachBreakpoint(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), lastLine);
    11301111            return;
    11311112    }
     
    12171198}
    12181199
    1219 NEVER_INLINE ScopeChainNode* Machine::createExceptionScope(ExecState* exec, const Instruction* vPC, Register* r)
     1200NEVER_INLINE ScopeChainNode* Machine::createExceptionScope(CallFrame* callFrame, const Instruction* vPC)
    12201201{
    12211202    int dst = (++vPC)->u.operand;
    1222     CodeBlock* codeBlock = this->codeBlock(r);
     1203    CodeBlock* codeBlock = callFrame->codeBlock();
    12231204    Identifier& property = codeBlock->identifiers[(++vPC)->u.operand];
    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 
    1231 static StructureIDChain* cachePrototypeChain(ExecState* exec, StructureID* structureID)
    1232 {
    1233     JSValue* prototype = structureID->prototypeForLookup(exec);
     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
     1212static StructureIDChain* cachePrototypeChain(CallFrame* callFrame, StructureID* structureID)
     1213{
     1214    JSValue* prototype = structureID->prototypeForLookup(callFrame);
    12341215    if (JSImmediate::isImmediate(prototype))
    12351216        return 0;
     
    12391220}
    12401221
    1241 NEVER_INLINE void Machine::tryCachePutByID(ExecState* exec, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const PutPropertySlot& slot)
     1222NEVER_INLINE void Machine::tryCachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const PutPropertySlot& slot)
    12421223{
    12431224    // Recursive invocation may already have specialized this instruction.
     
    12911272        StructureIDChain* chain = structureID->cachedPrototypeChain();
    12921273        if (!chain) {
    1293             chain = cachePrototypeChain(exec, structureID);
     1274            chain = cachePrototypeChain(callFrame, structureID);
    12941275            if (!chain) {
    12951276                // This happens if someone has manually inserted null into the prototype chain
     
    13161297}
    13171298
    1318 NEVER_INLINE void Machine::tryCacheGetByID(ExecState* exec, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot)
     1299NEVER_INLINE void Machine::tryCacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot)
    13191300{
    13201301    // Recursive invocation may already have specialized this instruction.
     
    13281309    }
    13291310
    1330     if (isJSArray(baseValue) && propertyName == exec->propertyNames().length) {
     1311    if (isJSArray(baseValue) && propertyName == callFrame->propertyNames().length) {
    13311312        vPC[0] = getOpcode(op_get_array_length);
    13321313        return;
    13331314    }
    13341315
    1335     if (isJSString(baseValue) && propertyName == exec->propertyNames().length) {
     1316    if (isJSString(baseValue) && propertyName == callFrame->propertyNames().length) {
    13361317        vPC[0] = getOpcode(op_get_string_length);
    13371318        return;
     
    13751356    }
    13761357
    1377     if (slot.slotBase() == structureID->prototypeForLookup(exec)) {
     1358    if (slot.slotBase() == structureID->prototypeForLookup(callFrame)) {
    13781359        ASSERT(slot.slotBase()->isObject());
    13791360
     
    13991380    JSObject* o = static_cast<JSObject*>(baseValue);
    14001381    while (slot.slotBase() != o) {
    1401         JSValue* v = o->structureID()->prototypeForLookup(exec);
     1382        JSValue* v = o->structureID()->prototypeForLookup(callFrame);
    14021383
    14031384        // If we didn't find base in baseValue's prototype chain, then baseValue
     
    14231404    StructureIDChain* chain = structureID->cachedPrototypeChain();
    14241405    if (!chain)
    1425         chain = cachePrototypeChain(exec, structureID);
     1406        chain = cachePrototypeChain(callFrame, structureID);
    14261407    ASSERT(chain);
    14271408
     
    14411422}
    14421423
    1443 JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile, Register* r, JSValue** exception)
     1424JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile, CallFrame* callFrame, JSValue** exception)
    14441425{
    14451426    // One-time initialization of our address tables. We have to put this code
     
    14661447#endif
    14671448
    1468 #define exec CallFrame::create(r)
    1469 
    1470     JSGlobalData* globalData = &exec->globalData();
     1449    JSGlobalData* globalData = &callFrame->globalData();
    14711450    JSValue* exceptionValue = 0;
    14721451    Instruction* handlerVPC = 0;
    14731452
    1474     Instruction* vPC = this->codeBlock(r)->instructions.begin();
     1453    Instruction* vPC = callFrame->codeBlock()->instructions.begin();
    14751454    Profiler** enabledProfilerReference = Profiler::enabledProfilerReference();
    14761455    unsigned tickCount = m_ticksUntilNextTimeoutCheck + 1;
     
    14901469#define CHECK_FOR_TIMEOUT() \
    14911470    if (!--tickCount) { \
    1492         if ((exceptionValue = checkTimeout(exec->dynamicGlobalObject()))) \
     1471        if ((exceptionValue = checkTimeout(callFrame->dynamicGlobalObject()))) \
    14931472            goto vm_throw; \
    14941473        tickCount = m_ticksUntilNextTimeoutCheck; \
     
    14961475
    14971476#if HAVE(COMPUTED_GOTO)
    1498     #define NEXT_OPCODE MACHINE_SAMPLING_sample(this->codeBlock(r), vPC); goto *vPC->u.opcode
     1477    #define NEXT_OPCODE MACHINE_SAMPLING_sample(callFrame->codeBlock(), vPC); goto *vPC->u.opcode
    14991478#if DUMP_OPCODE_STATS
    15001479    #define BEGIN_OPCODE(opcode) opcode: OpcodeStats::recordInstruction(opcode);
     
    15041483    NEXT_OPCODE;
    15051484#else
    1506     #define NEXT_OPCODE MACHINE_SAMPLING_sample(this->codeBlock(r), vPC); goto interpreterLoopStart
     1485    #define NEXT_OPCODE MACHINE_SAMPLING_sample(callFrame->codeBlock(), vPC); goto interpreterLoopStart
    15071486#if DUMP_OPCODE_STATS
    15081487    #define BEGIN_OPCODE(opcode) case opcode: OpcodeStats::recordInstruction(opcode);
     
    15221501        */
    15231502        int dst = (++vPC)->u.operand;
    1524         r[dst] = constructEmptyObject(exec);
     1503        callFrame[dst] = constructEmptyObject(callFrame);
    15251504
    15261505        ++vPC;
     
    15381517        int firstArg = (++vPC)->u.operand;
    15391518        int argCount = (++vPC)->u.operand;
    1540         ArgList args(r + firstArg, argCount);
    1541         r[dst] = constructArray(exec, args);
     1519        ArgList args(callFrame->registers() + firstArg, argCount);
     1520        callFrame[dst] = constructArray(callFrame, args);
    15421521
    15431522        ++vPC;
     
    15531532        int dst = (++vPC)->u.operand;
    15541533        int regExp = (++vPC)->u.operand;
    1555         r[dst] = new (globalData) RegExpObject(scopeChain(r)->globalObject()->regExpStructure(), codeBlock(r)->regexps[regExp]);
     1534        callFrame[dst] = new (globalData) RegExpObject(callFrame->scopeChain()->globalObject()->regExpStructure(), callFrame->codeBlock()->regexps[regExp]);
    15561535
    15571536        ++vPC;
     
    15651544        int dst = (++vPC)->u.operand;
    15661545        int src = (++vPC)->u.operand;
    1567         r[dst] = r[src];
     1546        callFrame[dst] = callFrame[src];
    15681547
    15691548        ++vPC;
     
    15781557        */
    15791558        int dst = (++vPC)->u.operand;
    1580         JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
    1581         JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
     1559        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1560        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    15821561        if (JSImmediate::areBothImmediateNumbers(src1, src2))
    1583             r[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2));
     1562            callFrame[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2));
    15841563        else {
    1585             JSValue* result = jsBoolean(equalSlowCase(exec, src1, src2));
     1564            JSValue* result = jsBoolean(equalSlowCase(callFrame, src1, src2));
    15861565            VM_CHECK_EXCEPTION();
    1587             r[dst] = result;
     1566            callFrame[dst] = result;
    15881567        }
    15891568
     
    15981577        */
    15991578        int dst = (++vPC)->u.operand;
    1600         JSValue* src = r[(++vPC)->u.operand].jsValue(exec);
     1579        JSValue* src = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    16011580
    16021581        if (src->isUndefinedOrNull()) {
    1603             r[dst] = jsBoolean(true);
     1582            callFrame[dst] = jsBoolean(true);
    16041583            ++vPC;
    16051584            NEXT_OPCODE;
    16061585        }
    16071586       
    1608         r[dst] = jsBoolean(!JSImmediate::isImmediate(src) && src->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
     1587        callFrame[dst] = jsBoolean(!JSImmediate::isImmediate(src) && src->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
    16091588        ++vPC;
    16101589        NEXT_OPCODE;
     
    16181597        */
    16191598        int dst = (++vPC)->u.operand;
    1620         JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
    1621         JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
     1599        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1600        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    16221601        if (JSImmediate::areBothImmediateNumbers(src1, src2))
    1623             r[dst] = jsBoolean(src1 != src2);
     1602            callFrame[dst] = jsBoolean(src1 != src2);
    16241603        else {
    1625             JSValue* result = jsBoolean(!equalSlowCase(exec, src1, src2));
     1604            JSValue* result = jsBoolean(!equalSlowCase(callFrame, src1, src2));
    16261605            VM_CHECK_EXCEPTION();
    1627             r[dst] = result;
     1606            callFrame[dst] = result;
    16281607        }
    16291608
     
    16381617        */
    16391618        int dst = (++vPC)->u.operand;
    1640         JSValue* src = r[(++vPC)->u.operand].jsValue(exec);
     1619        JSValue* src = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    16411620
    16421621        if (src->isUndefinedOrNull()) {
    1643             r[dst] = jsBoolean(false);
     1622            callFrame[dst] = jsBoolean(false);
    16441623            ++vPC;
    16451624            NEXT_OPCODE;
    16461625        }
    16471626       
    1648         r[dst] = jsBoolean(JSImmediate::isImmediate(src) || !static_cast<JSCell*>(src)->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
     1627        callFrame[dst] = jsBoolean(JSImmediate::isImmediate(src) || !static_cast<JSCell*>(src)->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
    16491628        ++vPC;
    16501629        NEXT_OPCODE;
     
    16581637        */
    16591638        int dst = (++vPC)->u.operand;
    1660         JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
    1661         JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
     1639        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1640        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    16621641        if (JSImmediate::areBothImmediate(src1, src2))
    1663             r[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2));
     1642            callFrame[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2));
    16641643        else if (JSImmediate::isEitherImmediate(src1, src2) & (src1 != JSImmediate::zeroImmediate()) & (src2 != JSImmediate::zeroImmediate()))
    1665             r[dst] = jsBoolean(false);
     1644            callFrame[dst] = jsBoolean(false);
    16661645        else
    1667             r[dst] = jsBoolean(strictEqualSlowCase(src1, src2));
     1646            callFrame[dst] = jsBoolean(strictEqualSlowCase(src1, src2));
    16681647
    16691648        ++vPC;
     
    16781657        */
    16791658        int dst = (++vPC)->u.operand;
    1680         JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
    1681         JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
     1659        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1660        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    16821661
    16831662        if (JSImmediate::areBothImmediate(src1, src2))
    1684             r[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) != reinterpret_cast<intptr_t>(src2));
     1663            callFrame[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) != reinterpret_cast<intptr_t>(src2));
    16851664        else if (JSImmediate::isEitherImmediate(src1, src2) & (src1 != JSImmediate::zeroImmediate()) & (src2 != JSImmediate::zeroImmediate()))
    1686             r[dst] = jsBoolean(true);
     1665            callFrame[dst] = jsBoolean(true);
    16871666        else
    1688             r[dst] = jsBoolean(!strictEqualSlowCase(src1, src2));
     1667            callFrame[dst] = jsBoolean(!strictEqualSlowCase(src1, src2));
    16891668
    16901669        ++vPC;
     
    16991678        */
    17001679        int dst = (++vPC)->u.operand;
    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));
     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));
    17041683        VM_CHECK_EXCEPTION();
    1705         r[dst] = result;
     1684        callFrame[dst] = result;
    17061685
    17071686        ++vPC;
     
    17161695        */
    17171696        int dst = (++vPC)->u.operand;
    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));
     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));
    17211700        VM_CHECK_EXCEPTION();
    1722         r[dst] = result;
     1701        callFrame[dst] = result;
    17231702
    17241703        ++vPC;
     
    17321711        */
    17331712        int srcDst = (++vPC)->u.operand;
    1734         JSValue* v = r[srcDst].jsValue(exec);
     1713        JSValue* v = callFrame[srcDst].jsValue(callFrame);
    17351714        if (JSImmediate::canDoFastAdditiveOperations(v))
    1736             r[srcDst] = JSImmediate::incImmediateNumber(v);
     1715            callFrame[srcDst] = JSImmediate::incImmediateNumber(v);
    17371716        else {
    1738             JSValue* result = jsNumber(exec, v->toNumber(exec) + 1);
     1717            JSValue* result = jsNumber(callFrame, v->toNumber(callFrame) + 1);
    17391718            VM_CHECK_EXCEPTION();
    1740             r[srcDst] = result;
     1719            callFrame[srcDst] = result;
    17411720        }
    17421721
     
    17511730        */
    17521731        int srcDst = (++vPC)->u.operand;
    1753         JSValue* v = r[srcDst].jsValue(exec);
     1732        JSValue* v = callFrame[srcDst].jsValue(callFrame);
    17541733        if (JSImmediate::canDoFastAdditiveOperations(v))
    1755             r[srcDst] = JSImmediate::decImmediateNumber(v);
     1734            callFrame[srcDst] = JSImmediate::decImmediateNumber(v);
    17561735        else {
    1757             JSValue* result = jsNumber(exec, v->toNumber(exec) - 1);
     1736            JSValue* result = jsNumber(callFrame, v->toNumber(callFrame) - 1);
    17581737            VM_CHECK_EXCEPTION();
    1759             r[srcDst] = result;
     1738            callFrame[srcDst] = result;
    17601739        }
    17611740
     
    17721751        int dst = (++vPC)->u.operand;
    17731752        int srcDst = (++vPC)->u.operand;
    1774         JSValue* v = r[srcDst].jsValue(exec);
     1753        JSValue* v = callFrame[srcDst].jsValue(callFrame);
    17751754        if (JSImmediate::canDoFastAdditiveOperations(v)) {
    1776             r[dst] = v;
    1777             r[srcDst] = JSImmediate::incImmediateNumber(v);
     1755            callFrame[dst] = v;
     1756            callFrame[srcDst] = JSImmediate::incImmediateNumber(v);
    17781757        } else {
    1779             JSValue* number = r[srcDst].jsValue(exec)->toJSNumber(exec);
     1758            JSValue* number = callFrame[srcDst].jsValue(callFrame)->toJSNumber(callFrame);
    17801759            VM_CHECK_EXCEPTION();
    1781             r[dst] = number;
    1782             r[srcDst] = jsNumber(exec, number->uncheckedGetNumber() + 1);
     1760            callFrame[dst] = number;
     1761            callFrame[srcDst] = jsNumber(callFrame, number->uncheckedGetNumber() + 1);
    17831762        }
    17841763
     
    17951774        int dst = (++vPC)->u.operand;
    17961775        int srcDst = (++vPC)->u.operand;
    1797         JSValue* v = r[srcDst].jsValue(exec);
     1776        JSValue* v = callFrame[srcDst].jsValue(callFrame);
    17981777        if (JSImmediate::canDoFastAdditiveOperations(v)) {
    1799             r[dst] = v;
    1800             r[srcDst] = JSImmediate::decImmediateNumber(v);
     1778            callFrame[dst] = v;
     1779            callFrame[srcDst] = JSImmediate::decImmediateNumber(v);
    18011780        } else {
    1802             JSValue* number = r[srcDst].jsValue(exec)->toJSNumber(exec);
     1781            JSValue* number = callFrame[srcDst].jsValue(callFrame)->toJSNumber(callFrame);
    18031782            VM_CHECK_EXCEPTION();
    1804             r[dst] = number;
    1805             r[srcDst] = jsNumber(exec, number->uncheckedGetNumber() - 1);
     1783            callFrame[dst] = number;
     1784            callFrame[srcDst] = jsNumber(callFrame, number->uncheckedGetNumber() - 1);
    18061785        }
    18071786
     
    18181797        int src = (++vPC)->u.operand;
    18191798
    1820         JSValue* srcVal = r[src].jsValue(exec);
     1799        JSValue* srcVal = callFrame[src].jsValue(callFrame);
    18211800
    18221801        if (LIKELY(srcVal->isNumber()))
    1823             r[dst] = r[src];
     1802            callFrame[dst] = callFrame[src];
    18241803        else {
    1825             JSValue* result = srcVal->toJSNumber(exec);
     1804            JSValue* result = srcVal->toJSNumber(callFrame);
    18261805            VM_CHECK_EXCEPTION();
    1827             r[dst] = result;
     1806            callFrame[dst] = result;
    18281807        }
    18291808
     
    18381817        */
    18391818        int dst = (++vPC)->u.operand;
    1840         JSValue* src = r[(++vPC)->u.operand].jsValue(exec);
     1819        JSValue* src = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    18411820        double v;
    18421821        if (fastIsNumber(src, v))
    1843             r[dst] = jsNumber(exec, -v);
     1822            callFrame[dst] = jsNumber(callFrame, -v);
    18441823        else {
    1845             JSValue* result = jsNumber(exec, -src->toNumber(exec));
     1824            JSValue* result = jsNumber(callFrame, -src->toNumber(callFrame));
    18461825            VM_CHECK_EXCEPTION();
    1847             r[dst] = result;
     1826            callFrame[dst] = result;
    18481827        }
    18491828
     
    18591838        */
    18601839        int dst = (++vPC)->u.operand;
    1861         JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
    1862         JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
     1840        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1841        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    18631842        if (JSImmediate::canDoFastAdditiveOperations(src1) && JSImmediate::canDoFastAdditiveOperations(src2))
    1864             r[dst] = JSImmediate::addImmediateNumbers(src1, src2);
     1843            callFrame[dst] = JSImmediate::addImmediateNumbers(src1, src2);
    18651844        else {
    1866             JSValue* result = jsAdd(exec, src1, src2);
     1845            JSValue* result = jsAdd(callFrame, src1, src2);
    18671846            VM_CHECK_EXCEPTION();
    1868             r[dst] = result;
     1847            callFrame[dst] = result;
    18691848        }
    18701849        vPC += 2;
     
    18781857        */
    18791858        int dst = (++vPC)->u.operand;
    1880         JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
    1881         JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
     1859        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1860        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    18821861        double left;
    18831862        double right;
    18841863        if (fastIsNumber(src1, left) && fastIsNumber(src2, right))
    1885             r[dst] = jsNumber(exec, left * right);
     1864            callFrame[dst] = jsNumber(callFrame, left * right);
    18861865        else {
    1887             JSValue* result = jsNumber(exec, src1->toNumber(exec) * src2->toNumber(exec));
     1866            JSValue* result = jsNumber(callFrame, src1->toNumber(callFrame) * src2->toNumber(callFrame));
    18881867            VM_CHECK_EXCEPTION();
    1889             r[dst] = result;
     1868            callFrame[dst] = result;
    18901869        }
    18911870
     
    19011880        */
    19021881        int dst = (++vPC)->u.operand;
    1903         JSValue* dividend = r[(++vPC)->u.operand].jsValue(exec);
    1904         JSValue* divisor = r[(++vPC)->u.operand].jsValue(exec);
     1882        JSValue* dividend = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1883        JSValue* divisor = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    19051884        double left;
    19061885        double right;
    19071886        if (fastIsNumber(dividend, left) && fastIsNumber(divisor, right))
    1908             r[dst] = jsNumber(exec, left / right);
     1887            callFrame[dst] = jsNumber(callFrame, left / right);
    19091888        else {
    1910             JSValue* result = jsNumber(exec, dividend->toNumber(exec) / divisor->toNumber(exec));
     1889            JSValue* result = jsNumber(callFrame, dividend->toNumber(callFrame) / divisor->toNumber(callFrame));
    19111890            VM_CHECK_EXCEPTION();
    1912             r[dst] = result;
     1891            callFrame[dst] = result;
    19131892        }
    19141893        ++vPC;
     
    19261905        int divisor = (++vPC)->u.operand;
    19271906
    1928         JSValue* dividendValue = r[dividend].jsValue(exec);
    1929         JSValue* divisorValue = r[divisor].jsValue(exec);
     1907        JSValue* dividendValue = callFrame[dividend].jsValue(callFrame);
     1908        JSValue* divisorValue = callFrame[divisor].jsValue(callFrame);
    19301909
    19311910        if (JSImmediate::areBothImmediateNumbers(dividendValue, divisorValue) && divisorValue != JSImmediate::from(0)) {
    1932             r[dst] = JSImmediate::from(JSImmediate::getTruncatedInt32(dividendValue) % JSImmediate::getTruncatedInt32(divisorValue));
     1911            callFrame[dst] = JSImmediate::from(JSImmediate::getTruncatedInt32(dividendValue) % JSImmediate::getTruncatedInt32(divisorValue));
    19331912            ++vPC;
    19341913            NEXT_OPCODE;
    19351914        }
    19361915
    1937         double d = dividendValue->toNumber(exec);
    1938         JSValue* result = jsNumber(exec, fmod(d, divisorValue->toNumber(exec)));
     1916        double d = dividendValue->toNumber(callFrame);
     1917        JSValue* result = jsNumber(callFrame, fmod(d, divisorValue->toNumber(callFrame)));
    19391918        VM_CHECK_EXCEPTION();
    1940         r[dst] = result;
     1919        callFrame[dst] = result;
    19411920        ++vPC;
    19421921        NEXT_OPCODE;
     
    19501929        */
    19511930        int dst = (++vPC)->u.operand;
    1952         JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
    1953         JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
     1931        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1932        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    19541933        double left;
    19551934        double right;
    19561935        if (JSImmediate::canDoFastAdditiveOperations(src1) && JSImmediate::canDoFastAdditiveOperations(src2))
    1957             r[dst] = JSImmediate::subImmediateNumbers(src1, src2);
     1936            callFrame[dst] = JSImmediate::subImmediateNumbers(src1, src2);
    19581937        else if (fastIsNumber(src1, left) && fastIsNumber(src2, right))
    1959             r[dst] = jsNumber(exec, left - right);
     1938            callFrame[dst] = jsNumber(callFrame, left - right);
    19601939        else {
    1961             JSValue* result = jsNumber(exec, src1->toNumber(exec) - src2->toNumber(exec));
     1940            JSValue* result = jsNumber(callFrame, src1->toNumber(callFrame) - src2->toNumber(callFrame));
    19621941            VM_CHECK_EXCEPTION();
    1963             r[dst] = result;
     1942            callFrame[dst] = result;
    19641943        }
    19651944        vPC += 2;
     
    19741953        */
    19751954        int dst = (++vPC)->u.operand;
    1976         JSValue* val = r[(++vPC)->u.operand].jsValue(exec);
    1977         JSValue* shift = r[(++vPC)->u.operand].jsValue(exec);
     1955        JSValue* val = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1956        JSValue* shift = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    19781957        int32_t left;
    19791958        uint32_t right;
    19801959        if (JSImmediate::areBothImmediateNumbers(val, shift))
    1981             r[dst] = jsNumber(exec, JSImmediate::getTruncatedInt32(val) << (JSImmediate::getTruncatedUInt32(shift) & 0x1f));
     1960            callFrame[dst] = jsNumber(callFrame, JSImmediate::getTruncatedInt32(val) << (JSImmediate::getTruncatedUInt32(shift) & 0x1f));
    19821961        else if (fastToInt32(val, left) && fastToUInt32(shift, right))
    1983             r[dst] = jsNumber(exec, left << (right & 0x1f));
     1962            callFrame[dst] = jsNumber(callFrame, left << (right & 0x1f));
    19841963        else {
    1985             JSValue* result = jsNumber(exec, (val->toInt32(exec)) << (shift->toUInt32(exec) & 0x1f));
     1964            JSValue* result = jsNumber(callFrame, (val->toInt32(callFrame)) << (shift->toUInt32(callFrame) & 0x1f));
    19861965            VM_CHECK_EXCEPTION();
    1987             r[dst] = result;
     1966            callFrame[dst] = result;
    19881967        }
    19891968
     
    19991978        */
    20001979        int dst = (++vPC)->u.operand;
    2001         JSValue* val = r[(++vPC)->u.operand].jsValue(exec);
    2002         JSValue* shift = r[(++vPC)->u.operand].jsValue(exec);
     1980        JSValue* val = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     1981        JSValue* shift = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    20031982        int32_t left;
    20041983        uint32_t right;
    20051984        if (JSImmediate::areBothImmediateNumbers(val, shift))
    2006             r[dst] = JSImmediate::rightShiftImmediateNumbers(val, shift);
     1985            callFrame[dst] = JSImmediate::rightShiftImmediateNumbers(val, shift);
    20071986        else if (fastToInt32(val, left) && fastToUInt32(shift, right))
    2008             r[dst] = jsNumber(exec, left >> (right & 0x1f));
     1987            callFrame[dst] = jsNumber(callFrame, left >> (right & 0x1f));
    20091988        else {
    2010             JSValue* result = jsNumber(exec, (val->toInt32(exec)) >> (shift->toUInt32(exec) & 0x1f));
     1989            JSValue* result = jsNumber(callFrame, (val->toInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
    20111990            VM_CHECK_EXCEPTION();
    2012             r[dst] = result;
     1991            callFrame[dst] = result;
    20131992        }
    20141993
     
    20242003        */
    20252004        int dst = (++vPC)->u.operand;
    2026         JSValue* val = r[(++vPC)->u.operand].jsValue(exec);
    2027         JSValue* shift = r[(++vPC)->u.operand].jsValue(exec);
     2005        JSValue* val = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     2006        JSValue* shift = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    20282007        if (JSImmediate::areBothImmediateNumbers(val, shift) && !JSImmediate::isNegative(val))
    2029             r[dst] = JSImmediate::rightShiftImmediateNumbers(val, shift);
     2008            callFrame[dst] = JSImmediate::rightShiftImmediateNumbers(val, shift);
    20302009        else {
    2031             JSValue* result = jsNumber(exec, (val->toUInt32(exec)) >> (shift->toUInt32(exec) & 0x1f));
     2010            JSValue* result = jsNumber(callFrame, (val->toUInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
    20322011            VM_CHECK_EXCEPTION();
    2033             r[dst] = result;
     2012            callFrame[dst] = result;
    20342013        }
    20352014
     
    20452024        */
    20462025        int dst = (++vPC)->u.operand;
    2047         JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
    2048         JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
     2026        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     2027        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    20492028        int32_t left;
    20502029        int32_t right;
    20512030        if (JSImmediate::areBothImmediateNumbers(src1, src2))
    2052             r[dst] = JSImmediate::andImmediateNumbers(src1, src2);
     2031            callFrame[dst] = JSImmediate::andImmediateNumbers(src1, src2);
    20532032        else if (fastToInt32(src1, left) && fastToInt32(src2, right))
    2054             r[dst] = jsNumber(exec, left & right);
     2033            callFrame[dst] = jsNumber(callFrame, left & right);
    20552034        else {
    2056             JSValue* result = jsNumber(exec, src1->toInt32(exec) & src2->toInt32(exec));
     2035            JSValue* result = jsNumber(callFrame, src1->toInt32(callFrame) & src2->toInt32(callFrame));
    20572036            VM_CHECK_EXCEPTION();
    2058             r[dst] = result;
     2037            callFrame[dst] = result;
    20592038        }
    20602039
     
    20702049        */
    20712050        int dst = (++vPC)->u.operand;
    2072         JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
    2073         JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
     2051        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     2052        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    20742053        int32_t left;
    20752054        int32_t right;
    20762055        if (JSImmediate::areBothImmediateNumbers(src1, src2))
    2077             r[dst] = JSImmediate::xorImmediateNumbers(src1, src2);
     2056            callFrame[dst] = JSImmediate::xorImmediateNumbers(src1, src2);
    20782057        else if (fastToInt32(src1, left) && fastToInt32(src2, right))
    2079             r[dst] = jsNumber(exec, left ^ right);
     2058            callFrame[dst] = jsNumber(callFrame, left ^ right);
    20802059        else {
    2081             JSValue* result = jsNumber(exec, src1->toInt32(exec) ^ src2->toInt32(exec));
     2060            JSValue* result = jsNumber(callFrame, src1->toInt32(callFrame) ^ src2->toInt32(callFrame));
    20822061            VM_CHECK_EXCEPTION();
    2083             r[dst] = result;
     2062            callFrame[dst] = result;
    20842063        }
    20852064
     
    20952074        */
    20962075        int dst = (++vPC)->u.operand;
    2097         JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
    2098         JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
     2076        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     2077        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    20992078        int32_t left;
    21002079        int32_t right;
    21012080        if (JSImmediate::areBothImmediateNumbers(src1, src2))
    2102             r[dst] = JSImmediate::orImmediateNumbers(src1, src2);
     2081            callFrame[dst] = JSImmediate::orImmediateNumbers(src1, src2);
    21032082        else if (fastToInt32(src1, left) && fastToInt32(src2, right))
    2104             r[dst] = jsNumber(exec, left | right);
     2083            callFrame[dst] = jsNumber(callFrame, left | right);
    21052084        else {
    2106             JSValue* result = jsNumber(exec, src1->toInt32(exec) | src2->toInt32(exec));
     2085            JSValue* result = jsNumber(callFrame, src1->toInt32(callFrame) | src2->toInt32(callFrame));
    21072086            VM_CHECK_EXCEPTION();
    2108             r[dst] = result;
     2087            callFrame[dst] = result;
    21092088        }
    21102089
     
    21192098        */
    21202099        int dst = (++vPC)->u.operand;
    2121         JSValue* src = r[(++vPC)->u.operand].jsValue(exec);
     2100        JSValue* src = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    21222101        int32_t value;
    21232102        if (fastToInt32(src, value))
    2124             r[dst] = jsNumber(exec, ~value);
     2103            callFrame[dst] = jsNumber(callFrame, ~value);
    21252104        else {
    2126             JSValue* result = jsNumber(exec, ~src->toInt32(exec));
     2105            JSValue* result = jsNumber(callFrame, ~src->toInt32(callFrame));
    21272106            VM_CHECK_EXCEPTION();
    2128             r[dst] = result;
     2107            callFrame[dst] = result;
    21292108        }
    21302109        ++vPC;
     
    21392118        int dst = (++vPC)->u.operand;
    21402119        int src = (++vPC)->u.operand;
    2141         JSValue* result = jsBoolean(!r[src].jsValue(exec)->toBoolean(exec));
     2120        JSValue* result = jsBoolean(!callFrame[src].jsValue(callFrame)->toBoolean(callFrame));
    21422121        VM_CHECK_EXCEPTION();
    2143         r[dst] = result;
     2122        callFrame[dst] = result;
    21442123
    21452124        ++vPC;
     
    21642143        int baseProto = (++vPC)->u.operand;
    21652144
    2166         JSValue* baseVal = r[base].jsValue(exec);
    2167 
    2168         if (isNotObject(exec, true, codeBlock(r), vPC, baseVal, exceptionValue))
     2145        JSValue* baseVal = callFrame[base].jsValue(callFrame);
     2146
     2147        if (isNotObject(callFrame, true, callFrame->codeBlock(), vPC, baseVal, exceptionValue))
    21692148            goto vm_throw;
    21702149
    21712150        JSObject* baseObj = static_cast<JSObject*>(baseVal);
    2172         r[dst] = jsBoolean(baseObj->structureID()->typeInfo().implementsHasInstance() ? baseObj->hasInstance(exec, r[value].jsValue(exec), r[baseProto].jsValue(exec)) : false);
     2151        callFrame[dst] = jsBoolean(baseObj->structureID()->typeInfo().implementsHasInstance() ? baseObj->hasInstance(callFrame, callFrame[value].jsValue(callFrame), callFrame[baseProto].jsValue(callFrame)) : false);
    21732152
    21742153        ++vPC;
     
    21832162        int dst = (++vPC)->u.operand;
    21842163        int src = (++vPC)->u.operand;
    2185         r[dst] = jsTypeStringForValue(exec, r[src].jsValue(exec));
     2164        callFrame[dst] = jsTypeStringForValue(callFrame, callFrame[src].jsValue(callFrame));
    21862165
    21872166        ++vPC;
     
    21972176        int dst = (++vPC)->u.operand;
    21982177        int src = (++vPC)->u.operand;
    2199         JSValue* v = r[src].jsValue(exec);
    2200         r[dst] = jsBoolean(JSImmediate::isImmediate(v) ? v->isUndefined() : v->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
     2178        JSValue* v = callFrame[src].jsValue(callFrame);
     2179        callFrame[dst] = jsBoolean(JSImmediate::isImmediate(v) ? v->isUndefined() : v->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
    22012180
    22022181        ++vPC;
     
    22122191        int dst = (++vPC)->u.operand;
    22132192        int src = (++vPC)->u.operand;
    2214         r[dst] = jsBoolean(r[src].jsValue(exec)->isBoolean());
     2193        callFrame[dst] = jsBoolean(callFrame[src].jsValue(callFrame)->isBoolean());
    22152194
    22162195        ++vPC;
     
    22262205        int dst = (++vPC)->u.operand;
    22272206        int src = (++vPC)->u.operand;
    2228         r[dst] = jsBoolean(r[src].jsValue(exec)->isNumber());
     2207        callFrame[dst] = jsBoolean(callFrame[src].jsValue(callFrame)->isNumber());
    22292208
    22302209        ++vPC;
     
    22402219        int dst = (++vPC)->u.operand;
    22412220        int src = (++vPC)->u.operand;
    2242         r[dst] = jsBoolean(r[src].jsValue(exec)->isString());
     2221        callFrame[dst] = jsBoolean(callFrame[src].jsValue(callFrame)->isString());
    22432222
    22442223        ++vPC;
     
    22542233        int dst = (++vPC)->u.operand;
    22552234        int src = (++vPC)->u.operand;
    2256         r[dst] = jsBoolean(jsIsObjectType(r[src].jsValue(exec)));
     2235        callFrame[dst] = jsBoolean(jsIsObjectType(callFrame[src].jsValue(callFrame)));
    22572236
    22582237        ++vPC;
     
    22682247        int dst = (++vPC)->u.operand;
    22692248        int src = (++vPC)->u.operand;
    2270         r[dst] = jsBoolean(jsIsFunctionType(r[src].jsValue(exec)));
     2249        callFrame[dst] = jsBoolean(jsIsFunctionType(callFrame[src].jsValue(callFrame)));
    22712250
    22722251        ++vPC;
     
    22862265        int base = (++vPC)->u.operand;
    22872266
    2288         JSValue* baseVal = r[base].jsValue(exec);
    2289         if (isNotObject(exec, false, codeBlock(r), vPC, baseVal, exceptionValue))
     2267        JSValue* baseVal = callFrame[base].jsValue(callFrame);
     2268        if (isNotObject(callFrame, false, callFrame->codeBlock(), vPC, baseVal, exceptionValue))
    22902269            goto vm_throw;
    22912270
    22922271        JSObject* baseObj = static_cast<JSObject*>(baseVal);
    22932272
    2294         JSValue* propName = r[property].jsValue(exec);
     2273        JSValue* propName = callFrame[property].jsValue(callFrame);
    22952274
    22962275        uint32_t i;
    22972276        if (propName->getUInt32(i))
    2298             r[dst] = jsBoolean(baseObj->hasProperty(exec, i));
     2277            callFrame[dst] = jsBoolean(baseObj->hasProperty(callFrame, i));
    22992278        else {
    2300             Identifier property(exec, propName->toString(exec));
     2279            Identifier property(callFrame, propName->toString(callFrame));
    23012280            VM_CHECK_EXCEPTION();
    2302             r[dst] = jsBoolean(baseObj->hasProperty(exec, property));
     2281            callFrame[dst] = jsBoolean(baseObj->hasProperty(callFrame, property));
    23032282        }
    23042283
     
    23132292           dst. If the property is not found, raises an exception.
    23142293        */
    2315         if (UNLIKELY(!resolve(exec, vPC, r, exceptionValue)))
     2294        if (UNLIKELY(!resolve(callFrame, vPC, exceptionValue)))
    23162295            goto vm_throw;
    23172296
     
    23262305         value to register dst. If the property is not found, raises an exception.
    23272306         */
    2328         if (UNLIKELY(!resolveSkip(exec, vPC, r, exceptionValue)))
     2307        if (UNLIKELY(!resolveSkip(callFrame, vPC, exceptionValue)))
    23292308            goto vm_throw;
    23302309
     
    23412320           cache the new structureID and offset
    23422321         */
    2343         if (UNLIKELY(!resolveGlobal(exec, vPC, r, exceptionValue)))
     2322        if (UNLIKELY(!resolveGlobal(callFrame, vPC, exceptionValue)))
    23442323            goto vm_throw;
    23452324       
     
    23582337        int index = (++vPC)->u.operand;
    23592338
    2360         r[dst] = scope->registerAt(index);
     2339        callFrame[dst] = scope->registerAt(index);
    23612340        ++vPC;
    23622341        NEXT_OPCODE;
     
    23722351        int value = (++vPC)->u.operand;
    23732352       
    2374         scope->registerAt(index) = r[value].jsValue(exec);
     2353        scope->registerAt(index) = callFrame[value].jsValue(callFrame);
    23752354        ++vPC;
    23762355        NEXT_OPCODE;
     
    23842363        int dst = (++vPC)->u.operand;
    23852364        int index = (++vPC)->u.operand;
    2386         int skip = (++vPC)->u.operand + codeBlock(r)->needsFullScopeChain;
    2387 
    2388         ScopeChainNode* scopeChain = this->scopeChain(r);
     2365        int skip = (++vPC)->u.operand + callFrame->codeBlock()->needsFullScopeChain;
     2366
     2367        ScopeChainNode* scopeChain = callFrame->scopeChain();
    23892368        ScopeChainIterator iter = scopeChain->begin();
    23902369        ScopeChainIterator end = scopeChain->end();
     
    23972376        ASSERT((*iter)->isVariableObject());
    23982377        JSVariableObject* scope = static_cast<JSVariableObject*>(*iter);
    2399         r[dst] = scope->registerAt(index);
     2378        callFrame[dst] = scope->registerAt(index);
    24002379        ++vPC;
    24012380        NEXT_OPCODE;
     
    24062385         */
    24072386        int index = (++vPC)->u.operand;
    2408         int skip = (++vPC)->u.operand + codeBlock(r)->needsFullScopeChain;
     2387        int skip = (++vPC)->u.operand + callFrame->codeBlock()->needsFullScopeChain;
    24092388        int value = (++vPC)->u.operand;
    24102389
    2411         ScopeChainNode* scopeChain = this->scopeChain(r);
     2390        ScopeChainNode* scopeChain = callFrame->scopeChain();
    24122391        ScopeChainIterator iter = scopeChain->begin();
    24132392        ScopeChainIterator end = scopeChain->end();
     
    24202399        ASSERT((*iter)->isVariableObject());
    24212400        JSVariableObject* scope = static_cast<JSVariableObject*>(*iter);
    2422         scope->registerAt(index) = r[value].jsValue(exec);
     2401        scope->registerAt(index) = callFrame[value].jsValue(callFrame);
    24232402        ++vPC;
    24242403        NEXT_OPCODE;
     
    24322411           will be the global object) is stored in register dst.
    24332412        */
    2434         resolveBase(exec, vPC, r);
     2413        resolveBase(callFrame, vPC);
    24352414
    24362415        vPC += 3;
     
    24492428           avoids duplicate hash lookups.
    24502429        */
    2451         if (UNLIKELY(!resolveBaseAndProperty(exec, vPC, r, exceptionValue)))
     2430        if (UNLIKELY(!resolveBaseAndProperty(callFrame, vPC, exceptionValue)))
    24522431            goto vm_throw;
    24532432
     
    24702449           calls but not for other property lookup.
    24712450        */
    2472         if (UNLIKELY(!resolveBaseAndFunc(exec, vPC, r, exceptionValue)))
     2451        if (UNLIKELY(!resolveBaseAndFunc(callFrame, vPC, exceptionValue)))
    24732452            goto vm_throw;
    24742453
     
    24862465        int property = vPC[3].u.operand;
    24872466
    2488         CodeBlock* codeBlock = this->codeBlock(r);
     2467        CodeBlock* codeBlock = callFrame->codeBlock();
    24892468        Identifier& ident = codeBlock->identifiers[property];
    2490         JSValue* baseValue = r[base].jsValue(exec);
     2469        JSValue* baseValue = callFrame[base].jsValue(callFrame);
    24912470        PropertySlot slot(baseValue);
    2492         JSValue* result = baseValue->get(exec, ident, slot);
     2471        JSValue* result = baseValue->get(callFrame, ident, slot);
    24932472        VM_CHECK_EXCEPTION();
    24942473
    2495         tryCacheGetByID(exec, codeBlock, vPC, baseValue, ident, slot);
    2496 
    2497         r[dst] = result;
     2474        tryCacheGetByID(callFrame, codeBlock, vPC, baseValue, ident, slot);
     2475
     2476        callFrame[dst] = result;
    24982477        vPC += 8;
    24992478        NEXT_OPCODE;
     
    25072486        */
    25082487        int base = vPC[2].u.operand;
    2509         JSValue* baseValue = r[base].jsValue(exec);
     2488        JSValue* baseValue = callFrame[base].jsValue(callFrame);
    25102489
    25112490        if (LIKELY(!JSImmediate::isImmediate(baseValue))) {
     
    25192498                int offset = vPC[5].u.operand;
    25202499
    2521                 ASSERT(baseObject->get(exec, codeBlock(r)->identifiers[vPC[3].u.operand]) == baseObject->getDirectOffset(offset));
    2522                 r[dst] = baseObject->getDirectOffset(offset);
     2500                ASSERT(baseObject->get(callFrame, callFrame->codeBlock()->identifiers[vPC[3].u.operand]) == baseObject->getDirectOffset(offset));
     2501                callFrame[dst] = baseObject->getDirectOffset(offset);
    25232502
    25242503                vPC += 8;
     
    25272506        }
    25282507
    2529         uncacheGetByID(codeBlock(r), vPC);
     2508        uncacheGetByID(callFrame->codeBlock(), vPC);
    25302509        NEXT_OPCODE;
    25312510    }
     
    25382517        */
    25392518        int base = vPC[2].u.operand;
    2540         JSValue* baseValue = r[base].jsValue(exec);
     2519        JSValue* baseValue = callFrame[base].jsValue(callFrame);
    25412520
    25422521        if (LIKELY(!JSImmediate::isImmediate(baseValue))) {
     
    25452524
    25462525            if (LIKELY(baseCell->structureID() == structureID)) {
    2547                 ASSERT(structureID->prototypeForLookup(exec)->isObject());
    2548                 JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(exec));
     2526                ASSERT(structureID->prototypeForLookup(callFrame)->isObject());
     2527                JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(callFrame));
    25492528                StructureID* protoStructureID = vPC[5].u.structureID;
    25502529
     
    25532532                    int offset = vPC[6].u.operand;
    25542533
    2555                     ASSERT(protoObject->get(exec, codeBlock(r)->identifiers[vPC[3].u.operand]) == protoObject->getDirectOffset(offset));
    2556                     r[dst] = protoObject->getDirectOffset(offset);
     2534                    ASSERT(protoObject->get(callFrame, callFrame->codeBlock()->identifiers[vPC[3].u.operand]) == protoObject->getDirectOffset(offset));
     2535                    callFrame[dst] = protoObject->getDirectOffset(offset);
    25572536
    25582537                    vPC += 8;
     
    25622541        }
    25632542
    2564         uncacheGetByID(codeBlock(r), vPC);
     2543        uncacheGetByID(callFrame->codeBlock(), vPC);
    25652544        NEXT_OPCODE;
    25662545    }
     
    25732552        */
    25742553        int base = vPC[2].u.operand;
    2575         JSValue* baseValue = r[base].jsValue(exec);
     2554        JSValue* baseValue = callFrame[base].jsValue(callFrame);
    25762555
    25772556        if (LIKELY(!JSImmediate::isImmediate(baseValue))) {
     
    25862565                JSObject* baseObject = static_cast<JSObject*>(baseCell);
    25872566                while (1) {
    2588                     baseObject = static_cast<JSObject*>(baseObject->structureID()->prototypeForLookup(exec));
     2567                    baseObject = static_cast<JSObject*>(baseObject->structureID()->prototypeForLookup(callFrame));
    25892568                    if (UNLIKELY(baseObject->structureID() != (*it).get()))
    25902569                        break;
     
    25942573                        int offset = vPC[7].u.operand;
    25952574
    2596                         ASSERT(baseObject->get(exec, codeBlock(r)->identifiers[vPC[3].u.operand]) == baseObject->getDirectOffset(offset));
    2597                         r[dst] = baseObject->getDirectOffset(offset);
     2575                        ASSERT(baseObject->get(callFrame, callFrame->codeBlock()->identifiers[vPC[3].u.operand]) == baseObject->getDirectOffset(offset));
     2576                        callFrame[dst] = baseObject->getDirectOffset(offset);
    25982577
    25992578                        vPC += 8;
     
    26042583        }
    26052584
    2606         uncacheGetByID(codeBlock(r), vPC);
     2585        uncacheGetByID(callFrame->codeBlock(), vPC);
    26072586        NEXT_OPCODE;
    26082587    }
     
    26172596        int property = vPC[3].u.operand;
    26182597
    2619         Identifier& ident = codeBlock(r)->identifiers[property];
    2620         JSValue* baseValue = r[base].jsValue(exec);
     2598        Identifier& ident = callFrame->codeBlock()->identifiers[property];
     2599        JSValue* baseValue = callFrame[base].jsValue(callFrame);
    26212600        PropertySlot slot(baseValue);
    2622         JSValue* result = baseValue->get(exec, ident, slot);
     2601        JSValue* result = baseValue->get(callFrame, ident, slot);
    26232602        VM_CHECK_EXCEPTION();
    26242603
    2625         r[dst] = result;
     2604        callFrame[dst] = result;
    26262605        vPC += 8;
    26272606        NEXT_OPCODE;
     
    26362615
    26372616        int base = vPC[2].u.operand;
    2638         JSValue* baseValue = r[base].jsValue(exec);
     2617        JSValue* baseValue = callFrame[base].jsValue(callFrame);
    26392618        if (LIKELY(isJSArray(baseValue))) {
    26402619            int dst = vPC[1].u.operand;
    2641             r[dst] = jsNumber(exec, static_cast<JSArray*>(baseValue)->length());
     2620            callFrame[dst] = jsNumber(callFrame, static_cast<JSArray*>(baseValue)->length());
    26422621            vPC += 8;
    26432622            NEXT_OPCODE;
    26442623        }
    26452624
    2646         uncacheGetByID(codeBlock(r), vPC);
     2625        uncacheGetByID(callFrame->codeBlock(), vPC);
    26472626        NEXT_OPCODE;
    26482627    }
     
    26562635
    26572636        int base = vPC[2].u.operand;
    2658         JSValue* baseValue = r[base].jsValue(exec);
     2637        JSValue* baseValue = callFrame[base].jsValue(callFrame);
    26592638        if (LIKELY(isJSString(baseValue))) {
    26602639            int dst = vPC[1].u.operand;
    2661             r[dst] = jsNumber(exec, static_cast<JSString*>(baseValue)->value().size());
     2640            callFrame[dst] = jsNumber(callFrame, static_cast<JSString*>(baseValue)->value().size());
    26622641            vPC += 8;
    26632642            NEXT_OPCODE;
    26642643        }
    26652644
    2666         uncacheGetByID(codeBlock(r), vPC);
     2645        uncacheGetByID(callFrame->codeBlock(), vPC);
    26672646        NEXT_OPCODE;
    26682647    }
     
    26812660        int value = vPC[3].u.operand;
    26822661
    2683         CodeBlock* codeBlock = this->codeBlock(r);
    2684         JSValue* baseValue = r[base].jsValue(exec);
     2662        CodeBlock* codeBlock = callFrame->codeBlock();
     2663        JSValue* baseValue = callFrame[base].jsValue(callFrame);
    26852664        Identifier& ident = codeBlock->identifiers[property];
    26862665        PutPropertySlot slot;
    2687         baseValue->put(exec, ident, r[value].jsValue(exec), slot);
     2666        baseValue->put(callFrame, ident, callFrame[value].jsValue(callFrame), slot);
    26882667        VM_CHECK_EXCEPTION();
    26892668
    2690         tryCachePutByID(exec, codeBlock, vPC, baseValue, slot);
     2669        tryCachePutByID(callFrame, codeBlock, vPC, baseValue, slot);
    26912670
    26922671        vPC += 8;
     
    27052684         */
    27062685        int base = vPC[1].u.operand;
    2707         JSValue* baseValue = r[base].jsValue(exec);
     2686        JSValue* baseValue = callFrame[base].jsValue(callFrame);
    27082687       
    27092688        if (LIKELY(!JSImmediate::isImmediate(baseValue))) {
     
    27182697                RefPtr<StructureID>* it = vPC[6].u.structureIDChain->head();
    27192698
    2720                 JSObject* proto = static_cast<JSObject*>(baseObject->structureID()->prototypeForLookup(exec));
     2699                JSObject* proto = static_cast<JSObject*>(baseObject->structureID()->prototypeForLookup(callFrame));
    27212700                while (!proto->isNull()) {
    27222701                    if (UNLIKELY(proto->structureID() != (*it).get())) {
    2723                         uncachePutByID(codeBlock(r), vPC);
     2702                        uncachePutByID(callFrame->codeBlock(), vPC);
    27242703                        NEXT_OPCODE;
    27252704                    }
    27262705                    ++it;
    2727                     proto = static_cast<JSObject*>(proto->structureID()->prototypeForLookup(exec));
     2706                    proto = static_cast<JSObject*>(proto->structureID()->prototypeForLookup(callFrame));
    27282707                }
    27292708
     
    27322711                int value = vPC[3].u.operand;
    27332712                unsigned offset = vPC[7].u.operand;
    2734                 ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(codeBlock(r)->identifiers[vPC[2].u.operand])) == offset);
    2735                 baseObject->putDirectOffset(offset, r[value].jsValue(exec));
     2713                ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(callFrame->codeBlock()->identifiers[vPC[2].u.operand])) == offset);
     2714                baseObject->putDirectOffset(offset, callFrame[value].jsValue(callFrame));
    27362715
    27372716                vPC += 8;
     
    27402719        }
    27412720       
    2742         uncachePutByID(codeBlock(r), vPC);
     2721        uncachePutByID(callFrame->codeBlock(), vPC);
    27432722        NEXT_OPCODE;
    27442723    }
     
    27552734        */
    27562735        int base = vPC[1].u.operand;
    2757         JSValue* baseValue = r[base].jsValue(exec);
     2736        JSValue* baseValue = callFrame[base].jsValue(callFrame);
    27582737
    27592738        if (LIKELY(!JSImmediate::isImmediate(baseValue))) {
     
    27672746                unsigned offset = vPC[5].u.operand;
    27682747               
    2769                 ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(codeBlock(r)->identifiers[vPC[2].u.operand])) == offset);
    2770                 baseObject->putDirectOffset(offset, r[value].jsValue(exec));
     2748                ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(callFrame->codeBlock()->identifiers[vPC[2].u.operand])) == offset);
     2749                baseObject->putDirectOffset(offset, callFrame[value].jsValue(callFrame));
    27712750
    27722751                vPC += 8;
     
    27752754        }
    27762755
    2777         uncachePutByID(codeBlock(r), vPC);
     2756        uncachePutByID(callFrame->codeBlock(), vPC);
    27782757        NEXT_OPCODE;
    27792758    }
     
    27912770        int value = vPC[3].u.operand;
    27922771
    2793         JSValue* baseValue = r[base].jsValue(exec);
    2794         Identifier& ident = codeBlock(r)->identifiers[property];
     2772        JSValue* baseValue = callFrame[base].jsValue(callFrame);
     2773        Identifier& ident = callFrame->codeBlock()->identifiers[property];
    27952774        PutPropertySlot slot;
    2796         baseValue->put(exec, ident, r[value].jsValue(exec), slot);
     2775        baseValue->put(callFrame, ident, callFrame[value].jsValue(callFrame), slot);
    27972776        VM_CHECK_EXCEPTION();
    27982777
     
    28122791        int property = (++vPC)->u.operand;
    28132792
    2814         JSObject* baseObj = r[base].jsValue(exec)->toObject(exec);
    2815         Identifier& ident = codeBlock(r)->identifiers[property];
    2816         JSValue* result = jsBoolean(baseObj->deleteProperty(exec, ident));
     2793        JSObject* baseObj = callFrame[base].jsValue(callFrame)->toObject(callFrame);
     2794        Identifier& ident = callFrame->codeBlock()->identifiers[property];
     2795        JSValue* result = jsBoolean(baseObj->deleteProperty(callFrame, ident));
    28172796        VM_CHECK_EXCEPTION();
    2818         r[dst] = result;
     2797        callFrame[dst] = result;
    28192798        ++vPC;
    28202799        NEXT_OPCODE;
     
    28322811        int property = (++vPC)->u.operand;
    28332812       
    2834         JSValue* baseValue = r[base].jsValue(exec);
    2835         JSValue* subscript = r[property].jsValue(exec);
     2813        JSValue* baseValue = callFrame[base].jsValue(callFrame);
     2814        JSValue* subscript = callFrame[property].jsValue(callFrame);
    28362815
    28372816        JSValue* result;
     
    28452824                    result = jsArray->getIndex(i);
    28462825                else
    2847                     result = jsArray->JSArray::get(exec, i);
     2826                    result = jsArray->JSArray::get(callFrame, i);
    28482827            } else if (isJSString(baseValue) && static_cast<JSString*>(baseValue)->canGetIndex(i))
    2849                 result = static_cast<JSString*>(baseValue)->getIndex(&exec->globalData(), i);
     2828                result = static_cast<JSString*>(baseValue)->getIndex(&callFrame->globalData(), i);
    28502829            else
    2851                 result = baseValue->get(exec, i);
     2830                result = baseValue->get(callFrame, i);
    28522831        } else {
    2853             Identifier property(exec, subscript->toString(exec));
    2854             result = baseValue->get(exec, property);
     2832            Identifier property(callFrame, subscript->toString(callFrame));
     2833            result = baseValue->get(callFrame, property);
    28552834        }
    28562835
    28572836        VM_CHECK_EXCEPTION();
    2858         r[dst] = result;
     2837        callFrame[dst] = result;
    28592838        ++vPC;
    28602839        NEXT_OPCODE;
     
    28752854        int value = (++vPC)->u.operand;
    28762855
    2877         JSValue* baseValue = r[base].jsValue(exec);
    2878         JSValue* subscript = r[property].jsValue(exec);
     2856        JSValue* baseValue = callFrame[base].jsValue(callFrame);
     2857        JSValue* subscript = callFrame[property].jsValue(callFrame);
    28792858
    28802859        unsigned i;
     
    28852864                JSArray* jsArray = static_cast<JSArray*>(baseValue);
    28862865                if (jsArray->canSetIndex(i))
    2887                     jsArray->setIndex(i, r[value].jsValue(exec));
     2866                    jsArray->setIndex(i, callFrame[value].jsValue(callFrame));
    28882867                else
    2889                     jsArray->JSArray::put(exec, i, r[value].jsValue(exec));
     2868                    jsArray->JSArray::put(callFrame, i, callFrame[value].jsValue(callFrame));
    28902869            } else
    2891                 baseValue->put(exec, i, r[value].jsValue(exec));
     2870                baseValue->put(callFrame, i, callFrame[value].jsValue(callFrame));
    28922871        } else {
    2893             Identifier property(exec, subscript->toString(exec));
    2894             if (!exec->hadException()) { // Don't put to an object if toString threw an exception.
     2872            Identifier property(callFrame, subscript->toString(callFrame));
     2873            if (!globalData->exception) { // Don't put to an object if toString threw an exception.
    28952874                PutPropertySlot slot;
    2896                 baseValue->put(exec, property, r[value].jsValue(exec), slot);
     2875                baseValue->put(callFrame, property, callFrame[value].jsValue(callFrame), slot);
    28972876            }
    28982877        }
     
    29142893        int property = (++vPC)->u.operand;
    29152894
    2916         JSObject* baseObj = r[base].jsValue(exec)->toObject(exec); // may throw
    2917 
    2918         JSValue* subscript = r[property].jsValue(exec);
     2895        JSObject* baseObj = callFrame[base].jsValue(callFrame)->toObject(callFrame); // may throw
     2896
     2897        JSValue* subscript = callFrame[property].jsValue(callFrame);
    29192898        JSValue* result;
    29202899        uint32_t i;
    29212900        if (subscript->getUInt32(i))
    2922             result = jsBoolean(baseObj->deleteProperty(exec, i));
     2901            result = jsBoolean(baseObj->deleteProperty(callFrame, i));
    29232902        else {
    29242903            VM_CHECK_EXCEPTION();
    2925             Identifier property(exec, subscript->toString(exec));
     2904            Identifier property(callFrame, subscript->toString(callFrame));
    29262905            VM_CHECK_EXCEPTION();
    2927             result = jsBoolean(baseObj->deleteProperty(exec, property));
     2906            result = jsBoolean(baseObj->deleteProperty(callFrame, property));
    29282907        }
    29292908
    29302909        VM_CHECK_EXCEPTION();
    2931         r[dst] = result;
     2910        callFrame[dst] = result;
    29322911        ++vPC;
    29332912        NEXT_OPCODE;
     
    29492928        int value = (++vPC)->u.operand;
    29502929
    2951         r[base].jsValue(exec)->put(exec, property, r[value].jsValue(exec));
     2930        callFrame[base].jsValue(callFrame)->put(callFrame, property, callFrame[value].jsValue(callFrame));
    29522931
    29532932        ++vPC;
     
    29962975        int cond = (++vPC)->u.operand;
    29972976        int target = (++vPC)->u.operand;
    2998         if (r[cond].jsValue(exec)->toBoolean(exec)) {
     2977        if (callFrame[cond].jsValue(callFrame)->toBoolean(callFrame)) {
    29992978            vPC += target;
    30002979            CHECK_FOR_TIMEOUT();
     
    30132992        int cond = (++vPC)->u.operand;
    30142993        int target = (++vPC)->u.operand;
    3015         if (r[cond].jsValue(exec)->toBoolean(exec)) {
     2994        if (callFrame[cond].jsValue(callFrame)->toBoolean(callFrame)) {
    30162995            vPC += target;
    30172996            NEXT_OPCODE;
     
    30293008        int cond = (++vPC)->u.operand;
    30303009        int target = (++vPC)->u.operand;
    3031         if (!r[cond].jsValue(exec)->toBoolean(exec)) {
     3010        if (!callFrame[cond].jsValue(callFrame)->toBoolean(callFrame)) {
    30323011            vPC += target;
    30333012            NEXT_OPCODE;
     
    30483027           the JS timeout is reached.
    30493028         */
    3050         JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
    3051         JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
     3029        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     3030        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    30523031        int target = (++vPC)->u.operand;
    30533032       
    3054         bool result = jsLess(exec, src1, src2);
     3033        bool result = jsLess(callFrame, src1, src2);
    30553034        VM_CHECK_EXCEPTION();
    30563035       
     
    30753054           the JS timeout is reached.
    30763055        */
    3077         JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
    3078         JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
     3056        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     3057        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    30793058        int target = (++vPC)->u.operand;
    30803059       
    3081         bool result = jsLessEq(exec, src1, src2);
     3060        bool result = jsLessEq(callFrame, src1, src2);
    30823061        VM_CHECK_EXCEPTION();
    30833062       
     
    30993078           result of the comparison is false.
    31003079        */
    3101         JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
    3102         JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
     3080        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
     3081        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    31033082        int target = (++vPC)->u.operand;
    31043083
    3105         bool result = jsLess(exec, src1, src2);
     3084        bool result = jsLess(callFrame, src1, src2);
    31063085        VM_CHECK_EXCEPTION();
    31073086       
     
    31253104        int tableIndex = (++vPC)->u.operand;
    31263105        int defaultOffset = (++vPC)->u.operand;
    3127         JSValue* scrutinee = r[(++vPC)->u.operand].jsValue(exec);
     3106        JSValue* scrutinee = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    31283107        if (!JSImmediate::isNumber(scrutinee))
    31293108            vPC += defaultOffset;
    31303109        else {
    31313110            int32_t value = JSImmediate::getTruncatedInt32(scrutinee);
    3132             vPC += codeBlock(r)->immediateSwitchJumpTables[tableIndex].offsetForValue(value, defaultOffset);
     3111            vPC += callFrame->codeBlock()->immediateSwitchJumpTables[tableIndex].offsetForValue(value, defaultOffset);
    31333112        }
    31343113        NEXT_OPCODE;
     
    31453124        int tableIndex = (++vPC)->u.operand;
    31463125        int defaultOffset = (++vPC)->u.operand;
    3147         JSValue* scrutinee = r[(++vPC)->u.operand].jsValue(exec);
     3126        JSValue* scrutinee = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    31483127        if (!scrutinee->isString())
    31493128            vPC += defaultOffset;
     
    31533132                vPC += defaultOffset;
    31543133            else
    3155                 vPC += codeBlock(r)->characterSwitchJumpTables[tableIndex].offsetForValue(value->data()[0], defaultOffset);
     3134                vPC += callFrame->codeBlock()->characterSwitchJumpTables[tableIndex].offsetForValue(value->data()[0], defaultOffset);
    31563135        }
    31573136        NEXT_OPCODE;
     
    31683147        int tableIndex = (++vPC)->u.operand;
    31693148        int defaultOffset = (++vPC)->u.operand;
    3170         JSValue* scrutinee = r[(++vPC)->u.operand].jsValue(exec);
     3149        JSValue* scrutinee = callFrame[(++vPC)->u.operand].jsValue(callFrame);
    31713150        if (!scrutinee->isString())
    31723151            vPC += defaultOffset;
    31733152        else
    3174             vPC += codeBlock(r)->stringSwitchJumpTables[tableIndex].offsetForValue(static_cast<JSString*>(scrutinee)->value().rep(), defaultOffset);
     3153            vPC += callFrame->codeBlock()->stringSwitchJumpTables[tableIndex].offsetForValue(static_cast<JSString*>(scrutinee)->value().rep(), defaultOffset);
    31753154        NEXT_OPCODE;
    31763155    }
     
    31863165        int func = (++vPC)->u.operand;
    31873166
    3188         r[dst] = codeBlock(r)->functions[func]->makeFunction(exec, scopeChain(r));
     3167        callFrame[dst] = callFrame->codeBlock()->functions[func]->makeFunction(callFrame, callFrame->scopeChain());
    31893168
    31903169        ++vPC;
     
    32023181        int func = (++vPC)->u.operand;
    32033182
    3204         r[dst] = codeBlock(r)->functionExpressions[func]->makeFunction(exec, scopeChain(r));
     3183        callFrame[dst] = callFrame->codeBlock()->functionExpressions[func]->makeFunction(callFrame, callFrame->scopeChain());
    32053184
    32063185        ++vPC;
     
    32263205        ++vPC; // registerOffset
    32273206
    3228         JSValue* funcVal = r[func].jsValue(exec);
    3229         JSValue* baseVal = r[thisVal].jsValue(exec);
    3230 
    3231         ScopeChainNode* scopeChain = this->scopeChain(r);
     3207        JSValue* funcVal = callFrame[func].jsValue(callFrame);
     3208        JSValue* baseVal = callFrame[thisVal].jsValue(callFrame);
     3209
     3210        ScopeChainNode* scopeChain = callFrame->scopeChain();
    32323211        if (baseVal == scopeChain->globalObject() && funcVal == scopeChain->globalObject()->evalFunction()) {
    3233             JSObject* thisObject = static_cast<JSObject*>(r[codeBlock(r)->thisRegister].jsValue(exec));
    3234             JSValue* result = callEval(exec, thisObject, scopeChain, registerFile, r, firstArg, argCount, exceptionValue);
     3212            JSObject* thisObject = static_cast<JSObject*>(callFrame[callFrame->codeBlock()->thisRegister].jsValue(callFrame));
     3213            JSValue* result = callEval(callFrame, thisObject, scopeChain, registerFile, firstArg, argCount, exceptionValue);
    32353214            if (exceptionValue)
    32363215                goto vm_throw;
    32373216
    3238             r[dst] = result;
     3217            callFrame[dst] = result;
    32393218
    32403219            ++vPC;
     
    32463225        // value.
    32473226        vPC -= 6;
    3248         r[thisVal] = baseVal->toThisObject(exec);
     3227        callFrame[thisVal] = baseVal->toThisObject(callFrame);
    32493228
    32503229#if HAVE(COMPUTED_GOTO)
     
    33003279        int registerOffset = (++vPC)->u.operand;
    33013280
    3302         JSValue* v = r[func].jsValue(exec);
     3281        JSValue* v = callFrame[func].jsValue(callFrame);
    33033282
    33043283        CallData callData;
     
    33103289            CodeBlock* newCodeBlock = &functionBodyNode->byteCode(callDataScopeChain);
    33113290
    3312             r[firstArg] = thisVal == missingThisObjectMarker() ? exec->globalThisValue() : r[thisVal].jsValue(exec);
     3291            callFrame[firstArg] = thisVal == missingThisObjectMarker() ? callFrame->globalThisValue() : callFrame[thisVal].jsValue(callFrame);
    33133292           
    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));
     3293            CallFrame* previousCallFrame = callFrame;
     3294
     3295            callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount);
     3296            if (UNLIKELY(!callFrame)) {
     3297                callFrame = previousCallFrame;
     3298                exceptionValue = createStackOverflowError(callFrame);
    33203299                goto vm_throw;
    33213300            }
    33223301
    3323             initializeCallFrame(r, newCodeBlock, vPC + 1, callDataScopeChain, savedR, dst, argCount, v);
     3302            callFrame->init(newCodeBlock, vPC + 1, callDataScopeChain, previousCallFrame, dst, argCount, static_cast<JSFunction*>(v));
    33243303   
    33253304            if (*enabledProfilerReference)
    3326                 (*enabledProfilerReference)->willExecute(exec, static_cast<JSObject*>(v));
     3305                (*enabledProfilerReference)->willExecute(callFrame, static_cast<JSObject*>(v));
    33273306
    33283307            vPC = newCodeBlock->instructions.begin();
     
    33363315
    33373316        if (callType == CallTypeHost) {
    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);
     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));
    33443323
    33453324            if (*enabledProfilerReference)
    3346                 (*enabledProfilerReference)->willExecute(callFrame, static_cast<JSObject*>(v));
     3325                (*enabledProfilerReference)->willExecute(newCallFrame, static_cast<JSFunction*>(v));
    33473326
    33483327            MACHINE_SAMPLING_callingHostFunction();
    33493328
    3350             JSValue* returnValue = callData.native.function(callFrame, static_cast<JSObject*>(v), thisValue, args);
     3329            JSValue* returnValue = callData.native.function(newCallFrame, static_cast<JSFunction*>(v), thisValue, args);
    33513330            VM_CHECK_EXCEPTION();
    33523331
    3353             r[dst] = returnValue;
     3332            newCallFrame[dst] = returnValue;
    33543333
    33553334            if (*enabledProfilerReference)
    3356                 (*enabledProfilerReference)->didExecute(CallFrame::create(r), static_cast<JSObject*>(v));
     3335                (*enabledProfilerReference)->didExecute(callFrame, static_cast<JSFunction*>(v));
    33573336
    33583337            ++vPC;
     
    33623341        ASSERT(callType == CallTypeNone);
    33633342
    3364         exceptionValue = createNotAFunctionError(exec, v, vPC, codeBlock(r));
     3343        exceptionValue = createNotAFunctionError(callFrame, v, vPC, callFrame->codeBlock());
    33653344        goto vm_throw;
    33663345    }
    33673346    BEGIN_OPCODE(op_tear_off_activation) {
    33683347        int src = (++vPC)->u.operand;
    3369         JSActivation* activation = static_cast<JSActivation*>(r[src].getJSValue());
    3370         ASSERT(codeBlock(r)->needsFullScopeChain);
     3348        ASSERT(callFrame->codeBlock()->needsFullScopeChain);
     3349        JSActivation* activation = static_cast<JSActivation*>(callFrame[src].getJSValue());
    33713350        ASSERT(activation->isObject(&JSActivation::info));
    33723351
    3373         Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue());
    3374         ASSERT(!arguments || arguments->isObject(&Arguments::info));
    3375         activation->copyRegisters(arguments);
     3352        activation->copyRegisters(callFrame->optionalCalleeArguments());
    33763353
    33773354        ++vPC;
     
    33793356    }
    33803357    BEGIN_OPCODE(op_tear_off_arguments) {
    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();
     3358        ASSERT(callFrame->codeBlock()->usesArguments && !callFrame->codeBlock()->needsFullScopeChain);
     3359
     3360        callFrame->optionalCalleeArguments()->copyRegisters();
    33863361
    33873362        ++vPC;
     
    34013376
    34023377        if (*enabledProfilerReference)
    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();
     3378            (*enabledProfilerReference)->didExecute(callFrame, callFrame->callee());
     3379
     3380        if (callFrame->codeBlock()->needsFullScopeChain)
     3381            callFrame->scopeChain()->deref();
     3382
     3383        JSValue* returnValue = callFrame[result].jsValue(callFrame);
     3384
     3385        vPC = callFrame->returnPC();
     3386        int dst = callFrame->returnValueRegister();
     3387        callFrame = callFrame->callerFrame();
    34133388       
    3414         if (isHostCallFrame(r))
     3389        if (callFrame->hasHostCallFrameFlag())
    34153390            return returnValue;
    34163391
    3417         r[dst] = returnValue;
     3392        callFrame[dst] = returnValue;
    34183393
    34193394        NEXT_OPCODE;
     
    34313406
    34323407        size_t i = 0;
    3433         CodeBlock* codeBlock = this->codeBlock(r);
     3408        CodeBlock* codeBlock = callFrame->codeBlock();
    34343409       
    34353410        for (size_t count = codeBlock->numVars; i < count; ++i)
    3436             r[i] = jsUndefined();
     3411            callFrame[i] = jsUndefined();
    34373412
    34383413        for (size_t count = codeBlock->constantRegisters.size(), j = 0; j < count; ++i, ++j)
    3439             r[i] = codeBlock->constantRegisters[j];
     3414            callFrame[i] = codeBlock->constantRegisters[j];
    34403415
    34413416        ++vPC;
     
    34563431
    34573432        size_t i = 0;
    3458         CodeBlock* codeBlock = this->codeBlock(r);
     3433        CodeBlock* codeBlock = callFrame->codeBlock();
    34593434
    34603435        for (size_t count = codeBlock->numVars; i < count; ++i)
    3461             r[i] = jsUndefined();
     3436            callFrame[i] = jsUndefined();
    34623437
    34633438        for (size_t count = codeBlock->constantRegisters.size(), j = 0; j < count; ++i, ++j)
    3464             r[i] = codeBlock->constantRegisters[j];
     3439            callFrame[i] = codeBlock->constantRegisters[j];
    34653440
    34663441        int dst = (++vPC)->u.operand;
    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);
     3442        JSActivation* activation = new (globalData) JSActivation(callFrame, static_cast<FunctionBodyNode*>(codeBlock->ownerNode));
     3443        callFrame[dst] = activation;
     3444        callFrame->setScopeChain(callFrame->scopeChain()->copy()->push(activation));
    34703445
    34713446        ++vPC;
     
    34743449    BEGIN_OPCODE(op_convert_this) {
    34753450        int thisRegister = (++vPC)->u.operand;
    3476         JSValue* thisVal = r[thisRegister].getJSValue();
     3451        JSValue* thisVal = callFrame[thisRegister].getJSValue();
    34773452        if (thisVal->needsThisConversion())
    3478             r[thisRegister] = thisVal->toThisObject(exec);
     3453            callFrame[thisRegister] = thisVal->toThisObject(callFrame);
    34793454
    34803455        ++vPC;
     
    34923467        */
    34933468
    3494         Arguments* arguments = new (globalData) Arguments(exec, r);
    3495         r[RegisterFile::OptionalCalleeArguments] = arguments;
    3496         r[RegisterFile::ArgumentsRegister] = arguments;
     3469        Arguments* arguments = new (globalData) Arguments(callFrame);
     3470        callFrame->setCalleeArguments(arguments);
     3471        callFrame[RegisterFile::ArgumentsRegister] = arguments;
    34973472       
    34983473        ++vPC;
     
    35213496        int registerOffset = (++vPC)->u.operand;
    35223497
    3523         JSValue* v = r[constr].jsValue(exec);
     3498        JSValue* v = callFrame[constr].jsValue(callFrame);
    35243499
    35253500        ConstructData constructData;
     
    35283503        if (constructType == ConstructTypeJS) {
    35293504            if (*enabledProfilerReference)
    3530                 (*enabledProfilerReference)->willExecute(exec, static_cast<JSObject*>(v));
     3505                (*enabledProfilerReference)->willExecute(callFrame, static_cast<JSObject*>(v));
    35313506
    35323507            ScopeChainNode* callDataScopeChain = constructData.js.scopeChain;
     
    35353510
    35363511            StructureID* structure;
    3537             JSValue* prototype = r[constrProto].jsValue(exec);
     3512            JSValue* prototype = callFrame[constrProto].jsValue(callFrame);
    35383513            if (prototype->isObject())
    35393514                structure = static_cast<JSObject*>(prototype)->inheritorID();
     
    35423517            JSObject* newObject = new (globalData) JSObject(structure);
    35433518
    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));
     3519            callFrame[firstArg] = newObject; // "this" value
     3520
     3521            CallFrame* previousCallFrame = callFrame;
     3522
     3523            callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount);
     3524            if (UNLIKELY(!callFrame)) {
     3525                callFrame = previousCallFrame;
     3526                exceptionValue = createStackOverflowError(callFrame);
    35523527                goto vm_throw;
    35533528            }
    35543529
    3555             initializeCallFrame(r, newCodeBlock, vPC + 1, callDataScopeChain, savedR, dst, argCount, v);
     3530            callFrame->init(newCodeBlock, vPC + 1, callDataScopeChain, previousCallFrame, dst, argCount, static_cast<JSFunction*>(v));
    35563531   
    35573532            if (*enabledProfilerReference)
    3558                 (*enabledProfilerReference)->didExecute(exec, static_cast<JSObject*>(v));
     3533                (*enabledProfilerReference)->didExecute(callFrame, static_cast<JSObject*>(v));
    35593534
    35603535            vPC = newCodeBlock->instructions.begin();
     
    35683543
    35693544        if (constructType == ConstructTypeHost) {
    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;
     3545            ArgList args(callFrame->registers() + firstArg + 1, argCount - 1);
     3546
     3547            ScopeChainNode* scopeChain = callFrame->scopeChain();
     3548            CallFrame::create(callFrame->registers() + registerOffset)->init(0, vPC + 1, scopeChain, callFrame, dst, argCount, static_cast<JSFunction*>(v));
     3549            callFrame = CallFrame::create(callFrame->registers() + registerOffset);
    35753550
    35763551            if (*enabledProfilerReference)
    3577                 (*enabledProfilerReference)->willExecute(exec, static_cast<JSObject*>(v));
     3552                (*enabledProfilerReference)->willExecute(callFrame, static_cast<JSObject*>(v));
    35783553
    35793554            MACHINE_SAMPLING_callingHostFunction();
    35803555
    3581             JSValue* returnValue = constructData.native.function(exec, static_cast<JSObject*>(v), args);
    3582             r -= registerOffset;
     3556            JSValue* returnValue = constructData.native.function(callFrame, static_cast<JSObject*>(v), args);
     3557            callFrame = CallFrame::create(callFrame->registers() - registerOffset);
    35833558
    35843559            VM_CHECK_EXCEPTION();
    3585             r[dst] = returnValue;
     3560            callFrame[dst] = returnValue;
    35863561
    35873562            if (*enabledProfilerReference)
    3588                 (*enabledProfilerReference)->didExecute(exec, static_cast<JSObject*>(v));
     3563                (*enabledProfilerReference)->didExecute(callFrame, static_cast<JSObject*>(v));
    35893564
    35903565            ++vPC;
     
    35943569        ASSERT(constructType == ConstructTypeNone);
    35953570
    3596         exceptionValue = createNotAConstructorError(exec, v, vPC, codeBlock(r));
     3571        exceptionValue = createNotAConstructorError(callFrame, v, vPC, callFrame->codeBlock());
    35973572        goto vm_throw;
    35983573    }
     
    36053580
    36063581        int dst = vPC[1].u.operand;;
    3607         if (LIKELY(r[dst].jsValue(exec)->isObject())) {
     3582        if (LIKELY(callFrame[dst].jsValue(callFrame)->isObject())) {
    36083583            vPC += 3;
    36093584            NEXT_OPCODE;
     
    36113586
    36123587        int override = vPC[2].u.operand;
    3613         r[dst] = r[override];
     3588        callFrame[dst] = callFrame[override];
    36143589
    36153590        vPC += 3;
     
    36233598        */
    36243599        int scope = (++vPC)->u.operand;
    3625         JSValue* v = r[scope].jsValue(exec);
    3626         JSObject* o = v->toObject(exec);
     3600        JSValue* v = callFrame[scope].jsValue(callFrame);
     3601        JSObject* o = v->toObject(callFrame);
    36273602        VM_CHECK_EXCEPTION();
    36283603
    3629         r[RegisterFile::ScopeChain] = scopeChain(r)->push(o);
     3604        callFrame->setScopeChain(callFrame->scopeChain()->push(o));
    36303605
    36313606        ++vPC;
     
    36373612           Removes the top item from the current scope chain.
    36383613        */
    3639         r[RegisterFile::ScopeChain] = scopeChain(r)->pop();
     3614        callFrame->setScopeChain(callFrame->scopeChain()->pop());
    36403615
    36413616        ++vPC;
     
    36533628        int base = (++vPC)->u.operand;
    36543629
    3655         r[dst] = JSPropertyNameIterator::create(exec, r[base].jsValue(exec));
     3630        callFrame[dst] = JSPropertyNameIterator::create(callFrame, callFrame[base].jsValue(callFrame));
    36563631        ++vPC;
    36573632        NEXT_OPCODE;
     
    36703645        int target = (++vPC)->u.operand;
    36713646
    3672         JSPropertyNameIterator* it = r[iter].jsPropertyNameIterator();
    3673         if (JSValue* temp = it->next(exec)) {
     3647        JSPropertyNameIterator* it = callFrame[iter].propertyNameIterator();
     3648        if (JSValue* temp = it->next(callFrame)) {
    36743649            CHECK_FOR_TIMEOUT();
    3675             r[dst] = temp;
     3650            callFrame[dst] = temp;
    36763651            vPC += target;
    36773652            NEXT_OPCODE;
     
    36923667        int target = (++vPC)->u.operand;
    36933668
    3694         ScopeChainNode* tmp = scopeChain(r);
     3669        ScopeChainNode* tmp = callFrame->scopeChain();
    36953670        while (count--)
    36963671            tmp = tmp->pop();
    3697         r[RegisterFile::ScopeChain] = tmp;
     3672        callFrame->setScopeChain(tmp);
    36983673
    36993674        vPC += target;
     
    37113686           in dst for GC.
    37123687         */
    3713         r[RegisterFile::ScopeChain] = createExceptionScope(exec, vPC, r);
     3688        callFrame->setScopeChain(createExceptionScope(callFrame, vPC));
    37143689
    37153690        vPC += 4;
     
    37273702        */
    37283703        ASSERT(exceptionValue);
    3729         ASSERT(!exec->hadException());
     3704        ASSERT(!globalData->exception);
    37303705        int ex = (++vPC)->u.operand;
    3731         r[ex] = exceptionValue;
     3706        callFrame[ex] = exceptionValue;
    37323707        exceptionValue = 0;
    37333708
     
    37473722
    37483723        int ex = (++vPC)->u.operand;
    3749         exceptionValue = r[ex].jsValue(exec);
    3750 
    3751         handlerVPC = throwException(exec, exceptionValue, vPC, r, true);
     3724        exceptionValue = callFrame[ex].jsValue(callFrame);
     3725
     3726        handlerVPC = throwException(callFrame, exceptionValue, vPC, true);
    37523727        if (!handlerVPC) {
    37533728            *exception = exceptionValue;
     
    37743749        int dst = (++vPC)->u.operand;
    37753750        int src = (++vPC)->u.operand;
    3776         r[dst] = codeBlock(r)->unexpectedConstants[src];
     3751        callFrame[dst] = callFrame->codeBlock()->unexpectedConstants[src];
    37773752
    37783753        ++vPC;
     
    37913766        int message = (++vPC)->u.operand;
    37923767
    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());
     3768        CodeBlock* codeBlock = callFrame->codeBlock();
     3769        callFrame[dst] = Error::create(callFrame, (ErrorType)type, codeBlock->unexpectedConstants[message]->toString(callFrame), codeBlock->lineNumberForVPC(vPC), codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL());
    37953770
    37963771        ++vPC;
     
    38043779        */
    38053780
    3806         if (codeBlock(r)->needsFullScopeChain) {
    3807             ScopeChainNode* scopeChain = this->scopeChain(r);
     3781        if (callFrame->codeBlock()->needsFullScopeChain) {
     3782            ScopeChainNode* scopeChain = callFrame->scopeChain();
    38083783            ASSERT(scopeChain->refCount > 1);
    38093784            scopeChain->deref();
    38103785        }
    38113786        int result = (++vPC)->u.operand;
    3812         return r[result].jsValue(exec);
     3787        return callFrame[result].jsValue(callFrame);
    38133788    }
    38143789    BEGIN_OPCODE(op_put_getter) {
     
    38273802        int function = (++vPC)->u.operand;
    38283803
    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)));
     3804        ASSERT(callFrame[base].jsValue(callFrame)->isObject());
     3805        JSObject* baseObj = static_cast<JSObject*>(callFrame[base].jsValue(callFrame));
     3806        Identifier& ident = callFrame->codeBlock()->identifiers[property];
     3807        ASSERT(callFrame[function].jsValue(callFrame)->isObject());
     3808        baseObj->defineGetter(callFrame, ident, static_cast<JSObject*>(callFrame[function].jsValue(callFrame)));
    38343809
    38353810        ++vPC;
     
    38513826        int function = (++vPC)->u.operand;
    38523827
    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)));
     3828        ASSERT(callFrame[base].jsValue(callFrame)->isObject());
     3829        JSObject* baseObj = static_cast<JSObject*>(callFrame[base].jsValue(callFrame));
     3830        Identifier& ident = callFrame->codeBlock()->identifiers[property];
     3831        ASSERT(callFrame[function].jsValue(callFrame)->isObject());
     3832        baseObj->defineSetter(callFrame, ident, static_cast<JSObject*>(callFrame[function].jsValue(callFrame)));
    38583833
    38593834        ++vPC;
     
    38683843        int retAddrDst = (++vPC)->u.operand;
    38693844        int target = (++vPC)->u.operand;
    3870         r[retAddrDst] = vPC + 1;
     3845        callFrame[retAddrDst] = vPC + 1;
    38713846
    38723847        vPC += target;
     
    38813856        */
    38823857        int retAddrSrc = (++vPC)->u.operand;
    3883         vPC = r[retAddrSrc].vPC();
     3858        vPC = callFrame[retAddrSrc].vPC();
    38843859        NEXT_OPCODE;
    38853860    }
     
    38943869        int lastLine = (++vPC)->u.operand;
    38953870
    3896         debug(exec, r, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
     3871        debug(callFrame, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
    38973872
    38983873        ++vPC;
     
    39063881            exceptionValue = createInterruptedExecutionException(globalData);
    39073882        }
    3908         handlerVPC = throwException(exec, exceptionValue, vPC, r, false);
     3883        handlerVPC = throwException(callFrame, exceptionValue, vPC, false);
    39093884        if (!handlerVPC) {
    39103885            *exception = exceptionValue;
     
    39223897    #undef VM_CHECK_EXCEPTION
    39233898    #undef CHECK_FOR_TIMEOUT
    3924     #undef exec
    3925 }
    3926 
    3927 JSValue* Machine::retrieveArguments(ExecState* exec, JSFunction* function) const
    3928 {
    3929     Register* r = this->callFrame(exec, function);
    3930     if (!r)
     3899}
     3900
     3901JSValue* Machine::retrieveArguments(CallFrame* callFrame, JSFunction* function) const
     3902{
     3903    CallFrame* functionCallFrame = findFunctionCallFrame(callFrame, function);
     3904    if (!functionCallFrame)
    39313905        return jsNull();
    39323906
    3933     CodeBlock* codeBlock = Machine::codeBlock(r);
     3907    CodeBlock* codeBlock = functionCallFrame->codeBlock();
    39343908    if (codeBlock->usesArguments) {
    39353909        ASSERT(codeBlock->codeType == FunctionCode);
    39363910        SymbolTable& symbolTable = static_cast<FunctionBodyNode*>(codeBlock->ownerNode)->symbolTable();
    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());
     3911        int argumentsIndex = symbolTable.get(functionCallFrame->propertyNames().arguments.ustring().rep()).getIndex();
     3912        return functionCallFrame[argumentsIndex].jsValue(callFrame);
     3913    }
     3914
     3915    Arguments* arguments = functionCallFrame->optionalCalleeArguments();
    39423916    if (!arguments) {
    3943         arguments = new (exec) Arguments(exec, r);
     3917        arguments = new (functionCallFrame) Arguments(functionCallFrame);
    39443918        arguments->copyRegisters();
    3945         r[RegisterFile::OptionalCalleeArguments] = arguments;
    3946     }
    3947     ASSERT(arguments->isObject(&Arguments::info));
     3919        callFrame->setCalleeArguments(arguments);
     3920    }
    39483921
    39493922    return arguments;
    39503923}
    39513924
    3952 JSValue* Machine::retrieveCaller(ExecState* exec, InternalFunction* function) const
    3953 {
    3954     Register* r = this->callFrame(exec, function);
    3955     if (!r)
     3925JSValue* Machine::retrieveCaller(CallFrame* callFrame, InternalFunction* function) const
     3926{
     3927    CallFrame* functionCallFrame = findFunctionCallFrame(callFrame, function);
     3928    if (!functionCallFrame)
    39563929        return jsNull();
    39573930
    3958     Register* callerR = r[RegisterFile::CallerRegisters].r();
    3959     if (isHostCallFrame(callerR))
     3931    CallFrame* callerFrame = functionCallFrame->callerFrame();
     3932    if (callerFrame->hasHostCallFrameFlag())
    39603933        return jsNull();
    39613934
    3962     JSValue* caller = callerR[RegisterFile::Callee].jsValue(exec);
     3935    JSValue* caller = callerFrame->callee();
    39633936    if (!caller)
    39643937        return jsNull();
     
    39673940}
    39683941
    3969 void Machine::retrieveLastCaller(ExecState* exec, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const
     3942void Machine::retrieveLastCaller(CallFrame* callFrame, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const
    39703943{
    39713944    function = 0;
     
    39733946    sourceURL = UString();
    39743947
    3975     Register* r = exec->registers();
    3976     Register* callerR = r[RegisterFile::CallerRegisters].r();
    3977     if (isHostCallFrame(callerR))
     3948    CallFrame* callerFrame = callFrame->callerFrame();
     3949    if (callerFrame->hasHostCallFrameFlag())
    39783950        return;
    39793951
    3980     CodeBlock* callerCodeBlock = codeBlock(callerR);
     3952    CodeBlock* callerCodeBlock = callerFrame->codeBlock();
    39813953    if (!callerCodeBlock)
    39823954        return;
    39833955
    3984     Instruction* vPC = vPCForPC(callerCodeBlock, r[RegisterFile::ReturnPC].v());
     3956    Instruction* vPC = vPCForPC(callerCodeBlock, callFrame->returnPC());
    39853957    lineNumber = callerCodeBlock->lineNumberForVPC(vPC - 1);
    39863958    sourceID = callerCodeBlock->ownerNode->sourceID();
    39873959    sourceURL = callerCodeBlock->ownerNode->sourceURL();
    3988 
    3989     JSValue* caller = callerR[RegisterFile::Callee].getJSValue();
    3990     if (!caller)
    3991         return;
    3992 
    3993     function = caller;
    3994 }
    3995 
    3996 Register* 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;
     3960    function = callerFrame->callee();
     3961}
     3962
     3963CallFrame* Machine::findFunctionCallFrame(CallFrame* callFrame, InternalFunction* function)
     3964{
     3965    for (CallFrame* candidate = callFrame; candidate; candidate = candidate->callerFrame()->removeHostCallFrameFlag()) {
     3966        if (candidate->callee() == function)
     3967            return candidate;
     3968    }
    40013969    return 0;
    40023970}
    40033971
    4004 void 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));
     3972void Machine::getArgumentsData(CallFrame* callFrame, JSFunction*& function, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc)
     3973{
     3974    function = callFrame->callee();
    40083975   
    40093976    CodeBlock* codeBlock = &function->m_body->generatedByteCode();
    40103977    int numParameters = codeBlock->numParameters;
    4011     argc = callFrame[RegisterFile::ArgumentCount].i();
     3978    argc = callFrame->argumentCount();
    40123979
    40133980    if (argc <= numParameters)
    4014         argv = callFrame - RegisterFile::CallFrameHeaderSize - numParameters + 1; // + 1 to skip "this"
     3981        argv = callFrame->registers() - RegisterFile::CallFrameHeaderSize - numParameters + 1; // + 1 to skip "this"
    40153982    else
    4016         argv = callFrame - RegisterFile::CallFrameHeaderSize - numParameters - argc + 1; // + 1 to skip "this"
     3983        argv = callFrame->registers() - RegisterFile::CallFrameHeaderSize - numParameters - argc + 1; // + 1 to skip "this"
    40173984
    40183985    argc -= 1; // - 1 to skip "this"
     
    40273994}
    40283995
    4029 NEVER_INLINE void Machine::tryCTICachePutByID(ExecState* exec, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const PutPropertySlot& slot)
     3996NEVER_INLINE void Machine::tryCTICachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const PutPropertySlot& slot)
    40303997{
    40313998    // The interpreter checks for recursion here; I do not believe this can occur in CTI.
     
    40694036        StructureIDChain* chain = structureID->cachedPrototypeChain();
    40704037        if (!chain) {
    4071             chain = cachePrototypeChain(exec, structureID);
     4038            chain = cachePrototypeChain(callFrame, structureID);
    40724039            if (!chain) {
    40734040                // This happens if someone has manually inserted null into the prototype chain
     
    40794046        vPC[7] = slot.cachedOffset();
    40804047        codeBlock->refStructureIDs(vPC);
    4081         CTI::compilePutByIdTransition(this, exec, codeBlock, structureID->previousID(), structureID, slot.cachedOffset(), chain, returnAddress);
     4048        CTI::compilePutByIdTransition(this, callFrame, codeBlock, structureID->previousID(), structureID, slot.cachedOffset(), chain, returnAddress);
    40824049        return;
    40834050    }
     
    40894056
    40904057#if USE(CTI_REPATCH_PIC)
    4091     UNUSED_PARAM(exec);
     4058    UNUSED_PARAM(callFrame);
    40924059    CTI::patchPutByIdReplace(codeBlock, structureID, slot.cachedOffset(), returnAddress);
    40934060#else
    4094     CTI::compilePutByIdReplace(this, exec, codeBlock, structureID, slot.cachedOffset(), returnAddress);
     4061    CTI::compilePutByIdReplace(this, callFrame, codeBlock, structureID, slot.cachedOffset(), returnAddress);
    40954062#endif
    40964063}
    40974064
    4098 void* Machine::getCTIArrayLengthTrampoline(ExecState* exec, CodeBlock* codeBlock)
     4065void* Machine::getCTIArrayLengthTrampoline(CallFrame* callFrame, CodeBlock* codeBlock)
    40994066{
    41004067    if (!m_ctiArrayLengthTrampoline)
    4101         m_ctiArrayLengthTrampoline = CTI::compileArrayLengthTrampoline(this, exec, codeBlock);
     4068        m_ctiArrayLengthTrampoline = CTI::compileArrayLengthTrampoline(this, callFrame, codeBlock);
    41024069       
    41034070    return m_ctiArrayLengthTrampoline;
    41044071}
    41054072
    4106 void* Machine::getCTIStringLengthTrampoline(ExecState* exec, CodeBlock* codeBlock)
     4073void* Machine::getCTIStringLengthTrampoline(CallFrame* callFrame, CodeBlock* codeBlock)
    41074074{
    41084075    if (!m_ctiStringLengthTrampoline)
    4109         m_ctiStringLengthTrampoline = CTI::compileStringLengthTrampoline(this, exec, codeBlock);
     4076        m_ctiStringLengthTrampoline = CTI::compileStringLengthTrampoline(this, callFrame, codeBlock);
    41104077       
    41114078    return m_ctiStringLengthTrampoline;
    41124079}
    41134080
    4114 NEVER_INLINE void Machine::tryCTICacheGetByID(ExecState* exec, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot)
     4081NEVER_INLINE void Machine::tryCTICacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot)
    41154082{
    41164083    // FIXME: Write a test that proves we need to check for recursion here just
     
    41234090    }
    41244091
    4125     if (isJSArray(baseValue) && propertyName == exec->propertyNames().length) {
     4092    if (isJSArray(baseValue) && propertyName == callFrame->propertyNames().length) {
    41264093#if USE(CTI_REPATCH_PIC)
    4127         CTI::compilePatchGetArrayLength(this, exec, codeBlock, returnAddress);
     4094        CTI::compilePatchGetArrayLength(this, callFrame, codeBlock, returnAddress);
    41284095#else
    4129         ctiRepatchCallByReturnAddress(returnAddress, getCTIArrayLengthTrampoline(exec, codeBlock));
     4096        ctiRepatchCallByReturnAddress(returnAddress, getCTIArrayLengthTrampoline(callFrame, codeBlock));
    41304097#endif
    41314098        return;
    41324099    }
    4133     if (isJSString(baseValue) && propertyName == exec->propertyNames().length) {
     4100    if (isJSString(baseValue) && propertyName == callFrame->propertyNames().length) {
    41344101        // The tradeoff of compiling an repatched inline string length access routine does not seem
    41354102        // to pay off, so we currently only do this for arrays.
    4136         ctiRepatchCallByReturnAddress(returnAddress, getCTIStringLengthTrampoline(exec, codeBlock));
     4103        ctiRepatchCallByReturnAddress(returnAddress, getCTIStringLengthTrampoline(callFrame, codeBlock));
    41374104        return;
    41384105    }
     
    41704137        CTI::patchGetByIdSelf(codeBlock, structureID, slot.cachedOffset(), returnAddress);
    41714138#else
    4172         CTI::compileGetByIdSelf(this, exec, codeBlock, structureID, slot.cachedOffset(), returnAddress);
     4139        CTI::compileGetByIdSelf(this, callFrame, codeBlock, structureID, slot.cachedOffset(), returnAddress);
    41734140#endif
    41744141        return;
    41754142    }
    41764143
    4177     if (slot.slotBase() == structureID->prototypeForLookup(exec)) {
     4144    if (slot.slotBase() == structureID->prototypeForLookup(callFrame)) {
    41784145        ASSERT(slot.slotBase()->isObject());
    41794146
     
    41944161        codeBlock->refStructureIDs(vPC);
    41954162
    4196         CTI::compileGetByIdProto(this, exec, codeBlock, structureID, slotBaseObject->structureID(), slot.cachedOffset(), returnAddress);
     4163        CTI::compileGetByIdProto(this, callFrame, codeBlock, structureID, slotBaseObject->structureID(), slot.cachedOffset(), returnAddress);
    41974164        return;
    41984165    }
     
    42014168    JSObject* o = static_cast<JSObject*>(baseValue);
    42024169    while (slot.slotBase() != o) {
    4203         JSValue* v = o->structureID()->prototypeForLookup(exec);
     4170        JSValue* v = o->structureID()->prototypeForLookup(callFrame);
    42044171
    42054172        // If we didn't find slotBase in baseValue's prototype chain, then baseValue
     
    42264193    StructureIDChain* chain = structureID->cachedPrototypeChain();
    42274194    if (!chain)
    4228         chain = cachePrototypeChain(exec, structureID);
     4195        chain = cachePrototypeChain(callFrame, structureID);
    42294196
    42304197    ASSERT(chain);
     
    42364203    codeBlock->refStructureIDs(vPC);
    42374204
    4238     CTI::compileGetByIdChain(this, exec, codeBlock, structureID, chain, count, slot.cachedOffset(), returnAddress);
     4205    CTI::compileGetByIdChain(this, callFrame, codeBlock, structureID, chain, count, slot.cachedOffset(), returnAddress);
    42394206}
    42404207
     
    42914258{
    42924259    JSValue* v1 = ARG_src1;
    4293     ExecState* exec = ARG_exec;
    4294 
    4295     JSObject* result = v1->toThisObject(exec);
     4260    CallFrame* callFrame = ARG_callFrame;
     4261
     4262    JSObject* result = v1->toThisObject(callFrame);
    42964263    VM_CHECK_EXCEPTION_AT_END();
    42974264    return result;
     
    43004267void Machine::cti_op_end(CTI_ARGS)
    43014268{
    4302     Register* r = ARG_r;
    4303     ScopeChainNode* scopeChain = Machine::scopeChain(r);
     4269    ScopeChainNode* scopeChain = ARG_callFrame->scopeChain();
    43044270    ASSERT(scopeChain->refCount > 1);
    43054271    scopeChain->deref();
     
    43184284        return jsNumber(ARG_globalData, left + right);
    43194285   
    4320     ExecState* exec = ARG_exec;
     4286    CallFrame* callFrame = ARG_callFrame;
    43214287
    43224288    bool leftIsString = v1->isString();
     
    43244290        RefPtr<UString::Rep> value = concatenate(static_cast<JSString*>(v1)->value().rep(), static_cast<JSString*>(v2)->value().rep());
    43254291        if (UNLIKELY(!value)) {
    4326             throwOutOfMemoryError(exec);
     4292            throwOutOfMemoryError(callFrame);
    43274293            VM_THROW_EXCEPTION();
    43284294        }
     
    43374303
    43384304        if (UNLIKELY(!value)) {
    4339             throwOutOfMemoryError(exec);
     4305            throwOutOfMemoryError(callFrame);
    43404306            VM_THROW_EXCEPTION();
    43414307        }
     
    43444310
    43454311    // All other cases are pretty uncommon
    4346     JSValue* result = jsAddSlowCase(exec, v1, v2);
     4312    JSValue* result = jsAddSlowCase(callFrame, v1, v2);
    43474313    VM_CHECK_EXCEPTION_AT_END();
    43484314    return result;
     
    43534319    JSValue* v = ARG_src1;
    43544320
    4355     ExecState* exec = ARG_exec;
    4356     JSValue* result = jsNumber(ARG_globalData, v->toNumber(exec) + 1);
     4321    CallFrame* callFrame = ARG_callFrame;
     4322    JSValue* result = jsNumber(ARG_globalData, v->toNumber(callFrame) + 1);
    43574323    VM_CHECK_EXCEPTION_AT_END();
    43584324    return result;
     
    43614327void Machine::cti_timeout_check(CTI_ARGS)
    43624328{
    4363     if (ARG_globalData->machine->checkTimeout(ARG_exec->dynamicGlobalObject())) {
     4329    if (ARG_globalData->machine->checkTimeout(ARG_callFrame->dynamicGlobalObject())) {
    43644330        ARG_globalData->exception = createInterruptedExecutionException(ARG_globalData);
    43654331        VM_THROW_EXCEPTION_AT_END();
     
    43714337    JSValue* src1 = ARG_src1;
    43724338    JSValue* src2 = ARG_src2;
    4373     ExecState* exec = ARG_exec;
    4374 
    4375     bool result = jsLess(exec, src1, src2);
     4339    CallFrame* callFrame = ARG_callFrame;
     4340
     4341    bool result = jsLess(callFrame, src1, src2);
    43764342    VM_CHECK_EXCEPTION_AT_END();
    43774343    return result;
     
    43824348    JSValue* src1 = ARG_src1;
    43834349    JSValue* src2 = ARG_src2;
    4384     ExecState* exec = ARG_exec;
    4385 
    4386     bool result = jsLessEq(exec, src1, src2);
     4350    CallFrame* callFrame = ARG_callFrame;
     4351
     4352    bool result = jsLessEq(callFrame, src1, src2);
    43874353    VM_CHECK_EXCEPTION_AT_END();
    43884354    return result;
     
    43914357JSValue* Machine::cti_op_new_object(CTI_ARGS)
    43924358{
    4393     return constructEmptyObject(ARG_exec);;
     4359    return constructEmptyObject(ARG_callFrame);;
    43944360}
    43954361
    43964362void Machine::cti_op_put_by_id(CTI_ARGS)
    43974363{
    4398     ExecState* exec = ARG_exec;
     4364    CallFrame* callFrame = ARG_callFrame;
    43994365    Identifier& ident = *ARG_id2;
    44004366
    44014367    PutPropertySlot slot;
    4402     ARG_src1->put(exec, ident, ARG_src3, slot);
     4368    ARG_src1->put(callFrame, ident, ARG_src3, slot);
    44034369
    44044370    ctiRepatchCallByReturnAddress(CTI_RETURN_ADDRESS, (void*)cti_op_put_by_id_second);
     
    44094375void Machine::cti_op_put_by_id_second(CTI_ARGS)
    44104376{
    4411     ExecState* exec = ARG_exec;
     4377    PutPropertySlot slot;
     4378    ARG_src1->put(ARG_callFrame, *ARG_id2, ARG_src3, slot);
     4379    ARG_globalData->machine->tryCTICachePutByID(ARG_callFrame, ARG_callFrame->codeBlock(), CTI_RETURN_ADDRESS, ARG_src1, slot);
     4380    VM_CHECK_EXCEPTION_AT_END();
     4381}
     4382
     4383void Machine::cti_op_put_by_id_generic(CTI_ARGS)
     4384{
     4385    PutPropertySlot slot;
     4386    ARG_src1->put(ARG_callFrame, *ARG_id2, ARG_src3, slot);
     4387    VM_CHECK_EXCEPTION_AT_END();
     4388}
     4389
     4390void Machine::cti_op_put_by_id_fail(CTI_ARGS)
     4391{
     4392    CallFrame* callFrame = ARG_callFrame;
    44124393    Identifier& ident = *ARG_id2;
    44134394
    4414     JSValue* baseValue = ARG_src1;
    44154395    PutPropertySlot 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 
    4421     VM_CHECK_EXCEPTION_AT_END();
    4422 }
    4423 
    4424 void Machine::cti_op_put_by_id_generic(CTI_ARGS)
    4425 {
    4426     ExecState* exec = ARG_exec;
    4427     Identifier& ident = *ARG_id2;
    4428 
    4429     PutPropertySlot slot;
    4430     ARG_src1->put(exec, ident, ARG_src3, slot);
    4431 
    4432     VM_CHECK_EXCEPTION_AT_END();
    4433 }
    4434 
    4435 void Machine::cti_op_put_by_id_fail(CTI_ARGS)
    4436 {
    4437     ExecState* exec = ARG_exec;
    4438     Identifier& ident = *ARG_id2;
    4439 
    4440     PutPropertySlot slot;
    4441     ARG_src1->put(exec, ident, ARG_src3, slot);
     4396    ARG_src1->put(callFrame, ident, ARG_src3, slot);
    44424397
    44434398    // should probably uncachePutByID() ... this would mean doing a vPC lookup - might be worth just bleeding this until the end.
     
    44494404JSValue* Machine::cti_op_get_by_id(CTI_ARGS)
    44504405{
    4451     ExecState* exec = ARG_exec;
     4406    CallFrame* callFrame = ARG_callFrame;
    44524407    Identifier& ident = *ARG_id2;
    44534408
    44544409    JSValue* baseValue = ARG_src1;
    44554410    PropertySlot slot(baseValue);
    4456     JSValue* result = baseValue->get(exec, ident, slot);
     4411    JSValue* result = baseValue->get(callFrame, ident, slot);
    44574412
    44584413    ctiRepatchCallByReturnAddress(CTI_RETURN_ADDRESS, (void*)cti_op_get_by_id_second);
     
    44644419JSValue* Machine::cti_op_get_by_id_second(CTI_ARGS)
    44654420{
    4466     ExecState* exec = ARG_exec;
     4421    CallFrame* callFrame = ARG_callFrame;
    44674422    Identifier& ident = *ARG_id2;
    44684423
    44694424    JSValue* baseValue = ARG_src1;
    44704425    PropertySlot slot(baseValue);
    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);
     4426    JSValue* result = baseValue->get(callFrame, ident, slot);
     4427
     4428    ARG_globalData->machine->tryCTICacheGetByID(callFrame, callFrame->codeBlock(), CTI_RETURN_ADDRESS, baseValue, ident, slot);
    44754429
    44764430    VM_CHECK_EXCEPTION_AT_END();
     
    44804434JSValue* Machine::cti_op_get_by_id_generic(CTI_ARGS)
    44814435{
    4482     ExecState* exec = ARG_exec;
     4436    CallFrame* callFrame = ARG_callFrame;
    44834437    Identifier& ident = *ARG_id2;
    44844438
    44854439    JSValue* baseValue = ARG_src1;
    44864440    PropertySlot slot(baseValue);
    4487     JSValue* result = baseValue->get(exec, ident, slot);
     4441    JSValue* result = baseValue->get(callFrame, ident, slot);
    44884442
    44894443    VM_CHECK_EXCEPTION_AT_END();
     
    44934447JSValue* Machine::cti_op_get_by_id_fail(CTI_ARGS)
    44944448{
    4495     ExecState* exec = ARG_exec;
     4449    CallFrame* callFrame = ARG_callFrame;
    44964450    Identifier& ident = *ARG_id2;
    44974451
    44984452    JSValue* baseValue = ARG_src1;
    44994453    PropertySlot slot(baseValue);
    4500     JSValue* result = baseValue->get(exec, ident, slot);
     4454    JSValue* result = baseValue->get(callFrame, ident, slot);
    45014455
    45024456    // should probably uncacheGetByID() ... this would mean doing a vPC lookup - might be worth just bleeding this until the end.
     
    45094463JSValue* Machine::cti_op_instanceof(CTI_ARGS)
    45104464{
    4511     ExecState* exec = ARG_exec;
     4465    CallFrame* callFrame = ARG_callFrame;
    45124466    JSValue* value = ARG_src1;
    45134467    JSValue* baseVal = ARG_src2;
     
    45234477
    45244478    if (!baseVal->isObject()) {
    4525         Register* r = ARG_r;
    4526         CodeBlock* codeBlock = Machine::codeBlock(r);
     4479        CallFrame* callFrame = ARG_callFrame;
     4480        CodeBlock* codeBlock = callFrame->codeBlock();
    45274481        ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    45284482        unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
    4529         ARG_globalData->exception = createInvalidParamError(exec, "instanceof", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock);
     4483        ARG_globalData->exception = createInvalidParamError(callFrame, "instanceof", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock);
    45304484        VM_THROW_EXCEPTION();
    45314485    }
     
    45354489
    45364490    if (!proto->isObject()) {
    4537         throwError(exec, TypeError, "instanceof called on an object with an invalid prototype property.");
     4491        throwError(callFrame, TypeError, "instanceof called on an object with an invalid prototype property.");
    45384492        VM_THROW_EXCEPTION();
    45394493    }
     
    45424496        return jsBoolean(false);
    45434497
    4544     JSValue* result = jsBoolean(static_cast<JSObject*>(baseCell)->hasInstance(exec, valueCell, protoCell));
     4498    JSValue* result = jsBoolean(static_cast<JSObject*>(baseCell)->hasInstance(callFrame, valueCell, protoCell));
    45454499    VM_CHECK_EXCEPTION_AT_END();
    45464500
     
    45504504JSValue* Machine::cti_op_del_by_id(CTI_ARGS)
    45514505{
    4552     ExecState* exec = ARG_exec;
     4506    CallFrame* callFrame = ARG_callFrame;
    45534507    Identifier& ident = *ARG_id2;
    45544508   
    4555     JSObject* baseObj = ARG_src1->toObject(exec);
    4556 
    4557     JSValue* result = jsBoolean(baseObj->deleteProperty(exec, ident));
     4509    JSObject* baseObj = ARG_src1->toObject(callFrame);
     4510
     4511    JSValue* result = jsBoolean(baseObj->deleteProperty(callFrame, ident));
    45584512    VM_CHECK_EXCEPTION_AT_END();
    45594513    return result;
     
    45704524        return jsNumber(ARG_globalData, left * right);
    45714525
    4572     ExecState* exec = ARG_exec;
    4573     JSValue* result = jsNumber(ARG_globalData, src1->toNumber(exec) * src2->toNumber(exec));
     4526    CallFrame* callFrame = ARG_callFrame;
     4527    JSValue* result = jsNumber(ARG_globalData, src1->toNumber(callFrame) * src2->toNumber(callFrame));
    45744528    VM_CHECK_EXCEPTION_AT_END();
    45754529    return result;
     
    45784532JSValue* Machine::cti_op_new_func(CTI_ARGS)
    45794533{
    4580     return ARG_func1->makeFunction(ARG_exec, Machine::scopeChain(ARG_r));
     4534    return ARG_func1->makeFunction(ARG_callFrame, ARG_callFrame->scopeChain());
    45814535}
    45824536
     
    45894543
    45904544    if (UNLIKELY(*ARG_profilerReference != 0))
    4591         (*ARG_profilerReference)->willExecute(CallFrame::create(ARG_r), static_cast<JSObject*>(ARG_src1));
     4545        (*ARG_profilerReference)->willExecute(ARG_callFrame, static_cast<JSFunction*>(ARG_src1));
    45924546
    45934547    ScopeChainNode* callDataScopeChain = static_cast<JSFunction*>(ARG_src1)->m_scopeChain.node();
    45944548    CodeBlock* newCodeBlock = &static_cast<JSFunction*>(ARG_src1)->m_body->byteCode(callDataScopeChain);
    45954549
    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));
     4550    CallFrame* callFrame = slideRegisterWindowForCall(newCodeBlock, ARG_registerFile, ARG_callFrame, ARG_int2, ARG_int3);
     4551    if (UNLIKELY(!callFrame)) {
     4552        ARG_globalData->exception = createStackOverflowError(ARG_callFrame);
    45994553        VM_THROW_EXCEPTION_2();
    46004554    }
    46014555
    4602     VoidPtrPair pair = { newCodeBlock, r };
     4556    VoidPtrPair pair = { newCodeBlock, callFrame };
    46034557    return pair;
    46044558}
     
    46064560void* Machine::cti_vm_compile(CTI_ARGS)
    46074561{
    4608     Register* r = ARG_r;
    4609     CodeBlock* codeBlock = Machine::codeBlock(r);
    4610 
     4562    CodeBlock* codeBlock = ARG_callFrame->codeBlock();
    46114563    if (!codeBlock->ctiCode)
    4612         CTI::compile(ARG_globalData->machine, CallFrame::create(r), codeBlock);
    4613 
     4564        CTI::compile(ARG_globalData->machine, ARG_callFrame, codeBlock);
    46144565    return codeBlock->ctiCode;
    46154566}
     
    46174568JSValue* Machine::cti_op_push_activation(CTI_ARGS)
    46184569{
    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);
     4570    JSActivation* activation = new (ARG_globalData) JSActivation(ARG_callFrame, static_cast<FunctionBodyNode*>(ARG_callFrame->codeBlock()->ownerNode));
     4571    ARG_callFrame->setScopeChain(ARG_callFrame->scopeChain()->copy()->push(activation));
    46264572    return activation;
    46274573}
     
    46394585        int registerOffset = ARG_int2;
    46404586        int argCount = ARG_int3;
    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);
     4587        CallFrame* previousCallFrame = ARG_callFrame;
     4588        CallFrame* callFrame = CallFrame::create(previousCallFrame->registers() + registerOffset);
     4589
     4590        callFrame->init(0, ARG_instr4 + 1, previousCallFrame->scopeChain(), previousCallFrame, 0, argCount, static_cast<JSFunction*>(funcVal));
     4591        ARG_setCallFrame(callFrame);
    46464592
    46474593        if (*ARG_profilerReference)
    4648             (*ARG_profilerReference)->willExecute(CallFrame::create(r), static_cast<JSObject*>(funcVal));
    4649 
    4650         Register* argv = r - RegisterFile::CallFrameHeaderSize - argCount;
     4594            (*ARG_profilerReference)->willExecute(callFrame, static_cast<JSFunction*>(funcVal));
     4595
     4596        Register* argv = ARG_callFrame->registers() - RegisterFile::CallFrameHeaderSize - argCount;
    46514597        ArgList argList(argv + 1, argCount - 1);
    46524598
    46534599        CTI_MACHINE_SAMPLING_callingHostFunction();
    46544600
    4655         JSValue* returnValue = callData.native.function(CallFrame::create(r), static_cast<JSObject*>(funcVal), argv[0].jsValue(CallFrame::create(r)), argList);
    4656         ARG_setR(savedR);
     4601        JSValue* returnValue = callData.native.function(callFrame, static_cast<JSFunction*>(funcVal), argv[0].jsValue(callFrame), argList);
     4602        ARG_setCallFrame(previousCallFrame);
    46574603        VM_CHECK_EXCEPTION();
    46584604
    46594605        if (*ARG_profilerReference)
    4660             (*ARG_profilerReference)->didExecute(CallFrame::create(savedR), static_cast<JSObject*>(funcVal));
     4606            (*ARG_profilerReference)->didExecute(previousCallFrame, static_cast<JSFunction*>(funcVal));
    46614607
    46624608        return returnValue;
     
    46654611    ASSERT(callType == CallTypeNone);
    46664612
    4667     ARG_globalData->exception = createNotAFunctionError(CallFrame::create(ARG_r), funcVal, ARG_instr4, codeBlock(ARG_r));
     4613    ARG_globalData->exception = createNotAFunctionError(ARG_callFrame, funcVal, ARG_instr4, ARG_callFrame->codeBlock());
    46684614    VM_THROW_EXCEPTION();
    46694615}
     
    46714617void Machine::cti_op_create_arguments(CTI_ARGS)
    46724618{
    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;
     4619    Arguments* arguments = new (ARG_globalData) Arguments(ARG_callFrame);
     4620    ARG_callFrame->setCalleeArguments(arguments);
     4621    ARG_callFrame[RegisterFile::ArgumentsRegister] = arguments;
    46794622}
    46804623
    46814624void Machine::cti_op_tear_off_activation(CTI_ARGS)
    46824625{
    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);
     4626    ASSERT(ARG_callFrame->codeBlock()->needsFullScopeChain);
     4627    ASSERT(ARG_src1->isObject(&JSActivation::info));
     4628    static_cast<JSActivation*>(ARG_src1)->copyRegisters(ARG_callFrame->optionalCalleeArguments());
    46924629}
    46934630
    46944631void Machine::cti_op_tear_off_arguments(CTI_ARGS)
    46954632{
    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();
     4633    ASSERT(ARG_callFrame->codeBlock()->usesArguments && !ARG_callFrame->codeBlock()->needsFullScopeChain);
     4634    ARG_callFrame->optionalCalleeArguments()->copyRegisters();
    47034635}
    47044636
    47054637void Machine::cti_op_ret_profiler(CTI_ARGS)
    47064638{
    4707     ExecState* exec = ARG_exec;
    4708 
    4709     Register* r = ARG_r;
    47104639    ASSERT(*ARG_profilerReference);
    4711     (*ARG_profilerReference)->didExecute(exec, static_cast<JSObject*>(r[RegisterFile::Callee].jsValue(exec)));
     4640    (*ARG_profilerReference)->didExecute(ARG_callFrame, ARG_callFrame->callee());
    47124641}
    47134642
    47144643void Machine::cti_op_ret_scopeChain(CTI_ARGS)
    47154644{
    4716     Register* r = ARG_r;
    4717     ASSERT(codeBlock(r)->needsFullScopeChain);
    4718     scopeChain(r)->deref();
     4645    ASSERT(ARG_callFrame->codeBlock()->needsFullScopeChain);
     4646    ARG_callFrame->scopeChain()->deref();
    47194647}
    47204648
    47214649JSValue* Machine::cti_op_new_array(CTI_ARGS)
    47224650{
    4723     ArgList argsList(ARG_registers1, ARG_int2);
    4724     return constructArray(ARG_exec, argsList);
     4651    ArgList argList(ARG_registers1, ARG_int2);
     4652    return constructArray(ARG_callFrame, argList);
    47254653}
    47264654
    47274655JSValue* Machine::cti_op_resolve(CTI_ARGS)
    47284656{
    4729     ExecState* exec = ARG_exec;
    4730     Register* r = ARG_r;
    4731     ScopeChainNode* scopeChain = Machine::scopeChain(r);
     4657    CallFrame* callFrame = ARG_callFrame;
     4658    ScopeChainNode* scopeChain = callFrame->scopeChain();
    47324659
    47334660    ScopeChainIterator iter = scopeChain->begin();
     
    47394666        JSObject* o = *iter;
    47404667        PropertySlot slot(o);
    4741         if (o->getPropertySlot(exec, ident, slot)) {
    4742             JSValue* result = slot.getValue(exec, ident);
     4668        if (o->getPropertySlot(callFrame, ident, slot)) {
     4669            JSValue* result = slot.getValue(callFrame, ident);
    47434670            VM_CHECK_EXCEPTION_AT_END();
    47444671            return result;
     
    47464673    } while (++iter != end);
    47474674
    4748     CodeBlock* codeBlock = Machine::codeBlock(r);
     4675    CodeBlock* codeBlock = callFrame->codeBlock();
    47494676    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    47504677    unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
    4751     exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));
     4678    ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock);
    47524679    VM_THROW_EXCEPTION();
    47534680}
     
    47564683{
    47574684    RegisterFile* registerFile = ARG_registerFile;
    4758     Register* r = ARG_r;
     4685    CallFrame* callFrame = ARG_callFrame;
    47594686
    47604687    JSFunction* constructor = static_cast<JSFunction*>(ARG_src1);
     
    47704697
    47714698    if (*ARG_profilerReference)
    4772         (*ARG_profilerReference)->willExecute(CallFrame::create(r), constructor);
     4699        (*ARG_profilerReference)->willExecute(callFrame, constructor);
    47734700
    47744701    ScopeChainNode* callDataScopeChain = constructor->m_scopeChain.node();
     
    47834710    JSObject* newObject = new (ARG_globalData) JSObject(structure);
    47844711
    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));
     4712    callFrame[firstArg] = newObject; // "this" value
     4713
     4714    callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount);
     4715    if (UNLIKELY(!callFrame)) {
     4716        ARG_globalData->exception = createStackOverflowError(ARG_callFrame);
    47904717        VM_THROW_EXCEPTION_2();
    47914718    }
    47924719
    4793     VoidPtrPair pair = { newCodeBlock, r };
     4720    VoidPtrPair pair = { newCodeBlock, callFrame };
    47944721    return pair;
    47954722}
     
    47974724JSValue* Machine::cti_op_construct_NotJSConstruct(CTI_ARGS)
    47984725{
    4799     ExecState* exec = ARG_exec;
    4800     Register* r = ARG_r;
     4726    CallFrame* callFrame = ARG_callFrame;
    48014727
    48024728    JSValue* constrVal = ARG_src1;
     
    48114737    if (constructType == ConstructTypeHost) {
    48124738        if (*ARG_profilerReference)
    4813             (*ARG_profilerReference)->willExecute(exec, constructor);
    4814 
    4815         ArgList argList(r + firstArg + 1, argCount - 1);
     4739            (*ARG_profilerReference)->willExecute(callFrame, constructor);
     4740
     4741        ArgList argList(callFrame->registers() + firstArg + 1, argCount - 1);
    48164742
    48174743        CTI_MACHINE_SAMPLING_callingHostFunction();
    48184744
    4819         JSValue* returnValue = constructData.native.function(exec, constructor, argList);
     4745        JSValue* returnValue = constructData.native.function(callFrame, constructor, argList);
    48204746        VM_CHECK_EXCEPTION();
    48214747
    48224748        if (*ARG_profilerReference)
    4823             (*ARG_profilerReference)->didExecute(exec, constructor);
     4749            (*ARG_profilerReference)->didExecute(callFrame, constructor);
    48244750
    48254751        return returnValue;
     
    48284754    ASSERT(constructType == ConstructTypeNone);
    48294755
    4830     exec->setException(createNotAConstructorError(exec, constrVal, ARG_instr6, codeBlock(r)));
     4756    ARG_globalData->exception = createNotAConstructorError(callFrame, constrVal, ARG_instr6, callFrame->codeBlock());
    48314757    VM_THROW_EXCEPTION();
    48324758}
     
    48344760JSValue* Machine::cti_op_get_by_val(CTI_ARGS)
    48354761{
    4836     ExecState* exec = ARG_exec;
     4762    CallFrame* callFrame = ARG_callFrame;
    48374763    Machine* machine = ARG_globalData->machine;
    48384764
     
    48504776                result = jsArray->getIndex(i);
    48514777            else
    4852                 result = jsArray->JSArray::get(exec, i);
     4778                result = jsArray->JSArray::get(callFrame, i);
    48534779        } else if (machine->isJSString(baseValue) && static_cast<JSString*>(baseValue)->canGetIndex(i))
    48544780            result = static_cast<JSString*>(baseValue)->getIndex(ARG_globalData, i);
    48554781        else
    4856             result = baseValue->get(exec, i);
     4782            result = baseValue->get(callFrame, i);
    48574783    } else {
    4858         Identifier property(exec, subscript->toString(exec));
    4859         result = baseValue->get(exec, property);
     4784        Identifier property(callFrame, subscript->toString(callFrame));
     4785        result = baseValue->get(callFrame, property);
    48604786    }
    48614787
     
    48664792VoidPtrPair Machine::cti_op_resolve_func(CTI_ARGS)
    48674793{
    4868     ExecState* exec = ARG_exec;
    4869     Register* r = ARG_r;
    4870     ScopeChainNode* scopeChain = Machine::scopeChain(r);
     4794    CallFrame* callFrame = ARG_callFrame;
     4795    ScopeChainNode* scopeChain = callFrame->scopeChain();
    48714796
    48724797    ScopeChainIterator iter = scopeChain->begin();
     
    48824807        base = *iter;
    48834808        PropertySlot slot(base);
    4884         if (base->getPropertySlot(exec, ident, slot)) {           
     4809        if (base->getPropertySlot(callFrame, ident, slot)) {           
    48854810            // ECMA 11.2.3 says that if we hit an activation the this value should be null.
    48864811            // However, section 10.2.3 says that in the case where the value provided
     
    48904815            // that in host objects you always get a valid object for this.
    48914816            // We also handle wrapper substitution for the global object at the same time.
    4892             JSObject* thisObj = base->toThisObject(exec);
    4893             JSValue* result = slot.getValue(exec, ident);
     4817            JSObject* thisObj = base->toThisObject(callFrame);
     4818            JSValue* result = slot.getValue(callFrame, ident);
    48944819            VM_CHECK_EXCEPTION_AT_END();
    48954820
     
    49004825    } while (iter != end);
    49014826
    4902     CodeBlock* codeBlock = Machine::codeBlock(r);
     4827    CodeBlock* codeBlock = callFrame->codeBlock();
    49034828    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    49044829    unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
    4905     exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));
     4830    ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock);
    49064831    VM_THROW_EXCEPTION_2();
    49074832}
     
    49174842        return jsNumber(ARG_globalData, left - right);
    49184843
    4919     ExecState* exec = ARG_exec;
    4920     JSValue* result = jsNumber(ARG_globalData, src1->toNumber(exec) - src2->toNumber(exec));
     4844    CallFrame* callFrame = ARG_callFrame;
     4845    JSValue* result = jsNumber(ARG_globalData, src1->toNumber(callFrame) - src2->toNumber(callFrame));
    49214846    VM_CHECK_EXCEPTION_AT_END();
    49224847    return result;
     
    49254850void Machine::cti_op_put_by_val(CTI_ARGS)
    49264851{
    4927     ExecState* exec = ARG_exec;
     4852    CallFrame* callFrame = ARG_callFrame;
    49284853    Machine* machine = ARG_globalData->machine;
    49294854
     
    49414866                jsArray->setIndex(i, value);
    49424867            else
    4943                 jsArray->JSArray::put(exec, i, value);
     4868                jsArray->JSArray::put(callFrame, i, value);
    49444869        } else
    4945             baseValue->put(exec, i, value);
     4870            baseValue->put(callFrame, i, value);
    49464871    } else {
    4947         Identifier property(exec, subscript->toString(exec));
     4872        Identifier property(callFrame, subscript->toString(callFrame));
    49484873        if (!ARG_globalData->exception) { // Don't put to an object if toString threw an exception.
    49494874            PutPropertySlot slot;
    4950             baseValue->put(exec, property, value, slot);
     4875            baseValue->put(callFrame, property, value, slot);
    49514876        }
    49524877    }
     
    49574882void Machine::cti_op_put_by_val_array(CTI_ARGS)
    49584883{
    4959     ExecState* exec = ARG_exec;
     4884    CallFrame* callFrame = ARG_callFrame;
    49604885
    49614886    JSValue* baseValue = ARG_src1;
     
    49664891
    49674892    if (LIKELY(i >= 0))
    4968         static_cast<JSArray*>(baseValue)->JSArray::put(exec, i, value);
     4893        static_cast<JSArray*>(baseValue)->JSArray::put(callFrame, i, value);
    49694894    else {
    4970         Identifier property(exec, JSImmediate::from(i)->toString(exec));
     4895        Identifier property(callFrame, JSImmediate::from(i)->toString(callFrame));
    49714896        // FIXME: can toString throw an exception here?
    49724897        if (!ARG_globalData->exception) { // Don't put to an object if toString threw an exception.
    49734898            PutPropertySlot slot;
    4974             baseValue->put(exec, property, value, slot);
     4899            baseValue->put(callFrame, property, value, slot);
    49754900        }
    49764901    }
     
    49814906JSValue* Machine::cti_op_lesseq(CTI_ARGS)
    49824907{
    4983     ExecState* exec = ARG_exec;
    4984     JSValue* result = jsBoolean(jsLessEq(exec, ARG_src1, ARG_src2));
     4908    CallFrame* callFrame = ARG_callFrame;
     4909    JSValue* result = jsBoolean(jsLessEq(callFrame, ARG_src1, ARG_src2));
    49854910    VM_CHECK_EXCEPTION_AT_END();
    49864911    return result;
     
    49914916    JSValue* src1 = ARG_src1;
    49924917
    4993     ExecState* exec = ARG_exec;
    4994 
    4995     bool result = src1->toBoolean(exec);
     4918    CallFrame* callFrame = ARG_callFrame;
     4919
     4920    bool result = src1->toBoolean(callFrame);
    49964921    VM_CHECK_EXCEPTION_AT_END();
    49974922    return result;
     
    50064931        return jsNumber(ARG_globalData, -v);
    50074932
    5008     ExecState* exec = ARG_exec;
    5009     JSValue* result = jsNumber(ARG_globalData, -src->toNumber(exec));
     4933    CallFrame* callFrame = ARG_callFrame;
     4934    JSValue* result = jsNumber(ARG_globalData, -src->toNumber(callFrame));
    50104935    VM_CHECK_EXCEPTION_AT_END();
    50114936    return result;
     
    50144939JSValue* Machine::cti_op_resolve_base(CTI_ARGS)
    50154940{
    5016     return inlineResolveBase(ARG_exec, *ARG_id1, scopeChain(ARG_r));
     4941    return inlineResolveBase(ARG_callFrame, *ARG_id1, ARG_callFrame->scopeChain());
    50174942}
    50184943
    50194944JSValue* Machine::cti_op_resolve_skip(CTI_ARGS)
    50204945{
    5021     ExecState* exec = ARG_exec;
    5022     Register* r = ARG_r;
    5023     ScopeChainNode* scopeChain = Machine::scopeChain(r);
     4946    CallFrame* callFrame = ARG_callFrame;
     4947    ScopeChainNode* scopeChain = callFrame->scopeChain();
    50244948
    50254949    int skip = ARG_int2;
     
    50364960        JSObject* o = *iter;
    50374961        PropertySlot slot(o);
    5038         if (o->getPropertySlot(exec, ident, slot)) {
    5039             JSValue* result = slot.getValue(exec, ident);
     4962        if (o->getPropertySlot(callFrame, ident, slot)) {
     4963            JSValue* result = slot.getValue(callFrame, ident);
    50404964            VM_CHECK_EXCEPTION_AT_END();
    50414965            return result;
     
    50434967    } while (++iter != end);
    50444968
    5045     CodeBlock* codeBlock = Machine::codeBlock(r);
     4969    CodeBlock* codeBlock = callFrame->codeBlock();
    50464970    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    50474971    unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
    5048     exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));
     4972    ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock);
    50494973    VM_THROW_EXCEPTION();
    50504974}
     
    50524976JSValue* Machine::cti_op_resolve_global(CTI_ARGS)
    50534977{
    5054     ExecState* exec = ARG_exec;
     4978    CallFrame* callFrame = ARG_callFrame;
    50554979    JSGlobalObject* globalObject = static_cast<JSGlobalObject*>(ARG_src1);
    50564980    Identifier& ident = *ARG_id2;
     
    50594983
    50604984    PropertySlot slot(globalObject);
    5061     if (globalObject->getPropertySlot(exec, ident, slot)) {
    5062         JSValue* result = slot.getValue(exec, ident);
     4985    if (globalObject->getPropertySlot(callFrame, ident, slot)) {
     4986        JSValue* result = slot.getValue(callFrame, ident);
    50634987        if (slot.isCacheable()) {
    50644988            if (vPC[4].u.structureID)
     
    50744998    }
    50754999   
    5076     Register* r = ARG_r;
    5077     exec->setException(createUndefinedVariableError(exec, ident, vPC, codeBlock(r)));   
     5000    ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, vPC, callFrame->codeBlock());
    50785001    VM_THROW_EXCEPTION();
    50795002}
     
    50895012        return jsNumber(ARG_globalData, left / right);
    50905013
    5091     ExecState* exec = ARG_exec;
    5092     JSValue* result = jsNumber(ARG_globalData, src1->toNumber(exec) / src2->toNumber(exec));
     5014    CallFrame* callFrame = ARG_callFrame;
     5015    JSValue* result = jsNumber(ARG_globalData, src1->toNumber(callFrame) / src2->toNumber(callFrame));
    50935016    VM_CHECK_EXCEPTION_AT_END();
    50945017    return result;
     
    50995022    JSValue* v = ARG_src1;
    51005023
    5101     ExecState* exec = ARG_exec;
    5102     JSValue* result = jsNumber(ARG_globalData, v->toNumber(exec) - 1);
     5024    CallFrame* callFrame = ARG_callFrame;
     5025    JSValue* result = jsNumber(ARG_globalData, v->toNumber(callFrame) - 1);
    51035026    VM_CHECK_EXCEPTION_AT_END();
    51045027    return result;
     
    51095032    JSValue* src1 = ARG_src1;
    51105033    JSValue* src2 = ARG_src2;
    5111     ExecState* exec = ARG_exec;
    5112 
    5113     bool result = jsLess(exec, src1, src2);
     5034    CallFrame* callFrame = ARG_callFrame;
     5035
     5036    bool result = jsLess(callFrame, src1, src2);
    51145037    VM_CHECK_EXCEPTION_AT_END();
    51155038    return result;
     
    51205043    JSValue* src = ARG_src1;
    51215044
    5122     ExecState* exec = ARG_exec;
    5123 
    5124     JSValue* result = jsBoolean(!src->toBoolean(exec));
     5045    CallFrame* callFrame = ARG_callFrame;
     5046
     5047    JSValue* result = jsBoolean(!src->toBoolean(callFrame));
    51255048    VM_CHECK_EXCEPTION_AT_END();
    51265049    return result;
     
    51315054    JSValue* src1 = ARG_src1;
    51325055
    5133     ExecState* exec = ARG_exec;
    5134 
    5135     bool result = src1->toBoolean(exec);
     5056    CallFrame* callFrame = ARG_callFrame;
     5057
     5058    bool result = src1->toBoolean(callFrame);
    51365059    VM_CHECK_EXCEPTION_AT_END();
    51375060    return result;
     
    51425065    JSValue* v = ARG_src1;
    51435066
    5144     ExecState* exec = ARG_exec;
    5145 
    5146     JSValue* number = v->toJSNumber(exec);
     5067    CallFrame* callFrame = ARG_callFrame;
     5068
     5069    JSValue* number = v->toJSNumber(callFrame);
    51475070    VM_CHECK_EXCEPTION_2();
    51485071
     
    51565079    JSValue* src2 = ARG_src2;
    51575080
    5158     ExecState* exec = ARG_exec;
     5081    CallFrame* callFrame = ARG_callFrame;
    51595082
    51605083    ASSERT(!JSImmediate::areBothImmediateNumbers(src1, src2));
    5161     JSValue* result = jsBoolean(equalSlowCaseInline(exec, src1, src2));
     5084    JSValue* result = jsBoolean(equalSlowCaseInline(callFrame, src1, src2));
    51625085    VM_CHECK_EXCEPTION_AT_END();
    51635086    return result;
     
    51765099        return jsNumber(ARG_globalData, left << (right & 0x1f));
    51775100
    5178     ExecState* exec = ARG_exec;
    5179     JSValue* result = jsNumber(ARG_globalData, (val->toInt32(exec)) << (shift->toUInt32(exec) & 0x1f));
     5101    CallFrame* callFrame = ARG_callFrame;
     5102    JSValue* result = jsNumber(ARG_globalData, (val->toInt32(callFrame)) << (shift->toUInt32(callFrame) & 0x1f));
    51805103    VM_CHECK_EXCEPTION_AT_END();
    51815104    return result;
     
    51925115        return jsNumber(ARG_globalData, left & right);
    51935116
    5194     ExecState* exec = ARG_exec;
    5195     JSValue* result = jsNumber(ARG_globalData, src1->toInt32(exec) & src2->toInt32(exec));
     5117    CallFrame* callFrame = ARG_callFrame;
     5118    JSValue* result = jsNumber(ARG_globalData, src1->toInt32(callFrame) & src2->toInt32(callFrame));
    51965119    VM_CHECK_EXCEPTION_AT_END();
    51975120    return result;
     
    52105133        return jsNumber(ARG_globalData, left >> (right & 0x1f));
    52115134
    5212     ExecState* exec = ARG_exec;
    5213     JSValue* result = jsNumber(ARG_globalData, (val->toInt32(exec)) >> (shift->toUInt32(exec) & 0x1f));
     5135    CallFrame* callFrame = ARG_callFrame;
     5136    JSValue* result = jsNumber(ARG_globalData, (val->toInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
    52145137    VM_CHECK_EXCEPTION_AT_END();
    52155138    return result;
     
    52245147        return jsNumber(ARG_globalData, ~value);
    52255148           
    5226     ExecState* exec = ARG_exec;
    5227     JSValue* result = jsNumber(ARG_globalData, ~src->toInt32(exec));
     5149    CallFrame* callFrame = ARG_callFrame;
     5150    JSValue* result = jsNumber(ARG_globalData, ~src->toInt32(callFrame));
    52285151    VM_CHECK_EXCEPTION_AT_END();
    52295152    return result;
     
    52325155VoidPtrPair Machine::cti_op_resolve_with_base(CTI_ARGS)
    52335156{
    5234     ExecState* exec = ARG_exec;
    5235     Register* r = ARG_r;
    5236     ScopeChainNode* scopeChain = Machine::scopeChain(r);
     5157    CallFrame* callFrame = ARG_callFrame;
     5158    ScopeChainNode* scopeChain = callFrame->scopeChain();
    52375159
    52385160    ScopeChainIterator iter = scopeChain->begin();
     
    52485170        base = *iter;
    52495171        PropertySlot slot(base);
    5250         if (base->getPropertySlot(exec, ident, slot)) {
    5251             JSValue* result = slot.getValue(exec, ident);
     5172        if (base->getPropertySlot(callFrame, ident, slot)) {
     5173            JSValue* result = slot.getValue(callFrame, ident);
    52525174            VM_CHECK_EXCEPTION_AT_END();
    52535175
     
    52585180    } while (iter != end);
    52595181
    5260     CodeBlock* codeBlock = Machine::codeBlock(r);
     5182    CodeBlock* codeBlock = callFrame->codeBlock();
    52615183    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    52625184    unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
    5263     exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));
     5185    ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock);
    52645186    VM_THROW_EXCEPTION_2();
    52655187}
     
    52675189JSValue* Machine::cti_op_new_func_exp(CTI_ARGS)
    52685190{
    5269     return ARG_funcexp1->makeFunction(ARG_exec, scopeChain(ARG_r));
     5191    return ARG_funcexp1->makeFunction(ARG_callFrame, ARG_callFrame->scopeChain());
    52705192}
    52715193
     
    52755197    JSValue* divisorValue = ARG_src2;
    52765198
    5277     ExecState* exec = ARG_exec;
    5278     double d = dividendValue->toNumber(exec);
    5279     JSValue* result = jsNumber(ARG_globalData, fmod(d, divisorValue->toNumber(exec)));
     5199    CallFrame* callFrame = ARG_callFrame;
     5200    double d = dividendValue->toNumber(callFrame);
     5201    JSValue* result = jsNumber(ARG_globalData, fmod(d, divisorValue->toNumber(callFrame)));
    52805202    VM_CHECK_EXCEPTION_AT_END();
    52815203    return result;
     
    52845206JSValue* Machine::cti_op_less(CTI_ARGS)
    52855207{
    5286     ExecState* exec = ARG_exec;
    5287     JSValue* result = jsBoolean(jsLess(exec, ARG_src1, ARG_src2));
     5208    CallFrame* callFrame = ARG_callFrame;
     5209    JSValue* result = jsBoolean(jsLess(callFrame, ARG_src1, ARG_src2));
    52885210    VM_CHECK_EXCEPTION_AT_END();
    52895211    return result;
     
    52975219    ASSERT(!JSImmediate::areBothImmediateNumbers(src1, src2));
    52985220
    5299     ExecState* exec = ARG_exec;
    5300     JSValue* result = jsBoolean(!equalSlowCaseInline(exec, src1, src2));
     5221    CallFrame* callFrame = ARG_callFrame;
     5222    JSValue* result = jsBoolean(!equalSlowCaseInline(callFrame, src1, src2));
    53015223    VM_CHECK_EXCEPTION_AT_END();
    53025224    return result;
     
    53075229    JSValue* v = ARG_src1;
    53085230
    5309     ExecState* exec = ARG_exec;
    5310 
    5311     JSValue* number = v->toJSNumber(exec);
     5231    CallFrame* callFrame = ARG_callFrame;
     5232
     5233    JSValue* number = v->toJSNumber(callFrame);
    53125234    VM_CHECK_EXCEPTION_2();
    53135235
     
    53215243    JSValue* shift = ARG_src2;
    53225244
    5323     ExecState* exec = ARG_exec;
     5245    CallFrame* callFrame = ARG_callFrame;
    53245246
    53255247    if (JSImmediate::areBothImmediateNumbers(val, shift) && !JSImmediate::isNegative(val))
    53265248        return JSImmediate::rightShiftImmediateNumbers(val, shift);
    53275249    else {
    5328         JSValue* result = jsNumber(ARG_globalData, (val->toUInt32(exec)) >> (shift->toUInt32(exec) & 0x1f));
     5250        JSValue* result = jsNumber(ARG_globalData, (val->toUInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
    53295251        VM_CHECK_EXCEPTION_AT_END();
    53305252        return result;
     
    53375259    JSValue* src2 = ARG_src2;
    53385260
    5339     ExecState* exec = ARG_exec;
    5340 
    5341     JSValue* result = jsNumber(ARG_globalData, src1->toInt32(exec) ^ src2->toInt32(exec));
     5261    CallFrame* callFrame = ARG_callFrame;
     5262
     5263    JSValue* result = jsNumber(ARG_globalData, src1->toInt32(callFrame) ^ src2->toInt32(callFrame));
    53425264    VM_CHECK_EXCEPTION_AT_END();
    53435265    return result;
     
    53465268JSValue* Machine::cti_op_new_regexp(CTI_ARGS)
    53475269{
    5348     return new (ARG_globalData) RegExpObject(scopeChain(ARG_r)->globalObject()->regExpStructure(), ARG_regexp1);
     5270    return new (ARG_globalData) RegExpObject(ARG_callFrame->lexicalGlobalObject()->regExpStructure(), ARG_regexp1);
    53495271}
    53505272
     
    53545276    JSValue* src2 = ARG_src2;
    53555277
    5356     ExecState* exec = ARG_exec;
    5357 
    5358     JSValue* result = jsNumber(ARG_globalData, src1->toInt32(exec) | src2->toInt32(exec));
     5278    CallFrame* callFrame = ARG_callFrame;
     5279
     5280    JSValue* result = jsNumber(ARG_globalData, src1->toInt32(callFrame) | src2->toInt32(callFrame));
    53595281    VM_CHECK_EXCEPTION_AT_END();
    53605282    return result;
     
    53635285JSValue* Machine::cti_op_call_eval(CTI_ARGS)
    53645286{
    5365     ExecState* exec = ARG_exec;
     5287    CallFrame* callFrame = ARG_callFrame;
    53665288    RegisterFile* registerFile = ARG_registerFile;
    5367     Register* r = ARG_r;
    5368     CodeBlock* codeBlock = Machine::codeBlock(r);
    5369     ScopeChainNode* scopeChain = Machine::scopeChain(r);
     5289    CodeBlock* codeBlock = callFrame->codeBlock();
     5290    ScopeChainNode* scopeChain = callFrame->scopeChain();
    53705291
    53715292    Machine* machine = ARG_globalData->machine;
     
    53775298
    53785299    if (baseVal == scopeChain->globalObject() && funcVal == scopeChain->globalObject()->evalFunction()) {
    5379         JSObject* thisObject = static_cast<JSObject*>(r[codeBlock->thisRegister].jsValue(exec));
     5300        JSObject* thisObject = static_cast<JSObject*>(callFrame[codeBlock->thisRegister].jsValue(callFrame));
    53805301        JSValue* exceptionValue = 0;
    5381         JSValue* result = machine->callEval(exec, thisObject, scopeChain, registerFile,  r, registerOffset - RegisterFile::CallFrameHeaderSize - argCount, argCount, exceptionValue);
     5302        JSValue* result = machine->callEval(callFrame, thisObject, scopeChain, registerFile, registerOffset - RegisterFile::CallFrameHeaderSize - argCount, argCount, exceptionValue);
    53825303        VM_CHECK_EXCEPTION_ARG(exceptionValue);
    53835304        return result;
     
    53895310void* Machine::cti_op_throw(CTI_ARGS)
    53905311{
    5391     ExecState* exec = ARG_exec;
    5392     Register* r = ARG_r;
    5393     CodeBlock* codeBlock = Machine::codeBlock(r);
     5312    CallFrame* callFrame = ARG_callFrame;
     5313    CodeBlock* codeBlock = callFrame->codeBlock();
    53945314
    53955315    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
     
    53995319    ASSERT(exceptionValue);
    54005320
    5401     Instruction* handlerVPC = ARG_globalData->machine->throwException(exec, exceptionValue, codeBlock->instructions.begin() + vPCIndex, r, true);
     5321    Instruction* handlerVPC = ARG_globalData->machine->throwException(callFrame, exceptionValue, codeBlock->instructions.begin() + vPCIndex, true);
    54025322
    54035323    if (!handlerVPC) {
     
    54065326    }
    54075327
    5408     ARG_setR(r);
    5409     void* catchRoutine = Machine::codeBlock(r)->nativeExceptionCodeForHandlerVPC(handlerVPC);
     5328    ARG_setCallFrame(callFrame);
     5329    void* catchRoutine = callFrame->codeBlock()->nativeExceptionCodeForHandlerVPC(handlerVPC);
    54105330    ASSERT(catchRoutine);
    54115331    ctiSetReturnAddress(&CTI_RETURN_ADDRESS, catchRoutine);
     
    54155335JSPropertyNameIterator* Machine::cti_op_get_pnames(CTI_ARGS)
    54165336{
    5417     return JSPropertyNameIterator::create(ARG_exec, ARG_src1);
     5337    return JSPropertyNameIterator::create(ARG_callFrame, ARG_src1);
    54185338}
    54195339
     
    54215341{
    54225342    JSPropertyNameIterator* it = ARG_pni1;
    5423     JSValue* temp = it->next(ARG_exec);
     5343    JSValue* temp = it->next(ARG_callFrame);
    54245344    if (!temp)
    54255345        it->invalidate();
     
    54295349void Machine::cti_op_push_scope(CTI_ARGS)
    54305350{
    5431     ExecState* exec = ARG_exec;
    5432     JSValue* v = ARG_src1;
    5433 
    5434     JSObject* o = v->toObject(exec);
     5351    JSObject* o = ARG_src1->toObject(ARG_callFrame);
    54355352    VM_CHECK_EXCEPTION_VOID();
    5436 
    5437     Register* r = ARG_r;
    5438     r[RegisterFile::ScopeChain] = scopeChain(r)->push(o);
     5353    ARG_callFrame->setScopeChain(ARG_callFrame->scopeChain()->push(o));
    54395354}
    54405355
    54415356void Machine::cti_op_pop_scope(CTI_ARGS)
    54425357{
    5443     Register* r = ARG_r;
    5444     r[RegisterFile::ScopeChain] = scopeChain(r)->pop();
     5358    ARG_callFrame->setScopeChain(ARG_callFrame->scopeChain()->pop());
    54455359}
    54465360
    54475361JSValue* Machine::cti_op_typeof(CTI_ARGS)
    54485362{
    5449     return jsTypeStringForValue(ARG_exec, ARG_src1);
     5363    return jsTypeStringForValue(ARG_callFrame, ARG_src1);
    54505364}
    54515365
     
    55085422{
    55095423    JSValue* src = ARG_src1;
    5510     ExecState* exec = ARG_exec;
    5511 
    5512     JSValue* result = src->toJSNumber(exec);
     5424    CallFrame* callFrame = ARG_callFrame;
     5425
     5426    JSValue* result = src->toJSNumber(callFrame);
    55135427    VM_CHECK_EXCEPTION_AT_END();
    55145428    return result;
     
    55175431JSValue* Machine::cti_op_in(CTI_ARGS)
    55185432{
    5519     ExecState* exec = ARG_exec;
     5433    CallFrame* callFrame = ARG_callFrame;
    55205434    JSValue* baseVal = ARG_src2;
    55215435
    55225436    if (!baseVal->isObject()) {
    5523         Register* r = ARG_r;
    5524         CodeBlock* codeBlock = Machine::codeBlock(r);
     5437        CallFrame* callFrame = ARG_callFrame;
     5438        CodeBlock* codeBlock = callFrame->codeBlock();
    55255439        ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    55265440        unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
    5527         exec->setException(createInvalidParamError(exec, "in", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock));
     5441        ARG_globalData->exception = createInvalidParamError(callFrame, "in", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock);
    55285442        VM_THROW_EXCEPTION();
    55295443    }
     
    55345448    uint32_t i;
    55355449    if (propName->getUInt32(i))
    5536         return jsBoolean(baseObj->hasProperty(exec, i));
    5537 
    5538     Identifier property(exec, propName->toString(exec));
     5450        return jsBoolean(baseObj->hasProperty(callFrame, i));
     5451
     5452    Identifier property(callFrame, propName->toString(callFrame));
    55395453    VM_CHECK_EXCEPTION();
    5540     return jsBoolean(baseObj->hasProperty(exec, property));
     5454    return jsBoolean(baseObj->hasProperty(callFrame, property));
    55415455}
    55425456
    55435457JSValue* Machine::cti_op_push_new_scope(CTI_ARGS)
    55445458{
    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);
     5459    JSObject* scope = new (ARG_globalData) JSStaticScopeObject(ARG_callFrame, *ARG_id1, ARG_src2, DontDelete);
     5460
     5461    CallFrame* callFrame = ARG_callFrame;
     5462    callFrame->setScopeChain(callFrame->scopeChain()->push(scope));
    55495463    return scope;
    55505464}
     
    55535467{
    55545468    unsigned count = ARG_int1;
    5555     Register* r = ARG_r;
    5556 
    5557     ScopeChainNode* tmp = scopeChain(r);
     5469    CallFrame* callFrame = ARG_callFrame;
     5470
     5471    ScopeChainNode* tmp = callFrame->scopeChain();
    55585472    while (count--)
    55595473        tmp = tmp->pop();
    5560     r[RegisterFile::ScopeChain] = tmp;
     5474    callFrame->setScopeChain(tmp);
    55615475}
    55625476
    55635477void Machine::cti_op_put_by_index(CTI_ARGS)
    55645478{
    5565     ExecState* exec = ARG_exec;
     5479    CallFrame* callFrame = ARG_callFrame;
    55665480    unsigned property = ARG_int2;
    55675481
    5568     ARG_src1->put(exec, property, ARG_src3);
     5482    ARG_src1->put(callFrame, property, ARG_src3);
    55695483}
    55705484
     
    55735487    JSValue* scrutinee = ARG_src1;
    55745488    unsigned tableIndex = ARG_int2;
    5575     Register* r = ARG_r;
    5576     CodeBlock* codeBlock = Machine::codeBlock(r);
     5489    CallFrame* callFrame = ARG_callFrame;
     5490    CodeBlock* codeBlock = callFrame->codeBlock();
    55775491
    55785492    if (JSImmediate::isNumber(scrutinee)) {
     
    55885502    JSValue* scrutinee = ARG_src1;
    55895503    unsigned tableIndex = ARG_int2;
    5590     Register* r = ARG_r;
    5591     CodeBlock* codeBlock = Machine::codeBlock(r);
     5504    CallFrame* callFrame = ARG_callFrame;
     5505    CodeBlock* codeBlock = callFrame->codeBlock();
    55925506
    55935507    void* result = codeBlock->characterSwitchJumpTables[tableIndex].ctiDefault;
     
    56065520    JSValue* scrutinee = ARG_src1;
    56075521    unsigned tableIndex = ARG_int2;
    5608     Register* r = ARG_r;
    5609     CodeBlock* codeBlock = Machine::codeBlock(r);
     5522    CallFrame* callFrame = ARG_callFrame;
     5523    CodeBlock* codeBlock = callFrame->codeBlock();
    56105524
    56115525    void* result = codeBlock->stringSwitchJumpTables[tableIndex].ctiDefault;
     
    56215535JSValue* Machine::cti_op_del_by_val(CTI_ARGS)
    56225536{
    5623     ExecState* exec = ARG_exec;
     5537    CallFrame* callFrame = ARG_callFrame;
    56245538
    56255539    JSValue* baseValue = ARG_src1;
    5626     JSObject* baseObj = baseValue->toObject(exec); // may throw
     5540    JSObject* baseObj = baseValue->toObject(callFrame); // may throw
    56275541
    56285542    JSValue* subscript = ARG_src2;
     
    56305544    uint32_t i;
    56315545    if (subscript->getUInt32(i))
    5632         result = jsBoolean(baseObj->deleteProperty(exec, i));
     5546        result = jsBoolean(baseObj->deleteProperty(callFrame, i));
    56335547    else {
    56345548        VM_CHECK_EXCEPTION();
    5635         Identifier property(exec, subscript->toString(exec));
     5549        Identifier property(callFrame, subscript->toString(callFrame));
    56365550        VM_CHECK_EXCEPTION();
    5637         result = jsBoolean(baseObj->deleteProperty(exec, property));
     5551        result = jsBoolean(baseObj->deleteProperty(callFrame, property));
    56385552    }
    56395553
     
    56445558void Machine::cti_op_put_getter(CTI_ARGS)
    56455559{
    5646     ExecState* exec = ARG_exec;
     5560    CallFrame* callFrame = ARG_callFrame;
    56475561
    56485562    ASSERT(ARG_src1->isObject());
     
    56505564    Identifier& ident = *ARG_id2;
    56515565    ASSERT(ARG_src3->isObject());
    5652     baseObj->defineGetter(exec, ident, static_cast<JSObject*>(ARG_src3));
     5566    baseObj->defineGetter(callFrame, ident, static_cast<JSObject*>(ARG_src3));
    56535567}
    56545568
    56555569void Machine::cti_op_put_setter(CTI_ARGS)
    56565570{
    5657     ExecState* exec = ARG_exec;
     5571    CallFrame* callFrame = ARG_callFrame;
    56585572
    56595573    ASSERT(ARG_src1->isObject());
     
    56615575    Identifier& ident = *ARG_id2;
    56625576    ASSERT(ARG_src3->isObject());
    5663     baseObj->defineSetter(exec, ident, static_cast<JSObject*>(ARG_src3));
     5577    baseObj->defineSetter(callFrame, ident, static_cast<JSObject*>(ARG_src3));
    56645578}
    56655579
    56665580JSValue* Machine::cti_op_new_error(CTI_ARGS)
    56675581{
    5668     ExecState* exec = ARG_exec;
    5669     Register* r = ARG_r;
    5670     CodeBlock* codeBlock = Machine::codeBlock(r);
     5582    CallFrame* callFrame = ARG_callFrame;
     5583    CodeBlock* codeBlock = callFrame->codeBlock();
    56715584    unsigned type = ARG_int1;
    56725585    JSValue* message = ARG_src2;
    56735586    unsigned lineNumber = ARG_int3;
    56745587
    5675     return Error::create(exec, static_cast<ErrorType>(type), message->toString(exec), lineNumber, codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL());
     5588    return Error::create(callFrame, static_cast<ErrorType>(type), message->toString(callFrame), lineNumber, codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL());
    56765589}
    56775590
    56785591void Machine::cti_op_debug(CTI_ARGS)
    56795592{
    5680     ExecState* exec = ARG_exec;
    5681     Register* r = ARG_r;
     5593    CallFrame* callFrame = ARG_callFrame;
    56825594
    56835595    int debugHookID = ARG_int1;
     
    56855597    int lastLine = ARG_int3;
    56865598
    5687     ARG_globalData->machine->debug(exec, r, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
     5599    ARG_globalData->machine->debug(callFrame, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
    56885600}
    56895601
    56905602void* Machine::cti_vm_throw(CTI_ARGS)
    56915603{
    5692     ExecState* exec = ARG_exec;
    5693     Register* r = ARG_r;
    5694     CodeBlock* codeBlock = Machine::codeBlock(r);
     5604    CallFrame* callFrame = ARG_callFrame;
     5605    CodeBlock* codeBlock = callFrame->codeBlock();
    56955606
    56965607    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(ARG_globalData->throwReturnAddress));
     
    57015612    ARG_globalData->exception = 0;
    57025613
    5703     Instruction* handlerVPC = ARG_globalData->machine->throwException(exec, exceptionValue, codeBlock->instructions.begin() + vPCIndex, r, false);
     5614    Instruction* handlerVPC = ARG_globalData->machine->throwException(callFrame, exceptionValue, codeBlock->instructions.begin() + vPCIndex, false);
    57045615
    57055616    if (!handlerVPC) {
     
    57085619    }
    57095620
    5710     ARG_setR(r);
    5711     void* catchRoutine = Machine::codeBlock(r)->nativeExceptionCodeForHandlerVPC(handlerVPC);
     5621    ARG_setCallFrame(callFrame);
     5622    void* catchRoutine = callFrame->codeBlock()->nativeExceptionCodeForHandlerVPC(handlerVPC);
    57125623    ASSERT(catchRoutine);
    57135624    ctiSetReturnAddress(&CTI_RETURN_ADDRESS, catchRoutine);
Note: See TracChangeset for help on using the changeset viewer.