Changeset 37427 in webkit


Ignore:
Timestamp:
Oct 8, 2008 10:03:10 AM (16 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.
Location:
trunk
Files:
41 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSObjectRef.cpp

    r37215 r37427  
    9393    JSLock lock(exec);
    9494
    95     Identifier nameID = name ? name->identifier(exec) : Identifier(exec, "anonymous");
     95    Identifier nameID = name ? name->identifier(&exec->globalData()) : Identifier(exec, "anonymous");
    9696   
    9797    return toRef(new (exec) JSCallbackFunction(exec, callAsFunction, nameID));
     
    119119    JSLock lock(exec);
    120120
    121     Identifier nameID = name ? name->identifier(exec) : Identifier(exec, "anonymous");
     121    Identifier nameID = name ? name->identifier(&exec->globalData()) : Identifier(exec, "anonymous");
    122122   
    123123    ArgList args;
     
    247247    JSObject* jsObject = toJS(object);
    248248   
    249     return jsObject->hasProperty(exec, propertyName->identifier(exec));
     249    return jsObject->hasProperty(exec, propertyName->identifier(&exec->globalData()));
    250250}
    251251
     
    258258    JSObject* jsObject = toJS(object);
    259259
    260     JSValue* jsValue = jsObject->get(exec, propertyName->identifier(exec));
     260    JSValue* jsValue = jsObject->get(exec, propertyName->identifier(&exec->globalData()));
    261261    if (exec->hadException()) {
    262262        if (exception)
     
    274274
    275275    JSObject* jsObject = toJS(object);
    276     Identifier name(propertyName->identifier(exec));
     276    Identifier name(propertyName->identifier(&exec->globalData()));
    277277    JSValue* jsValue = toJS(value);
    278278
     
    334334    JSObject* jsObject = toJS(object);
    335335
    336     bool result = jsObject->deleteProperty(exec,  propertyName->identifier(exec));
     336    bool result = jsObject->deleteProperty(exec, propertyName->identifier(&exec->globalData()));
    337337    if (exec->hadException()) {
    338338        if (exception)
  • trunk/JavaScriptCore/API/OpaqueJSString.cpp

    r37257 r37427  
    4747}
    4848
    49 Identifier OpaqueJSString::identifier(ExecState* exec) const
    50 {
    51     return identifier(&exec->globalData());
    52 }
    53 
    5449Identifier OpaqueJSString::identifier(JSGlobalData* globalData) const
    5550{
  • trunk/JavaScriptCore/API/OpaqueJSString.h

    r36263 r37427  
    3030
    3131namespace JSC {
    32     class ExecState;
    3332    class Identifier;
    3433    class JSGlobalData;
    35 };
     34}
    3635
    3736struct OpaqueJSString : public ThreadSafeShared<OpaqueJSString> {
     
    5352
    5453    JSC::UString ustring() const;
    55 
    56     JSC::Identifier identifier(JSC::ExecState*) const;
    5754    JSC::Identifier identifier(JSC::JSGlobalData*) const;
    5855
  • trunk/JavaScriptCore/ChangeLog

    r37422 r37427  
     12008-10-08  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Cameron Zwarich.
     4
     5        - https://bugs.webkit.org/show_bug.cgi?id=21403
     6          Bug 21403: use new CallFrame class rather than Register* for call frame manipulation
     7
     8        Add CallFrame as a synonym for ExecState. Arguably, some day we should switch every
     9        client over to the new name.
     10
     11        Use CallFrame* consistently rather than Register* or ExecState* in low-level code such
     12        as Machine.cpp and CTI.cpp. Similarly, use callFrame rather than r as its name and use
     13        accessor functions to get at things in the frame.
     14
     15        Eliminate other uses of ExecState* that aren't needed, replacing in some cases with
     16        JSGlobalData* and in other cases eliminating them entirely.
     17
     18        * API/JSObjectRef.cpp:
     19        (JSObjectMakeFunctionWithCallback):
     20        (JSObjectMakeFunction):
     21        (JSObjectHasProperty):
     22        (JSObjectGetProperty):
     23        (JSObjectSetProperty):
     24        (JSObjectDeleteProperty):
     25        * API/OpaqueJSString.cpp:
     26        * API/OpaqueJSString.h:
     27        * VM/CTI.cpp:
     28        (JSC::CTI::getConstant):
     29        (JSC::CTI::emitGetArg):
     30        (JSC::CTI::emitGetPutArg):
     31        (JSC::CTI::getConstantImmediateNumericArg):
     32        (JSC::CTI::printOpcodeOperandTypes):
     33        (JSC::CTI::CTI):
     34        (JSC::CTI::compileOpCall):
     35        (JSC::CTI::compileBinaryArithOp):
     36        (JSC::CTI::privateCompileMainPass):
     37        (JSC::CTI::privateCompile):
     38        (JSC::CTI::privateCompileGetByIdProto):
     39        (JSC::CTI::privateCompileGetByIdChain):
     40        (JSC::CTI::compileRegExp):
     41        * VM/CTI.h:
     42        * VM/CodeBlock.h:
     43        * VM/CodeGenerator.cpp:
     44        (JSC::CodeGenerator::emitEqualityOp):
     45        (JSC::CodeGenerator::emitLoad):
     46        (JSC::CodeGenerator::emitUnexpectedLoad):
     47        (JSC::CodeGenerator::emitConstruct):
     48        * VM/CodeGenerator.h:
     49        * VM/Machine.cpp:
     50        (JSC::jsLess):
     51        (JSC::jsLessEq):
     52        (JSC::jsAddSlowCase):
     53        (JSC::jsAdd):
     54        (JSC::jsTypeStringForValue):
     55        (JSC::Machine::resolve):
     56        (JSC::Machine::resolveSkip):
     57        (JSC::Machine::resolveGlobal):
     58        (JSC::inlineResolveBase):
     59        (JSC::Machine::resolveBase):
     60        (JSC::Machine::resolveBaseAndProperty):
     61        (JSC::Machine::resolveBaseAndFunc):
     62        (JSC::Machine::slideRegisterWindowForCall):
     63        (JSC::isNotObject):
     64        (JSC::Machine::callEval):
     65        (JSC::Machine::dumpCallFrame):
     66        (JSC::Machine::dumpRegisters):
     67        (JSC::Machine::unwindCallFrame):
     68        (JSC::Machine::throwException):
     69        (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):
     70        (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
     71        (JSC::Machine::execute):
     72        (JSC::Machine::debug):
     73        (JSC::Machine::createExceptionScope):
     74        (JSC::cachePrototypeChain):
     75        (JSC::Machine::tryCachePutByID):
     76        (JSC::Machine::tryCacheGetByID):
     77        (JSC::Machine::privateExecute):
     78        (JSC::Machine::retrieveArguments):
     79        (JSC::Machine::retrieveCaller):
     80        (JSC::Machine::retrieveLastCaller):
     81        (JSC::Machine::findFunctionCallFrame):
     82        (JSC::Machine::getArgumentsData):
     83        (JSC::Machine::tryCTICachePutByID):
     84        (JSC::Machine::getCTIArrayLengthTrampoline):
     85        (JSC::Machine::getCTIStringLengthTrampoline):
     86        (JSC::Machine::tryCTICacheGetByID):
     87        (JSC::Machine::cti_op_convert_this):
     88        (JSC::Machine::cti_op_end):
     89        (JSC::Machine::cti_op_add):
     90        (JSC::Machine::cti_op_pre_inc):
     91        (JSC::Machine::cti_timeout_check):
     92        (JSC::Machine::cti_op_loop_if_less):
     93        (JSC::Machine::cti_op_loop_if_lesseq):
     94        (JSC::Machine::cti_op_new_object):
     95        (JSC::Machine::cti_op_put_by_id):
     96        (JSC::Machine::cti_op_put_by_id_second):
     97        (JSC::Machine::cti_op_put_by_id_generic):
     98        (JSC::Machine::cti_op_put_by_id_fail):
     99        (JSC::Machine::cti_op_get_by_id):
     100        (JSC::Machine::cti_op_get_by_id_second):
     101        (JSC::Machine::cti_op_get_by_id_generic):
     102        (JSC::Machine::cti_op_get_by_id_fail):
     103        (JSC::Machine::cti_op_instanceof):
     104        (JSC::Machine::cti_op_del_by_id):
     105        (JSC::Machine::cti_op_mul):
     106        (JSC::Machine::cti_op_new_func):
     107        (JSC::Machine::cti_op_call_JSFunction):
     108        (JSC::Machine::cti_vm_compile):
     109        (JSC::Machine::cti_op_push_activation):
     110        (JSC::Machine::cti_op_call_NotJSFunction):
     111        (JSC::Machine::cti_op_create_arguments):
     112        (JSC::Machine::cti_op_tear_off_activation):
     113        (JSC::Machine::cti_op_tear_off_arguments):
     114        (JSC::Machine::cti_op_ret_profiler):
     115        (JSC::Machine::cti_op_ret_scopeChain):
     116        (JSC::Machine::cti_op_new_array):
     117        (JSC::Machine::cti_op_resolve):
     118        (JSC::Machine::cti_op_construct_JSConstruct):
     119        (JSC::Machine::cti_op_construct_NotJSConstruct):
     120        (JSC::Machine::cti_op_get_by_val):
     121        (JSC::Machine::cti_op_resolve_func):
     122        (JSC::Machine::cti_op_sub):
     123        (JSC::Machine::cti_op_put_by_val):
     124        (JSC::Machine::cti_op_put_by_val_array):
     125        (JSC::Machine::cti_op_lesseq):
     126        (JSC::Machine::cti_op_loop_if_true):
     127        (JSC::Machine::cti_op_negate):
     128        (JSC::Machine::cti_op_resolve_base):
     129        (JSC::Machine::cti_op_resolve_skip):
     130        (JSC::Machine::cti_op_resolve_global):
     131        (JSC::Machine::cti_op_div):
     132        (JSC::Machine::cti_op_pre_dec):
     133        (JSC::Machine::cti_op_jless):
     134        (JSC::Machine::cti_op_not):
     135        (JSC::Machine::cti_op_jtrue):
     136        (JSC::Machine::cti_op_post_inc):
     137        (JSC::Machine::cti_op_eq):
     138        (JSC::Machine::cti_op_lshift):
     139        (JSC::Machine::cti_op_bitand):
     140        (JSC::Machine::cti_op_rshift):
     141        (JSC::Machine::cti_op_bitnot):
     142        (JSC::Machine::cti_op_resolve_with_base):
     143        (JSC::Machine::cti_op_new_func_exp):
     144        (JSC::Machine::cti_op_mod):
     145        (JSC::Machine::cti_op_less):
     146        (JSC::Machine::cti_op_neq):
     147        (JSC::Machine::cti_op_post_dec):
     148        (JSC::Machine::cti_op_urshift):
     149        (JSC::Machine::cti_op_bitxor):
     150        (JSC::Machine::cti_op_new_regexp):
     151        (JSC::Machine::cti_op_bitor):
     152        (JSC::Machine::cti_op_call_eval):
     153        (JSC::Machine::cti_op_throw):
     154        (JSC::Machine::cti_op_get_pnames):
     155        (JSC::Machine::cti_op_next_pname):
     156        (JSC::Machine::cti_op_push_scope):
     157        (JSC::Machine::cti_op_pop_scope):
     158        (JSC::Machine::cti_op_typeof):
     159        (JSC::Machine::cti_op_to_jsnumber):
     160        (JSC::Machine::cti_op_in):
     161        (JSC::Machine::cti_op_push_new_scope):
     162        (JSC::Machine::cti_op_jmp_scopes):
     163        (JSC::Machine::cti_op_put_by_index):
     164        (JSC::Machine::cti_op_switch_imm):
     165        (JSC::Machine::cti_op_switch_char):
     166        (JSC::Machine::cti_op_switch_string):
     167        (JSC::Machine::cti_op_del_by_val):
     168        (JSC::Machine::cti_op_put_getter):
     169        (JSC::Machine::cti_op_put_setter):
     170        (JSC::Machine::cti_op_new_error):
     171        (JSC::Machine::cti_op_debug):
     172        (JSC::Machine::cti_vm_throw):
     173        * VM/Machine.h:
     174        * VM/Register.h:
     175        * VM/RegisterFile.h:
     176        * kjs/Arguments.h:
     177        * kjs/DebuggerCallFrame.cpp:
     178        (JSC::DebuggerCallFrame::functionName):
     179        (JSC::DebuggerCallFrame::type):
     180        (JSC::DebuggerCallFrame::thisObject):
     181        (JSC::DebuggerCallFrame::evaluate):
     182        * kjs/DebuggerCallFrame.h:
     183        * kjs/ExecState.cpp:
     184        (JSC::CallFrame::thisValue):
     185        * kjs/ExecState.h:
     186        * kjs/FunctionConstructor.cpp:
     187        (JSC::constructFunction):
     188        * kjs/JSActivation.cpp:
     189        (JSC::JSActivation::JSActivation):
     190        (JSC::JSActivation::argumentsGetter):
     191        * kjs/JSActivation.h:
     192        * kjs/JSGlobalObject.cpp:
     193        (JSC::JSGlobalObject::init):
     194        * kjs/JSGlobalObjectFunctions.cpp:
     195        (JSC::globalFuncEval):
     196        * kjs/JSVariableObject.h:
     197        * kjs/Parser.cpp:
     198        (JSC::Parser::parse):
     199        * kjs/RegExpConstructor.cpp:
     200        (JSC::constructRegExp):
     201        * kjs/RegExpPrototype.cpp:
     202        (JSC::regExpProtoFuncCompile):
     203        * kjs/Shell.cpp:
     204        (prettyPrintScript):
     205        * kjs/StringPrototype.cpp:
     206        (JSC::stringProtoFuncMatch):
     207        (JSC::stringProtoFuncSearch):
     208        * kjs/identifier.cpp:
     209        (JSC::Identifier::checkSameIdentifierTable):
     210        * kjs/interpreter.cpp:
     211        (JSC::Interpreter::checkSyntax):
     212        (JSC::Interpreter::evaluate):
     213        * kjs/nodes.cpp:
     214        (JSC::ThrowableExpressionData::emitThrowError):
     215        (JSC::RegExpNode::emitCode):
     216        (JSC::ArrayNode::emitCode):
     217        (JSC::InstanceOfNode::emitCode):
     218        * kjs/nodes.h:
     219        * kjs/regexp.cpp:
     220        (JSC::RegExp::RegExp):
     221        (JSC::RegExp::create):
     222        * kjs/regexp.h:
     223        * profiler/HeavyProfile.h:
     224        * profiler/Profile.h:
     225        * wrec/WREC.cpp:
     226        * wrec/WREC.h:
     227
    12282008-10-08  Prasanth Ullattil  <pullatti@trolltech.com>
    2229
  • trunk/JavaScriptCore/VM/CTI.cpp

    r37417 r37427  
    3535#include "wrec/WREC.h"
    3636#include "ResultType.h"
     37
    3738#if PLATFORM(MAC)
    3839#include <sys/sysctl.h>
     
    4445
    4546#if PLATFORM(MAC)
    46 bool isSSE2Present()
     47
     48static inline bool isSSE2Present()
    4749{
    4850    return true; // All X86 Macs are guaranteed to support at least SSE2
    4951}
    50 #else COMPILER(MSVC)
    51 bool isSSE2Present()
     52
     53#else
     54
     55static bool isSSE2Present()
    5256{
    5357    static const int SSE2FeatureBit = 1 << 26;
     
    7377    return check.present;
    7478}
     79
    7580#endif
     81
     82COMPILE_ASSERT(CTI_ARGS_code == 0xC, CTI_ARGS_code_is_C);
     83COMPILE_ASSERT(CTI_ARGS_callFrame == 0xE, CTI_ARGS_callFrame_is_E);
    7684
    7785#if COMPILER(GCC) && PLATFORM(X86)
     
    8492    "subl $0x24, %esp" "\n"
    8593    "movl $512, %esi" "\n"
    86     "movl 0x38(%esp), %edi" "\n" // Ox38 = 0x0E * 4, 0x0E = CTI_ARGS_r
    87     "call *0x30(%esp)" "\n" // Ox30 = 0x0C * 4, 0x0C = CTI_ARGS_code
     94    "movl 0x38(%esp), %edi" "\n" // Ox38 = 0x0E * 4, 0x0E = CTI_ARGS_callFrame (see assertion above)
     95    "call *0x30(%esp)" "\n" // Ox30 = 0x0C * 4, 0x0C = CTI_ARGS_code (see assertion above)
    8896    "addl $0x24, %esp" "\n"
    8997    "popl %edi" "\n"
     
    115123            mov ecx, esp;
    116124            mov edi, [esp + 0x38];
    117             call [esp + 0x30];
     125            call [esp + 0x30]; // Ox30 = 0x0C * 4, 0x0C = CTI_ARGS_code (see assertion above)
    118126            add esp, 0x24;
    119127            pop edi;
     
    139147#endif
    140148
    141 
    142149ALWAYS_INLINE bool CTI::isConstant(int src)
    143150{
     
    145152}
    146153
    147 ALWAYS_INLINE JSValue* CTI::getConstant(ExecState* exec, int src)
    148 {
    149     return m_codeBlock->constantRegisters[src - m_codeBlock->numVars].jsValue(exec);
     154ALWAYS_INLINE JSValue* CTI::getConstant(CallFrame* callFrame, int src)
     155{
     156    return m_codeBlock->constantRegisters[src - m_codeBlock->numVars].jsValue(callFrame);
    150157}
    151158
     
    155162    // TODO: we want to reuse values that are already in registers if we can - add a register allocator!
    156163    if (isConstant(src)) {
    157         JSValue* js = getConstant(m_exec, src);
     164        JSValue* js = getConstant(m_callFrame, src);
    158165        m_jit.movl_i32r(reinterpret_cast<unsigned>(js), dst);
    159166    } else
     
    165172{
    166173    if (isConstant(src)) {
    167         JSValue* js = getConstant(m_exec, src);
     174        JSValue* js = getConstant(m_callFrame, src);
    168175        m_jit.movl_i32m(reinterpret_cast<unsigned>(js), offset + sizeof(void*), X86::esp);
    169176    } else {
     
    187194{
    188195    if (isConstant(src)) {
    189         JSValue* js = getConstant(m_exec, src);
     196        JSValue* js = getConstant(m_callFrame, src);
    190197        return JSImmediate::isNumber(js) ? js : 0;
    191198    }
     
    250257    char which1 = '*';
    251258    if (isConstant(src1)) {
    252         JSValue* js = getConstant(m_exec, src1);
     259        JSValue* js = getConstant(m_callFrame, src1);
    253260        which1 =
    254261            JSImmediate::isImmediate(js) ?
     
    264271    char which2 = '*';
    265272    if (isConstant(src2)) {
    266         JSValue* js = getConstant(m_exec, src2);
     273        JSValue* js = getConstant(m_callFrame, src2);
    267274        which2 =
    268275            JSImmediate::isImmediate(js) ?
     
    446453}
    447454
    448 CTI::CTI(Machine* machine, ExecState* exec, CodeBlock* codeBlock)
     455CTI::CTI(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock)
    449456    : m_jit(machine->jitCodeBuffer())
    450457    , m_machine(machine)
    451     , m_exec(exec)
     458    , m_callFrame(callFrame)
    452459    , m_codeBlock(codeBlock)
    453460    , m_labels(codeBlock ? codeBlock->instructions.size() : 0)
     
    488495    m_jit.movl_mr(OBJECT_OFFSET(JSFunction, m_scopeChain) + OBJECT_OFFSET(ScopeChain, m_node), X86::ecx, X86::ecx); // newScopeChain
    489496    m_jit.movl_i32m(argCount, RegisterFile::ArgumentCount * static_cast<int>(sizeof(Register)), X86::edx);
    490     m_jit.movl_rm(X86::edi, RegisterFile::CallerRegisters * static_cast<int>(sizeof(Register)), X86::edx);
     497    m_jit.movl_rm(X86::edi, RegisterFile::CallerFrame * static_cast<int>(sizeof(Register)), X86::edx);
    491498    m_jit.movl_rm(X86::ecx, RegisterFile::ScopeChain * static_cast<int>(sizeof(Register)), X86::edx);
    492499}
     
    516523        int thisVal = instruction[i + 3].u.operand;
    517524        if (thisVal == missingThisObjectMarker()) {
    518             // FIXME: should this be loaded dynamically off m_exec?
    519             m_jit.movl_i32m(reinterpret_cast<unsigned>(m_exec->globalThisValue()), firstArg * sizeof(Register), X86::edi);
     525            // FIXME: should this be loaded dynamically off m_callFrame?
     526            m_jit.movl_i32m(reinterpret_cast<unsigned>(m_callFrame->globalThisValue()), firstArg * sizeof(Register), X86::edi);
    520527        } else {
    521528            emitGetArg(thisVal, X86::ecx);
     
    560567    m_jit.movl_mr(OBJECT_OFFSET(CodeBlock, ctiCode), X86::eax, X86::eax);
    561568
    562     // Setup the new value of 'r' in edi, and on the stack, too.
    563     emitPutCTIParam(X86::edx, CTI_ARGS_r);
     569    // Put the new value of 'callFrame' into edi and onto the stack, too.
     570    emitPutCTIParam(X86::edx, CTI_ARGS_callFrame);
    564571    m_jit.movl_rr(X86::edx, X86::edi);
    565572
     
    686693void CTI::compileBinaryArithOp(OpcodeID opcodeID, unsigned dst, unsigned src1, unsigned src2, OperandTypes types, unsigned i)
    687694{
    688     StructureID* numberStructureID = m_exec->globalData().numberStructureID.get();
     695    StructureID* numberStructureID = m_callFrame->globalData().numberStructureID.get();
    689696    X86Assembler::JmpSrc wasJSNumberCell1, wasJSNumberCell1b, wasJSNumberCell2, wasJSNumberCell2b;
    690697
     
    879886            unsigned src = instruction[i + 2].u.operand;
    880887            if (isConstant(src))
    881                 m_jit.movl_i32r(reinterpret_cast<unsigned>(getConstant(m_exec, src)), X86::edx);
     888                m_jit.movl_i32r(reinterpret_cast<unsigned>(getConstant(m_callFrame, src)), X86::edx);
    882889            else
    883890                emitGetArg(src, X86::edx);
     
    12391246
    12401247            // Restore our caller's "r".
    1241             emitGetArg(RegisterFile::CallerRegisters, X86::edi);
    1242             emitPutCTIParam(X86::edi, CTI_ARGS_r);
     1248            emitGetArg(RegisterFile::CallerFrame, X86::edi);
     1249            emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    12431250
    12441251            // Return.
     
    18041811        }
    18051812        case op_catch: {
    1806             emitGetCTIParam(CTI_ARGS_r, X86::edi); // edi := r
     1813            emitGetCTIParam(CTI_ARGS_callFrame, X86::edi); // edi := r
    18071814            emitPutResult(instruction[i + 1].u.operand);
    18081815            i += 2;
     
    26532660    // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a StructureID that is
    26542661    // referencing the prototype object - let's speculatively load it's table nice and early!)
    2655     JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(m_exec));
     2662    JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(m_callFrame));
    26562663    PropertyStorage* protoPropertyStorage = &protoObject->m_propertyStorage;
    26572664    m_jit.movl_mr(static_cast<void*>(protoPropertyStorage), X86::edx);
     
    26962703    // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a StructureID that is
    26972704    // referencing the prototype object - let's speculatively load it's table nice and early!)
    2698     JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(m_exec));
     2705    JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(m_callFrame));
    26992706    PropertyStorage* protoPropertyStorage = &protoObject->m_propertyStorage;
    27002707    m_jit.movl_mr(static_cast<void*>(protoPropertyStorage), X86::edx);
     
    27452752    JSObject* protoObject = 0;
    27462753    for (unsigned i = 0; i<count; ++i) {
    2747         protoObject = static_cast<JSObject*>(currStructureID->prototypeForLookup(m_exec));
     2754        protoObject = static_cast<JSObject*>(currStructureID->prototypeForLookup(m_callFrame));
    27482755        currStructureID = chainEntries[i].get();
    27492756
     
    30453052#if ENABLE(WREC)
    30463053
    3047 void* CTI::compileRegExp(ExecState* exec, const UString& pattern, unsigned* numSubpatterns_ptr, const char** error_ptr, bool ignoreCase, bool multiline)
     3054void* CTI::compileRegExp(Machine* machine, const UString& pattern, unsigned* numSubpatterns_ptr, const char** error_ptr, bool ignoreCase, bool multiline)
    30483055{
    30493056    // TODO: better error messages
     
    30533060    }
    30543061
    3055     X86Assembler jit(exec->machine()->jitCodeBuffer());
     3062    X86Assembler jit(machine->jitCodeBuffer());
    30563063    WRECParser parser(pattern, ignoreCase, multiline, jit);
    30573064   
  • trunk/JavaScriptCore/VM/CTI.h

    r37406 r37427  
    4848#define CTI_ARGS_code 0x0C
    4949#define CTI_ARGS_registerFile 0x0D
    50 #define CTI_ARGS_r 0x0E
     50#define CTI_ARGS_callFrame 0x0E
    5151#define CTI_ARGS_exception 0x0F
    5252#define CTI_ARGS_profilerReference 0x10
    5353#define CTI_ARGS_globalData 0x11
    5454#define ARG_registerFile ((RegisterFile*)(ARGS)[CTI_ARGS_registerFile])
    55 #define ARG_r ((Register*)(ARGS)[CTI_ARGS_r])
     55#define ARG_callFrame ((CallFrame*)(ARGS)[CTI_ARGS_callFrame])
    5656#define ARG_exception ((JSValue**)(ARGS)[CTI_ARGS_exception])
    5757#define ARG_profilerReference ((Profiler**)(ARGS)[CTI_ARGS_profilerReference])
    5858#define ARG_globalData ((JSGlobalData*)(ARGS)[CTI_ARGS_globalData])
    5959
    60 #define ARG_exec CallFrame::create(ARG_r)
    61 
    62 #define ARG_setR(newR) (*(Register**)&(ARGS)[CTI_ARGS_r] = newR)
     60#define ARG_setCallFrame(newCallFrame) (*(CallFrame**)&(ARGS)[CTI_ARGS_callFrame] = (newCallFrame))
    6361
    6462#define ARG_src1 ((JSValue*)((ARGS)[1]))
     
    9391
    9492    class CodeBlock;
    95     class ExecState;
    9693    class JSPropertyNameIterator;
    9794    class JSValue;
     
    250247
    251248    extern "C" {
    252         JSValue* ctiTrampoline(void* code, RegisterFile*, Register* callFrame, JSValue** exception, Profiler**, JSGlobalData*);
     249        JSValue* ctiTrampoline(void* code, RegisterFile*, CallFrame*, JSValue** exception, Profiler**, JSGlobalData*);
    253250        void ctiVMThrowTrampoline();
    254251    };
     
    284281
    285282    public:
    286         static void compile(Machine* machine, ExecState* exec, CodeBlock* codeBlock)
    287         {
    288             CTI cti(machine, exec, codeBlock);
     283        static void compile(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock)
     284        {
     285            CTI cti(machine, callFrame, codeBlock);
    289286            cti.privateCompile();
    290287        }
    291288
    292289#if ENABLE(WREC)
    293         static void* compileRegExp(ExecState* exec, const UString& pattern, unsigned* numSubpatterns_ptr, const char** error_ptr, bool ignoreCase = false, bool multiline = false);
    294 #endif
    295 
    296         static void compileGetByIdSelf(Machine* machine, ExecState* exec, CodeBlock* codeBlock, StructureID* structureID, size_t cachedOffset, void* returnAddress)
    297         {
    298             CTI cti(machine, exec, codeBlock);
     290        static void* compileRegExp(Machine*, const UString& pattern, unsigned* numSubpatterns_ptr, const char** error_ptr, bool ignoreCase = false, bool multiline = false);
     291#endif
     292
     293        static void compileGetByIdSelf(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock, StructureID* structureID, size_t cachedOffset, void* returnAddress)
     294        {
     295            CTI cti(machine, callFrame, codeBlock);
    299296            cti.privateCompileGetByIdSelf(structureID, cachedOffset, returnAddress);
    300297        }
    301298
    302         static void compileGetByIdProto(Machine* machine, ExecState* exec, CodeBlock* codeBlock, StructureID* structureID, StructureID* prototypeStructureID, size_t cachedOffset, void* returnAddress)
    303         {
    304             CTI cti(machine, exec, codeBlock);
     299        static void compileGetByIdProto(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock, StructureID* structureID, StructureID* prototypeStructureID, size_t cachedOffset, void* returnAddress)
     300        {
     301            CTI cti(machine, callFrame, codeBlock);
    305302            cti.privateCompileGetByIdProto(structureID, prototypeStructureID, cachedOffset, returnAddress);
    306303        }
    307304
    308         static void compileGetByIdChain(Machine* machine, ExecState* exec, CodeBlock* codeBlock, StructureID* structureID, StructureIDChain* chain, size_t count, size_t cachedOffset, void* returnAddress)
    309         {
    310             CTI cti(machine, exec, codeBlock);
     305        static void compileGetByIdChain(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock, StructureID* structureID, StructureIDChain* chain, size_t count, size_t cachedOffset, void* returnAddress)
     306        {
     307            CTI cti(machine, callFrame, codeBlock);
    311308            cti.privateCompileGetByIdChain(structureID, chain, count, cachedOffset, returnAddress);
    312309        }
    313310
    314         static void compilePutByIdReplace(Machine* machine, ExecState* exec, CodeBlock* codeBlock, StructureID* structureID, size_t cachedOffset, void* returnAddress)
    315         {
    316             CTI cti(machine, exec, codeBlock);
     311        static void compilePutByIdReplace(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock, StructureID* structureID, size_t cachedOffset, void* returnAddress)
     312        {
     313            CTI cti(machine, callFrame, codeBlock);
    317314            cti.privateCompilePutByIdReplace(structureID, cachedOffset, returnAddress);
    318315        }
    319316       
    320         static void compilePutByIdTransition(Machine* machine, ExecState* exec, CodeBlock* codeBlock, StructureID* oldStructureID, StructureID* newStructureID, size_t cachedOffset, StructureIDChain* sIDC, void* returnAddress)
    321         {
    322             CTI cti(machine, exec, codeBlock);
     317        static void compilePutByIdTransition(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock, StructureID* oldStructureID, StructureID* newStructureID, size_t cachedOffset, StructureIDChain* sIDC, void* returnAddress)
     318        {
     319            CTI cti(machine, callFrame, codeBlock);
    323320            cti.privateCompilePutByIdTransition(oldStructureID, newStructureID, cachedOffset, sIDC, returnAddress);
    324321        }
    325322
    326         static void* compileArrayLengthTrampoline(Machine* machine, ExecState* exec, CodeBlock* codeBlock)
    327         {
    328             CTI cti(machine, exec, codeBlock);
     323        static void* compileArrayLengthTrampoline(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock)
     324        {
     325            CTI cti(machine, callFrame, codeBlock);
    329326            return cti.privateCompileArrayLengthTrampoline();
    330327        }
    331328
    332         static void* compileStringLengthTrampoline(Machine* machine, ExecState* exec, CodeBlock* codeBlock)
    333         {
    334             CTI cti(machine, exec, codeBlock);
     329        static void* compileStringLengthTrampoline(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock)
     330        {
     331            CTI cti(machine, callFrame, codeBlock);
    335332            return cti.privateCompileStringLengthTrampoline();
    336333        }
     
    339336        static void patchPutByIdReplace(CodeBlock* codeBlock, StructureID* structureID, size_t cachedOffset, void* returnAddress);
    340337
    341         static void compilePatchGetArrayLength(Machine* machine, ExecState* exec, CodeBlock* codeBlock, void* returnAddress)
    342         {
    343             CTI cti(machine, exec, codeBlock);
     338        static void compilePatchGetArrayLength(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress)
     339        {
     340            CTI cti(machine, callFrame, codeBlock);
    344341            return cti.privateCompilePatchGetArrayLength(returnAddress);
    345342        }
    346343
    347         inline static JSValue* execute(void* code, RegisterFile* registerFile, Register* r, JSGlobalData* globalData, JSValue** exception)
    348         {
    349             return ctiTrampoline(code, registerFile, r, exception, Profiler::enabledProfilerReference(), globalData);
     344        inline static JSValue* execute(void* code, RegisterFile* registerFile, CallFrame* callFrame, JSGlobalData* globalData, JSValue** exception)
     345        {
     346            return ctiTrampoline(code, registerFile, callFrame, exception, Profiler::enabledProfilerReference(), globalData);
    350347        }
    351348
    352349    private:
    353         CTI(Machine*, ExecState*, CodeBlock*);
     350        CTI(Machine*, CallFrame*, CodeBlock*);
    354351       
    355352        bool isConstant(int src);
    356         JSValue* getConstant(ExecState*, int src);
     353        JSValue* getConstant(CallFrame*, int src);
    357354
    358355        void privateCompileMainPass();
     
    430427        X86Assembler m_jit;
    431428        Machine* m_machine;
    432         ExecState* m_exec;
     429        CallFrame* m_callFrame;
    433430        CodeBlock* m_codeBlock;
    434431
  • trunk/JavaScriptCore/VM/CodeBlock.h

    r37320 r37427  
    162162               
    163163                SourceCode source = makeSource(evalSource);
    164                 evalNode = exec->parser()->parse<EvalNode>(exec, source, &errLine, &errMsg);
     164                evalNode = exec->globalData().parser->parse<EvalNode>(exec, source, &errLine, &errMsg);
    165165                if (evalNode) {
    166166                    if (evalSource.size() < maxCacheableSourceLength && (*scopeChain->begin())->isVariableObject() && cacheMap.size() < maxCacheEntries)
  • trunk/JavaScriptCore/VM/CodeGenerator.cpp

    r37366 r37427  
    719719            && src1->isTemporary()
    720720            && static_cast<unsigned>(src2->index()) < m_codeBlock->constantRegisters.size()
    721             && m_codeBlock->constantRegisters[src2->index()].jsValue(globalExec())->isString()) {
    722             const UString& value = static_cast<JSString*>(m_codeBlock->constantRegisters[src2->index()].jsValue(globalExec()))->value();
     721            && m_codeBlock->constantRegisters[src2->index()].jsValue(m_scopeChain->globalObject()->globalExec())->isString()) {
     722            const UString& value = static_cast<JSString*>(m_codeBlock->constantRegisters[src2->index()].jsValue(m_scopeChain->globalObject()->globalExec()))->value();
    723723            if (value == "undefined") {
    724724                rewindUnaryOp();
     
    783783    // Later we can do the extra work to handle that like the other cases.
    784784    if (number == HashTraits<double>::emptyValue() || HashTraits<double>::isDeletedValue(number))
    785         return emitLoad(dst, jsNumber(globalExec(), number));
     785        return emitLoad(dst, jsNumber(globalData(), number));
    786786    JSValue*& valueInMap = m_numberMap.add(number, 0).first->second;
    787787    if (!valueInMap)
    788         valueInMap = jsNumber(globalExec(), number);
     788        valueInMap = jsNumber(globalData(), number);
    789789    return emitLoad(dst, valueInMap);
    790790}
     
    794794    JSString*& valueInMap = m_stringMap.add(identifier.ustring().rep(), 0).first->second;
    795795    if (!valueInMap)
    796         valueInMap = jsOwnedString(globalExec(), identifier.ustring());
     796        valueInMap = jsOwnedString(globalData(), identifier.ustring());
    797797    return emitLoad(dst, valueInMap);
    798798}
     
    818818    emitOpcode(op_unexpected_load);
    819819    instructions().append(dst->index());
    820     instructions().append(addUnexpectedConstant(jsNumber(globalExec(), d)));
     820    instructions().append(addUnexpectedConstant(jsNumber(globalData(), d)));
    821821    return dst;
    822822}
     
    11891189    emitExpressionInfo(divot, startOffset, endOffset);
    11901190    RefPtr<RegisterID> funcProto = newTemporary();
    1191     emitGetById(funcProto.get(), func, globalExec()->propertyNames().prototype);
     1191    emitGetById(funcProto.get(), func, globalData()->propertyNames->prototype);
    11921192
    11931193    // Generate code for arguments.
  • trunk/JavaScriptCore/VM/CodeGenerator.h

    r37366 r37427  
    321321        CodeType codeType() const { return m_codeType; }
    322322
    323         ExecState* globalExec() { return m_scopeChain->globalObject()->globalExec(); }
    324 
    325323    private:
    326324        void emitOpcode(OpcodeID);
  • trunk/JavaScriptCore/VM/Machine.cpp

    r37422 r37427  
    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;
     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)
     
    929915    Profiler** profiler = Profiler::enabledProfilerReference();
    930916    if (*profiler)
    931         (*profiler)->willExecute(exec, programNode->sourceURL(), programNode->lineNo());
     917        (*profiler)->willExecute(callFrame, 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, callFrame, codeBlock);
     923    JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, callFrame, scopeChain->globalData, exception);
    938924#else
    939     JSValue* result = privateExecute(Normal, &m_registerFile, r, exception);
     925    JSValue* result = privateExecute(Normal, &m_registerFile, callFrame, 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    callFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc);
     970    if (UNLIKELY(!callFrame)) {
     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    callFrame->init(codeBlock, 0, scopeChain, newCallFrame->addHostCallFrameFlag(), 0, argc, function);
    992977
    993978    Profiler** profiler = Profiler::enabledProfilerReference();
    994979    if (*profiler)
    995         (*profiler)->willExecute(exec, function);
     980        (*profiler)->willExecute(callFrame, 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, callFrame, codeBlock);
     986    JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, callFrame, scopeChain->globalData, exception);
    1002987#else
    1003     JSValue* result = privateExecute(Normal, &m_registerFile, r, exception);
     988    JSValue* result = privateExecute(Normal, &m_registerFile, callFrame, 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)
     
    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(JSImmediate::isNumber(srcVal) || static_cast<JSCell*>(srcVal)->structureID()->typeInfo().type() == NumberType)) {
    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);
    3376 
    33773352        ++vPC;
    33783353        NEXT_OPCODE;
    33793354    }
    33803355    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();
     3356        ASSERT(callFrame->codeBlock()->usesArguments && !callFrame->codeBlock()->needsFullScopeChain);
     3357
     3358        callFrame->optionalCalleeArguments()->copyRegisters();
    33863359
    33873360        ++vPC;
     
    34013374
    34023375        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();
     3376            (*enabledProfilerReference)->didExecute(callFrame, callFrame->callee());
     3377
     3378        if (callFrame->codeBlock()->needsFullScopeChain)
     3379            callFrame->scopeChain()->deref();
     3380
     3381        JSValue* returnValue = callFrame[result].jsValue(callFrame);
     3382
     3383        vPC = callFrame->returnPC();
     3384        int dst = callFrame->returnValueRegister();
     3385        callFrame = callFrame->callerFrame();
    34133386       
    3414         if (isHostCallFrame(r))
     3387        if (callFrame->hasHostCallFrameFlag())
    34153388            return returnValue;
    34163389
    3417         r[dst] = returnValue;
     3390        callFrame[dst] = returnValue;
    34183391
    34193392        NEXT_OPCODE;
     
    34313404
    34323405        size_t i = 0;
    3433         CodeBlock* codeBlock = this->codeBlock(r);
     3406        CodeBlock* codeBlock = callFrame->codeBlock();
    34343407       
    34353408        for (size_t count = codeBlock->numVars; i < count; ++i)
    3436             r[i] = jsUndefined();
     3409            callFrame[i] = jsUndefined();
    34373410
    34383411        for (size_t count = codeBlock->constantRegisters.size(), j = 0; j < count; ++i, ++j)
    3439             r[i] = codeBlock->constantRegisters[j];
     3412            callFrame[i] = codeBlock->constantRegisters[j];
    34403413
    34413414        ++vPC;
     
    34563429
    34573430        size_t i = 0;
    3458         CodeBlock* codeBlock = this->codeBlock(r);
     3431        CodeBlock* codeBlock = callFrame->codeBlock();
    34593432
    34603433        for (size_t count = codeBlock->numVars; i < count; ++i)
    3461             r[i] = jsUndefined();
     3434            callFrame[i] = jsUndefined();
    34623435
    34633436        for (size_t count = codeBlock->constantRegisters.size(), j = 0; j < count; ++i, ++j)
    3464             r[i] = codeBlock->constantRegisters[j];
     3437            callFrame[i] = codeBlock->constantRegisters[j];
    34653438
    34663439        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);
     3440        JSActivation* activation = new (globalData) JSActivation(callFrame, static_cast<FunctionBodyNode*>(codeBlock->ownerNode));
     3441        callFrame[dst] = activation;
     3442        callFrame->setScopeChain(callFrame->scopeChain()->copy()->push(activation));
    34703443
    34713444        ++vPC;
     
    34743447    BEGIN_OPCODE(op_convert_this) {
    34753448        int thisRegister = (++vPC)->u.operand;
    3476         JSValue* thisVal = r[thisRegister].getJSValue();
     3449        JSValue* thisVal = callFrame[thisRegister].getJSValue();
    34773450        if (thisVal->needsThisConversion())
    3478             r[thisRegister] = thisVal->toThisObject(exec);
     3451            callFrame[thisRegister] = thisVal->toThisObject(callFrame);
    34793452
    34803453        ++vPC;
     
    34923465        */
    34933466
    3494         Arguments* arguments = new (globalData) Arguments(exec, r);
    3495         r[RegisterFile::OptionalCalleeArguments] = arguments;
    3496         r[RegisterFile::ArgumentsRegister] = arguments;
     3467        Arguments* arguments = new (globalData) Arguments(callFrame);
     3468        callFrame->setCalleeArguments(arguments);
     3469        callFrame[RegisterFile::ArgumentsRegister] = arguments;
    34973470       
    34983471        ++vPC;
     
    35213494        int registerOffset = (++vPC)->u.operand;
    35223495
    3523         JSValue* v = r[constr].jsValue(exec);
     3496        JSValue* v = callFrame[constr].jsValue(callFrame);
    35243497
    35253498        ConstructData constructData;
     
    35283501        if (constructType == ConstructTypeJS) {
    35293502            if (*enabledProfilerReference)
    3530                 (*enabledProfilerReference)->willExecute(exec, static_cast<JSObject*>(v));
     3503                (*enabledProfilerReference)->willExecute(callFrame, static_cast<JSObject*>(v));
    35313504
    35323505            ScopeChainNode* callDataScopeChain = constructData.js.scopeChain;
     
    35353508
    35363509            StructureID* structure;
    3537             JSValue* prototype = r[constrProto].jsValue(exec);
     3510            JSValue* prototype = callFrame[constrProto].jsValue(callFrame);
    35383511            if (prototype->isObject())
    35393512                structure = static_cast<JSObject*>(prototype)->inheritorID();
     
    35423515            JSObject* newObject = new (globalData) JSObject(structure);
    35433516
    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));
     3517            callFrame[firstArg] = newObject; // "this" value
     3518
     3519            CallFrame* previousCallFrame = callFrame;
     3520
     3521            callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount);
     3522            if (UNLIKELY(!callFrame)) {
     3523                callFrame = previousCallFrame;
     3524                exceptionValue = createStackOverflowError(callFrame);
    35523525                goto vm_throw;
    35533526            }
    35543527
    3555             initializeCallFrame(r, newCodeBlock, vPC + 1, callDataScopeChain, savedR, dst, argCount, v);
     3528            callFrame->init(newCodeBlock, vPC + 1, callDataScopeChain, previousCallFrame, dst, argCount, static_cast<JSFunction*>(v));
    35563529   
    35573530            if (*enabledProfilerReference)
    3558                 (*enabledProfilerReference)->didExecute(exec, static_cast<JSObject*>(v));
     3531                (*enabledProfilerReference)->didExecute(callFrame, static_cast<JSObject*>(v));
    35593532
    35603533            vPC = newCodeBlock->instructions.begin();
     
    35683541
    35693542        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;
     3543            ArgList args(callFrame->registers() + firstArg + 1, argCount - 1);
     3544
     3545            ScopeChainNode* scopeChain = callFrame->scopeChain();
     3546            CallFrame::create(callFrame->registers() + registerOffset)->init(0, vPC + 1, scopeChain, callFrame, dst, argCount, static_cast<JSFunction*>(v));
     3547            callFrame = CallFrame::create(callFrame->registers() + registerOffset);
    35753548
    35763549            if (*enabledProfilerReference)
    3577                 (*enabledProfilerReference)->willExecute(exec, static_cast<JSObject*>(v));
     3550                (*enabledProfilerReference)->willExecute(callFrame, static_cast<JSObject*>(v));
    35783551
    35793552            MACHINE_SAMPLING_callingHostFunction();
    35803553
    3581             JSValue* returnValue = constructData.native.function(exec, static_cast<JSObject*>(v), args);
    3582             r -= registerOffset;
     3554            JSValue* returnValue = constructData.native.function(callFrame, static_cast<JSObject*>(v), args);
     3555            callFrame = CallFrame::create(callFrame->registers() - registerOffset);
    35833556
    35843557            VM_CHECK_EXCEPTION();
    3585             r[dst] = returnValue;
     3558            callFrame[dst] = returnValue;
    35863559
    35873560            if (*enabledProfilerReference)
    3588                 (*enabledProfilerReference)->didExecute(exec, static_cast<JSObject*>(v));
     3561                (*enabledProfilerReference)->didExecute(callFrame, static_cast<JSObject*>(v));
    35893562
    35903563            ++vPC;
     
    35943567        ASSERT(constructType == ConstructTypeNone);
    35953568
    3596         exceptionValue = createNotAConstructorError(exec, v, vPC, codeBlock(r));
     3569        exceptionValue = createNotAConstructorError(callFrame, v, vPC, callFrame->codeBlock());
    35973570        goto vm_throw;
    35983571    }
     
    36053578
    36063579        int dst = vPC[1].u.operand;;
    3607         if (LIKELY(r[dst].jsValue(exec)->isObject())) {
     3580        if (LIKELY(callFrame[dst].jsValue(callFrame)->isObject())) {
    36083581            vPC += 3;
    36093582            NEXT_OPCODE;
     
    36113584
    36123585        int override = vPC[2].u.operand;
    3613         r[dst] = r[override];
     3586        callFrame[dst] = callFrame[override];
    36143587
    36153588        vPC += 3;
     
    36233596        */
    36243597        int scope = (++vPC)->u.operand;
    3625         JSValue* v = r[scope].jsValue(exec);
    3626         JSObject* o = v->toObject(exec);
     3598        JSValue* v = callFrame[scope].jsValue(callFrame);
     3599        JSObject* o = v->toObject(callFrame);
    36273600        VM_CHECK_EXCEPTION();
    36283601
    3629         r[RegisterFile::ScopeChain] = scopeChain(r)->push(o);
     3602        callFrame->setScopeChain(callFrame->scopeChain()->push(o));
    36303603
    36313604        ++vPC;
     
    36373610           Removes the top item from the current scope chain.
    36383611        */
    3639         r[RegisterFile::ScopeChain] = scopeChain(r)->pop();
     3612        callFrame->setScopeChain(callFrame->scopeChain()->pop());
    36403613
    36413614        ++vPC;
     
    36533626        int base = (++vPC)->u.operand;
    36543627
    3655         r[dst] = JSPropertyNameIterator::create(exec, r[base].jsValue(exec));
     3628        callFrame[dst] = JSPropertyNameIterator::create(callFrame, callFrame[base].jsValue(callFrame));
    36563629        ++vPC;
    36573630        NEXT_OPCODE;
     
    36703643        int target = (++vPC)->u.operand;
    36713644
    3672         JSPropertyNameIterator* it = r[iter].jsPropertyNameIterator();
    3673         if (JSValue* temp = it->next(exec)) {
     3645        JSPropertyNameIterator* it = callFrame[iter].propertyNameIterator();
     3646        if (JSValue* temp = it->next(callFrame)) {
    36743647            CHECK_FOR_TIMEOUT();
    3675             r[dst] = temp;
     3648            callFrame[dst] = temp;
    36763649            vPC += target;
    36773650            NEXT_OPCODE;
     
    36923665        int target = (++vPC)->u.operand;
    36933666
    3694         ScopeChainNode* tmp = scopeChain(r);
     3667        ScopeChainNode* tmp = callFrame->scopeChain();
    36953668        while (count--)
    36963669            tmp = tmp->pop();
    3697         r[RegisterFile::ScopeChain] = tmp;
     3670        callFrame->setScopeChain(tmp);
    36983671
    36993672        vPC += target;
     
    37113684           in dst for GC.
    37123685         */
    3713         r[RegisterFile::ScopeChain] = createExceptionScope(exec, vPC, r);
     3686        callFrame->setScopeChain(createExceptionScope(callFrame, vPC));
    37143687
    37153688        vPC += 4;
     
    37273700        */
    37283701        ASSERT(exceptionValue);
    3729         ASSERT(!exec->hadException());
     3702        ASSERT(!globalData->exception);
    37303703        int ex = (++vPC)->u.operand;
    3731         r[ex] = exceptionValue;
     3704        callFrame[ex] = exceptionValue;
    37323705        exceptionValue = 0;
    37333706
     
    37473720
    37483721        int ex = (++vPC)->u.operand;
    3749         exceptionValue = r[ex].jsValue(exec);
    3750 
    3751         handlerVPC = throwException(exec, exceptionValue, vPC, r, true);
     3722        exceptionValue = callFrame[ex].jsValue(callFrame);
     3723
     3724        handlerVPC = throwException(callFrame, exceptionValue, vPC, true);
    37523725        if (!handlerVPC) {
    37533726            *exception = exceptionValue;
     
    37743747        int dst = (++vPC)->u.operand;
    37753748        int src = (++vPC)->u.operand;
    3776         r[dst] = codeBlock(r)->unexpectedConstants[src];
     3749        callFrame[dst] = callFrame->codeBlock()->unexpectedConstants[src];
    37773750
    37783751        ++vPC;
     
    37913764        int message = (++vPC)->u.operand;
    37923765
    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());
     3766        CodeBlock* codeBlock = callFrame->codeBlock();
     3767        callFrame[dst] = Error::create(callFrame, (ErrorType)type, codeBlock->unexpectedConstants[message]->toString(callFrame), codeBlock->lineNumberForVPC(vPC), codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL());
    37953768
    37963769        ++vPC;
     
    38043777        */
    38053778
    3806         if (codeBlock(r)->needsFullScopeChain) {
    3807             ScopeChainNode* scopeChain = this->scopeChain(r);
     3779        if (callFrame->codeBlock()->needsFullScopeChain) {
     3780            ScopeChainNode* scopeChain = callFrame->scopeChain();
    38083781            ASSERT(scopeChain->refCount > 1);
    38093782            scopeChain->deref();
    38103783        }
    38113784        int result = (++vPC)->u.operand;
    3812         return r[result].jsValue(exec);
     3785        return callFrame[result].jsValue(callFrame);
    38133786    }
    38143787    BEGIN_OPCODE(op_put_getter) {
     
    38273800        int function = (++vPC)->u.operand;
    38283801
    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)));
     3802        ASSERT(callFrame[base].jsValue(callFrame)->isObject());
     3803        JSObject* baseObj = static_cast<JSObject*>(callFrame[base].jsValue(callFrame));
     3804        Identifier& ident = callFrame->codeBlock()->identifiers[property];
     3805        ASSERT(callFrame[function].jsValue(callFrame)->isObject());
     3806        baseObj->defineGetter(callFrame, ident, static_cast<JSObject*>(callFrame[function].jsValue(callFrame)));
    38343807
    38353808        ++vPC;
     
    38513824        int function = (++vPC)->u.operand;
    38523825
    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)));
     3826        ASSERT(callFrame[base].jsValue(callFrame)->isObject());
     3827        JSObject* baseObj = static_cast<JSObject*>(callFrame[base].jsValue(callFrame));
     3828        Identifier& ident = callFrame->codeBlock()->identifiers[property];
     3829        ASSERT(callFrame[function].jsValue(callFrame)->isObject());
     3830        baseObj->defineSetter(callFrame, ident, static_cast<JSObject*>(callFrame[function].jsValue(callFrame)));
    38583831
    38593832        ++vPC;
     
    38683841        int retAddrDst = (++vPC)->u.operand;
    38693842        int target = (++vPC)->u.operand;
    3870         r[retAddrDst] = vPC + 1;
     3843        callFrame[retAddrDst] = vPC + 1;
    38713844
    38723845        vPC += target;
     
    38813854        */
    38823855        int retAddrSrc = (++vPC)->u.operand;
    3883         vPC = r[retAddrSrc].vPC();
     3856        vPC = callFrame[retAddrSrc].vPC();
    38843857        NEXT_OPCODE;
    38853858    }
     
    38943867        int lastLine = (++vPC)->u.operand;
    38953868
    3896         debug(exec, r, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
     3869        debug(callFrame, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
    38973870
    38983871        ++vPC;
     
    39063879            exceptionValue = createInterruptedExecutionException(globalData);
    39073880        }
    3908         handlerVPC = throwException(exec, exceptionValue, vPC, r, false);
     3881        handlerVPC = throwException(callFrame, exceptionValue, vPC, false);
    39093882        if (!handlerVPC) {
    39103883            *exception = exceptionValue;
     
    39223895    #undef VM_CHECK_EXCEPTION
    39233896    #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)
     3897}
     3898
     3899JSValue* Machine::retrieveArguments(CallFrame* callFrame, JSFunction* function) const
     3900{
     3901    CallFrame* functionCallFrame = findFunctionCallFrame(callFrame, function);
     3902    if (!functionCallFrame)
    39313903        return jsNull();
    39323904
    3933     CodeBlock* codeBlock = Machine::codeBlock(r);
     3905    CodeBlock* codeBlock = functionCallFrame->codeBlock();
    39343906    if (codeBlock->usesArguments) {
    39353907        ASSERT(codeBlock->codeType == FunctionCode);
    39363908        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());
     3909        int argumentsIndex = symbolTable.get(functionCallFrame->propertyNames().arguments.ustring().rep()).getIndex();
     3910        return functionCallFrame[argumentsIndex].jsValue(callFrame);
     3911    }
     3912
     3913    Arguments* arguments = functionCallFrame->optionalCalleeArguments();
    39423914    if (!arguments) {
    3943         arguments = new (exec) Arguments(exec, r);
     3915        arguments = new (functionCallFrame) Arguments(functionCallFrame);
    39443916        arguments->copyRegisters();
    3945         r[RegisterFile::OptionalCalleeArguments] = arguments;
    3946     }
    3947     ASSERT(arguments->isObject(&Arguments::info));
     3917        callFrame->setCalleeArguments(arguments);
     3918    }
    39483919
    39493920    return arguments;
    39503921}
    39513922
    3952 JSValue* Machine::retrieveCaller(ExecState* exec, InternalFunction* function) const
    3953 {
    3954     Register* r = this->callFrame(exec, function);
    3955     if (!r)
     3923JSValue* Machine::retrieveCaller(CallFrame* callFrame, InternalFunction* function) const
     3924{
     3925    CallFrame* functionCallFrame = findFunctionCallFrame(callFrame, function);
     3926    if (!functionCallFrame)
    39563927        return jsNull();
    39573928
    3958     Register* callerR = r[RegisterFile::CallerRegisters].r();
    3959     if (isHostCallFrame(callerR))
     3929    CallFrame* callerFrame = functionCallFrame->callerFrame();
     3930    if (callerFrame->hasHostCallFrameFlag())
    39603931        return jsNull();
    39613932
    3962     JSValue* caller = callerR[RegisterFile::Callee].jsValue(exec);
     3933    JSValue* caller = callerFrame->callee();
    39633934    if (!caller)
    39643935        return jsNull();
     
    39673938}
    39683939
    3969 void Machine::retrieveLastCaller(ExecState* exec, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const
     3940void Machine::retrieveLastCaller(CallFrame* callFrame, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const
    39703941{
    39713942    function = 0;
     
    39733944    sourceURL = UString();
    39743945
    3975     Register* r = exec->registers();
    3976     Register* callerR = r[RegisterFile::CallerRegisters].r();
    3977     if (isHostCallFrame(callerR))
     3946    CallFrame* callerFrame = callFrame->callerFrame();
     3947    if (callerFrame->hasHostCallFrameFlag())
    39783948        return;
    39793949
    3980     CodeBlock* callerCodeBlock = codeBlock(callerR);
     3950    CodeBlock* callerCodeBlock = callerFrame->codeBlock();
    39813951    if (!callerCodeBlock)
    39823952        return;
    39833953
    3984     Instruction* vPC = vPCForPC(callerCodeBlock, r[RegisterFile::ReturnPC].v());
     3954    Instruction* vPC = vPCForPC(callerCodeBlock, callFrame->returnPC());
    39853955    lineNumber = callerCodeBlock->lineNumberForVPC(vPC - 1);
    39863956    sourceID = callerCodeBlock->ownerNode->sourceID();
    39873957    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;
     3958    function = callerFrame->callee();
     3959}
     3960
     3961CallFrame* Machine::findFunctionCallFrame(CallFrame* callFrame, InternalFunction* function)
     3962{
     3963    for (CallFrame* candidate = callFrame; candidate; candidate = candidate->callerFrame()->removeHostCallFrameFlag()) {
     3964        if (candidate->callee() == function)
     3965            return candidate;
     3966    }
    40013967    return 0;
    40023968}
    40033969
    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));
     3970void Machine::getArgumentsData(CallFrame* callFrame, JSFunction*& function, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc)
     3971{
     3972    function = callFrame->callee();
    40083973   
    40093974    CodeBlock* codeBlock = &function->m_body->generatedByteCode();
    40103975    int numParameters = codeBlock->numParameters;
    4011     argc = callFrame[RegisterFile::ArgumentCount].i();
     3976    argc = callFrame->argumentCount();
    40123977
    40133978    if (argc <= numParameters)
    4014         argv = callFrame - RegisterFile::CallFrameHeaderSize - numParameters + 1; // + 1 to skip "this"
     3979        argv = callFrame->registers() - RegisterFile::CallFrameHeaderSize - numParameters + 1; // + 1 to skip "this"
    40153980    else
    4016         argv = callFrame - RegisterFile::CallFrameHeaderSize - numParameters - argc + 1; // + 1 to skip "this"
     3981        argv = callFrame->registers() - RegisterFile::CallFrameHeaderSize - numParameters - argc + 1; // + 1 to skip "this"
    40173982
    40183983    argc -= 1; // - 1 to skip "this"
     
    40273992}
    40283993
    4029 NEVER_INLINE void Machine::tryCTICachePutByID(ExecState* exec, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const PutPropertySlot& slot)
     3994NEVER_INLINE void Machine::tryCTICachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const PutPropertySlot& slot)
    40303995{
    40313996    // The interpreter checks for recursion here; I do not believe this can occur in CTI.
     
    40694034        StructureIDChain* chain = structureID->cachedPrototypeChain();
    40704035        if (!chain) {
    4071             chain = cachePrototypeChain(exec, structureID);
     4036            chain = cachePrototypeChain(callFrame, structureID);
    40724037            if (!chain) {
    40734038                // This happens if someone has manually inserted null into the prototype chain
     
    40794044        vPC[7] = slot.cachedOffset();
    40804045        codeBlock->refStructureIDs(vPC);
    4081         CTI::compilePutByIdTransition(this, exec, codeBlock, structureID->previousID(), structureID, slot.cachedOffset(), chain, returnAddress);
     4046        CTI::compilePutByIdTransition(this, callFrame, codeBlock, structureID->previousID(), structureID, slot.cachedOffset(), chain, returnAddress);
    40824047        return;
    40834048    }
     
    40894054
    40904055#if USE(CTI_REPATCH_PIC)
    4091     UNUSED_PARAM(exec);
     4056    UNUSED_PARAM(callFrame);
    40924057    CTI::patchPutByIdReplace(codeBlock, structureID, slot.cachedOffset(), returnAddress);
    40934058#else
    4094     CTI::compilePutByIdReplace(this, exec, codeBlock, structureID, slot.cachedOffset(), returnAddress);
     4059    CTI::compilePutByIdReplace(this, callFrame, codeBlock, structureID, slot.cachedOffset(), returnAddress);
    40954060#endif
    40964061}
    40974062
    4098 void* Machine::getCTIArrayLengthTrampoline(ExecState* exec, CodeBlock* codeBlock)
     4063void* Machine::getCTIArrayLengthTrampoline(CallFrame* callFrame, CodeBlock* codeBlock)
    40994064{
    41004065    if (!m_ctiArrayLengthTrampoline)
    4101         m_ctiArrayLengthTrampoline = CTI::compileArrayLengthTrampoline(this, exec, codeBlock);
     4066        m_ctiArrayLengthTrampoline = CTI::compileArrayLengthTrampoline(this, callFrame, codeBlock);
    41024067       
    41034068    return m_ctiArrayLengthTrampoline;
    41044069}
    41054070
    4106 void* Machine::getCTIStringLengthTrampoline(ExecState* exec, CodeBlock* codeBlock)
     4071void* Machine::getCTIStringLengthTrampoline(CallFrame* callFrame, CodeBlock* codeBlock)
    41074072{
    41084073    if (!m_ctiStringLengthTrampoline)
    4109         m_ctiStringLengthTrampoline = CTI::compileStringLengthTrampoline(this, exec, codeBlock);
     4074        m_ctiStringLengthTrampoline = CTI::compileStringLengthTrampoline(this, callFrame, codeBlock);
    41104075       
    41114076    return m_ctiStringLengthTrampoline;
    41124077}
    41134078
    4114 NEVER_INLINE void Machine::tryCTICacheGetByID(ExecState* exec, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot)
     4079NEVER_INLINE void Machine::tryCTICacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot)
    41154080{
    41164081    // FIXME: Write a test that proves we need to check for recursion here just
     
    41234088    }
    41244089
    4125     if (isJSArray(baseValue) && propertyName == exec->propertyNames().length) {
     4090    if (isJSArray(baseValue) && propertyName == callFrame->propertyNames().length) {
    41264091#if USE(CTI_REPATCH_PIC)
    4127         CTI::compilePatchGetArrayLength(this, exec, codeBlock, returnAddress);
     4092        CTI::compilePatchGetArrayLength(this, callFrame, codeBlock, returnAddress);
    41284093#else
    4129         ctiRepatchCallByReturnAddress(returnAddress, getCTIArrayLengthTrampoline(exec, codeBlock));
     4094        ctiRepatchCallByReturnAddress(returnAddress, getCTIArrayLengthTrampoline(callFrame, codeBlock));
    41304095#endif
    41314096        return;
    41324097    }
    4133     if (isJSString(baseValue) && propertyName == exec->propertyNames().length) {
     4098    if (isJSString(baseValue) && propertyName == callFrame->propertyNames().length) {
    41344099        // The tradeoff of compiling an repatched inline string length access routine does not seem
    41354100        // to pay off, so we currently only do this for arrays.
    4136         ctiRepatchCallByReturnAddress(returnAddress, getCTIStringLengthTrampoline(exec, codeBlock));
     4101        ctiRepatchCallByReturnAddress(returnAddress, getCTIStringLengthTrampoline(callFrame, codeBlock));
    41374102        return;
    41384103    }
     
    41704135        CTI::patchGetByIdSelf(codeBlock, structureID, slot.cachedOffset(), returnAddress);
    41714136#else
    4172         CTI::compileGetByIdSelf(this, exec, codeBlock, structureID, slot.cachedOffset(), returnAddress);
     4137        CTI::compileGetByIdSelf(this, callFrame, codeBlock, structureID, slot.cachedOffset(), returnAddress);
    41734138#endif
    41744139        return;
    41754140    }
    41764141
    4177     if (slot.slotBase() == structureID->prototypeForLookup(exec)) {
     4142    if (slot.slotBase() == structureID->prototypeForLookup(callFrame)) {
    41784143        ASSERT(slot.slotBase()->isObject());
    41794144
     
    41944159        codeBlock->refStructureIDs(vPC);
    41954160
    4196         CTI::compileGetByIdProto(this, exec, codeBlock, structureID, slotBaseObject->structureID(), slot.cachedOffset(), returnAddress);
     4161        CTI::compileGetByIdProto(this, callFrame, codeBlock, structureID, slotBaseObject->structureID(), slot.cachedOffset(), returnAddress);
    41974162        return;
    41984163    }
     
    42014166    JSObject* o = static_cast<JSObject*>(baseValue);
    42024167    while (slot.slotBase() != o) {
    4203         JSValue* v = o->structureID()->prototypeForLookup(exec);
     4168        JSValue* v = o->structureID()->prototypeForLookup(callFrame);
    42044169
    42054170        // If we didn't find slotBase in baseValue's prototype chain, then baseValue
     
    42264191    StructureIDChain* chain = structureID->cachedPrototypeChain();
    42274192    if (!chain)
    4228         chain = cachePrototypeChain(exec, structureID);
     4193        chain = cachePrototypeChain(callFrame, structureID);
    42294194
    42304195    ASSERT(chain);
     
    42364201    codeBlock->refStructureIDs(vPC);
    42374202
    4238     CTI::compileGetByIdChain(this, exec, codeBlock, structureID, chain, count, slot.cachedOffset(), returnAddress);
     4203    CTI::compileGetByIdChain(this, callFrame, codeBlock, structureID, chain, count, slot.cachedOffset(), returnAddress);
    42394204}
    42404205
     
    42914256{
    42924257    JSValue* v1 = ARG_src1;
    4293     ExecState* exec = ARG_exec;
    4294 
    4295     JSObject* result = v1->toThisObject(exec);
     4258    CallFrame* callFrame = ARG_callFrame;
     4259
     4260    JSObject* result = v1->toThisObject(callFrame);
    42964261    VM_CHECK_EXCEPTION_AT_END();
    42974262    return result;
     
    43004265void Machine::cti_op_end(CTI_ARGS)
    43014266{
    4302     Register* r = ARG_r;
    4303     ScopeChainNode* scopeChain = Machine::scopeChain(r);
     4267    ScopeChainNode* scopeChain = ARG_callFrame->scopeChain();
    43044268    ASSERT(scopeChain->refCount > 1);
    43054269    scopeChain->deref();
     
    43184282        return jsNumber(ARG_globalData, left + right);
    43194283   
    4320     ExecState* exec = ARG_exec;
     4284    CallFrame* callFrame = ARG_callFrame;
    43214285
    43224286    bool leftIsString = v1->isString();
     
    43244288        RefPtr<UString::Rep> value = concatenate(static_cast<JSString*>(v1)->value().rep(), static_cast<JSString*>(v2)->value().rep());
    43254289        if (UNLIKELY(!value)) {
    4326             throwOutOfMemoryError(exec);
     4290            throwOutOfMemoryError(callFrame);
    43274291            VM_THROW_EXCEPTION();
    43284292        }
     
    43374301
    43384302        if (UNLIKELY(!value)) {
    4339             throwOutOfMemoryError(exec);
     4303            throwOutOfMemoryError(callFrame);
    43404304            VM_THROW_EXCEPTION();
    43414305        }
     
    43444308
    43454309    // All other cases are pretty uncommon
    4346     JSValue* result = jsAddSlowCase(exec, v1, v2);
     4310    JSValue* result = jsAddSlowCase(callFrame, v1, v2);
    43474311    VM_CHECK_EXCEPTION_AT_END();
    43484312    return result;
     
    43534317    JSValue* v = ARG_src1;
    43544318
    4355     ExecState* exec = ARG_exec;
    4356     JSValue* result = jsNumber(ARG_globalData, v->toNumber(exec) + 1);
     4319    CallFrame* callFrame = ARG_callFrame;
     4320    JSValue* result = jsNumber(ARG_globalData, v->toNumber(callFrame) + 1);
    43574321    VM_CHECK_EXCEPTION_AT_END();
    43584322    return result;
     
    43614325void Machine::cti_timeout_check(CTI_ARGS)
    43624326{
    4363     if (ARG_globalData->machine->checkTimeout(ARG_exec->dynamicGlobalObject())) {
     4327    if (ARG_globalData->machine->checkTimeout(ARG_callFrame->dynamicGlobalObject())) {
    43644328        ARG_globalData->exception = createInterruptedExecutionException(ARG_globalData);
    43654329        VM_THROW_EXCEPTION_AT_END();
     
    43714335    JSValue* src1 = ARG_src1;
    43724336    JSValue* src2 = ARG_src2;
    4373     ExecState* exec = ARG_exec;
    4374 
    4375     bool result = jsLess(exec, src1, src2);
     4337    CallFrame* callFrame = ARG_callFrame;
     4338
     4339    bool result = jsLess(callFrame, src1, src2);
    43764340    VM_CHECK_EXCEPTION_AT_END();
    43774341    return result;
     
    43824346    JSValue* src1 = ARG_src1;
    43834347    JSValue* src2 = ARG_src2;
    4384     ExecState* exec = ARG_exec;
    4385 
    4386     bool result = jsLessEq(exec, src1, src2);
     4348    CallFrame* callFrame = ARG_callFrame;
     4349
     4350    bool result = jsLessEq(callFrame, src1, src2);
    43874351    VM_CHECK_EXCEPTION_AT_END();
    43884352    return result;
     
    43914355JSValue* Machine::cti_op_new_object(CTI_ARGS)
    43924356{
    4393     return constructEmptyObject(ARG_exec);;
     4357    return constructEmptyObject(ARG_callFrame);;
    43944358}
    43954359
    43964360void Machine::cti_op_put_by_id(CTI_ARGS)
    43974361{
    4398     ExecState* exec = ARG_exec;
     4362    CallFrame* callFrame = ARG_callFrame;
    43994363    Identifier& ident = *ARG_id2;
    44004364
    44014365    PutPropertySlot slot;
    4402     ARG_src1->put(exec, ident, ARG_src3, slot);
     4366    ARG_src1->put(callFrame, ident, ARG_src3, slot);
    44034367
    44044368    ctiRepatchCallByReturnAddress(CTI_RETURN_ADDRESS, (void*)cti_op_put_by_id_second);
     
    44094373void Machine::cti_op_put_by_id_second(CTI_ARGS)
    44104374{
    4411     ExecState* exec = ARG_exec;
     4375    PutPropertySlot slot;
     4376    ARG_src1->put(ARG_callFrame, *ARG_id2, ARG_src3, slot);
     4377    ARG_globalData->machine->tryCTICachePutByID(ARG_callFrame, ARG_callFrame->codeBlock(), CTI_RETURN_ADDRESS, ARG_src1, slot);
     4378    VM_CHECK_EXCEPTION_AT_END();
     4379}
     4380
     4381void Machine::cti_op_put_by_id_generic(CTI_ARGS)
     4382{
     4383    PutPropertySlot slot;
     4384    ARG_src1->put(ARG_callFrame, *ARG_id2, ARG_src3, slot);
     4385    VM_CHECK_EXCEPTION_AT_END();
     4386}
     4387
     4388void Machine::cti_op_put_by_id_fail(CTI_ARGS)
     4389{
     4390    CallFrame* callFrame = ARG_callFrame;
    44124391    Identifier& ident = *ARG_id2;
    44134392
    4414     JSValue* baseValue = ARG_src1;
    44154393    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);
     4394    ARG_src1->put(callFrame, ident, ARG_src3, slot);
    44424395
    44434396    // should probably uncachePutByID() ... this would mean doing a vPC lookup - might be worth just bleeding this until the end.
     
    44494402JSValue* Machine::cti_op_get_by_id(CTI_ARGS)
    44504403{
    4451     ExecState* exec = ARG_exec;
     4404    CallFrame* callFrame = ARG_callFrame;
    44524405    Identifier& ident = *ARG_id2;
    44534406
    44544407    JSValue* baseValue = ARG_src1;
    44554408    PropertySlot slot(baseValue);
    4456     JSValue* result = baseValue->get(exec, ident, slot);
     4409    JSValue* result = baseValue->get(callFrame, ident, slot);
    44574410
    44584411    ctiRepatchCallByReturnAddress(CTI_RETURN_ADDRESS, (void*)cti_op_get_by_id_second);
     
    44644417JSValue* Machine::cti_op_get_by_id_second(CTI_ARGS)
    44654418{
    4466     ExecState* exec = ARG_exec;
     4419    CallFrame* callFrame = ARG_callFrame;
    44674420    Identifier& ident = *ARG_id2;
    44684421
    44694422    JSValue* baseValue = ARG_src1;
    44704423    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);
     4424    JSValue* result = baseValue->get(callFrame, ident, slot);
     4425
     4426    ARG_globalData->machine->tryCTICacheGetByID(callFrame, callFrame->codeBlock(), CTI_RETURN_ADDRESS, baseValue, ident, slot);
    44754427
    44764428    VM_CHECK_EXCEPTION_AT_END();
     
    44804432JSValue* Machine::cti_op_get_by_id_generic(CTI_ARGS)
    44814433{
    4482     ExecState* exec = ARG_exec;
     4434    CallFrame* callFrame = ARG_callFrame;
    44834435    Identifier& ident = *ARG_id2;
    44844436
    44854437    JSValue* baseValue = ARG_src1;
    44864438    PropertySlot slot(baseValue);
    4487     JSValue* result = baseValue->get(exec, ident, slot);
     4439    JSValue* result = baseValue->get(callFrame, ident, slot);
    44884440
    44894441    VM_CHECK_EXCEPTION_AT_END();
     
    44934445JSValue* Machine::cti_op_get_by_id_fail(CTI_ARGS)
    44944446{
    4495     ExecState* exec = ARG_exec;
     4447    CallFrame* callFrame = ARG_callFrame;
    44964448    Identifier& ident = *ARG_id2;
    44974449
    44984450    JSValue* baseValue = ARG_src1;
    44994451    PropertySlot slot(baseValue);
    4500     JSValue* result = baseValue->get(exec, ident, slot);
     4452    JSValue* result = baseValue->get(callFrame, ident, slot);
    45014453
    45024454    // should probably uncacheGetByID() ... this would mean doing a vPC lookup - might be worth just bleeding this until the end.
     
    45094461JSValue* Machine::cti_op_instanceof(CTI_ARGS)
    45104462{
    4511     ExecState* exec = ARG_exec;
     4463    CallFrame* callFrame = ARG_callFrame;
    45124464    JSValue* value = ARG_src1;
    45134465    JSValue* baseVal = ARG_src2;
     
    45234475
    45244476    if (!baseVal->isObject()) {
    4525         Register* r = ARG_r;
    4526         CodeBlock* codeBlock = Machine::codeBlock(r);
     4477        CallFrame* callFrame = ARG_callFrame;
     4478        CodeBlock* codeBlock = callFrame->codeBlock();
    45274479        ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    45284480        unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
    4529         ARG_globalData->exception = createInvalidParamError(exec, "instanceof", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock);
     4481        ARG_globalData->exception = createInvalidParamError(callFrame, "instanceof", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock);
    45304482        VM_THROW_EXCEPTION();
    45314483    }
     
    45354487
    45364488    if (!proto->isObject()) {
    4537         throwError(exec, TypeError, "instanceof called on an object with an invalid prototype property.");
     4489        throwError(callFrame, TypeError, "instanceof called on an object with an invalid prototype property.");
    45384490        VM_THROW_EXCEPTION();
    45394491    }
     
    45424494        return jsBoolean(false);
    45434495
    4544     JSValue* result = jsBoolean(static_cast<JSObject*>(baseCell)->hasInstance(exec, valueCell, protoCell));
     4496    JSValue* result = jsBoolean(static_cast<JSObject*>(baseCell)->hasInstance(callFrame, valueCell, protoCell));
    45454497    VM_CHECK_EXCEPTION_AT_END();
    45464498
     
    45504502JSValue* Machine::cti_op_del_by_id(CTI_ARGS)
    45514503{
    4552     ExecState* exec = ARG_exec;
     4504    CallFrame* callFrame = ARG_callFrame;
    45534505    Identifier& ident = *ARG_id2;
    45544506   
    4555     JSObject* baseObj = ARG_src1->toObject(exec);
    4556 
    4557     JSValue* result = jsBoolean(baseObj->deleteProperty(exec, ident));
     4507    JSObject* baseObj = ARG_src1->toObject(callFrame);
     4508
     4509    JSValue* result = jsBoolean(baseObj->deleteProperty(callFrame, ident));
    45584510    VM_CHECK_EXCEPTION_AT_END();
    45594511    return result;
     
    45704522        return jsNumber(ARG_globalData, left * right);
    45714523
    4572     ExecState* exec = ARG_exec;
    4573     JSValue* result = jsNumber(ARG_globalData, src1->toNumber(exec) * src2->toNumber(exec));
     4524    CallFrame* callFrame = ARG_callFrame;
     4525    JSValue* result = jsNumber(ARG_globalData, src1->toNumber(callFrame) * src2->toNumber(callFrame));
    45744526    VM_CHECK_EXCEPTION_AT_END();
    45754527    return result;
     
    45784530JSValue* Machine::cti_op_new_func(CTI_ARGS)
    45794531{
    4580     return ARG_func1->makeFunction(ARG_exec, Machine::scopeChain(ARG_r));
     4532    return ARG_func1->makeFunction(ARG_callFrame, ARG_callFrame->scopeChain());
    45814533}
    45824534
     
    45894541
    45904542    if (UNLIKELY(*ARG_profilerReference != 0))
    4591         (*ARG_profilerReference)->willExecute(CallFrame::create(ARG_r), static_cast<JSObject*>(ARG_src1));
     4543        (*ARG_profilerReference)->willExecute(ARG_callFrame, static_cast<JSFunction*>(ARG_src1));
    45924544
    45934545    ScopeChainNode* callDataScopeChain = static_cast<JSFunction*>(ARG_src1)->m_scopeChain.node();
    45944546    CodeBlock* newCodeBlock = &static_cast<JSFunction*>(ARG_src1)->m_body->byteCode(callDataScopeChain);
    45954547
    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));
     4548    CallFrame* callFrame = slideRegisterWindowForCall(newCodeBlock, ARG_registerFile, ARG_callFrame, ARG_int2, ARG_int3);
     4549    if (UNLIKELY(!callFrame)) {
     4550        ARG_globalData->exception = createStackOverflowError(ARG_callFrame);
    45994551        VM_THROW_EXCEPTION_2();
    46004552    }
    46014553
    4602     VoidPtrPair pair = { newCodeBlock, r };
     4554    VoidPtrPair pair = { newCodeBlock, callFrame };
    46034555    return pair;
    46044556}
     
    46064558void* Machine::cti_vm_compile(CTI_ARGS)
    46074559{
    4608     Register* r = ARG_r;
    4609     CodeBlock* codeBlock = Machine::codeBlock(r);
    4610 
     4560    CodeBlock* codeBlock = ARG_callFrame->codeBlock();
    46114561    if (!codeBlock->ctiCode)
    4612         CTI::compile(ARG_globalData->machine, CallFrame::create(r), codeBlock);
    4613 
     4562        CTI::compile(ARG_globalData->machine, ARG_callFrame, codeBlock);
    46144563    return codeBlock->ctiCode;
    46154564}
     
    46174566JSValue* Machine::cti_op_push_activation(CTI_ARGS)
    46184567{
    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);
     4568    JSActivation* activation = new (ARG_globalData) JSActivation(ARG_callFrame, static_cast<FunctionBodyNode*>(ARG_callFrame->codeBlock()->ownerNode));
     4569    ARG_callFrame->setScopeChain(ARG_callFrame->scopeChain()->copy()->push(activation));
    46264570    return activation;
    46274571}
     
    46394583        int registerOffset = ARG_int2;
    46404584        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);
     4585        CallFrame* previousCallFrame = ARG_callFrame;
     4586        CallFrame* callFrame = CallFrame::create(previousCallFrame->registers() + registerOffset);
     4587
     4588        callFrame->init(0, ARG_instr4 + 1, previousCallFrame->scopeChain(), previousCallFrame, 0, argCount, static_cast<JSFunction*>(funcVal));
     4589        ARG_setCallFrame(callFrame);
    46464590
    46474591        if (*ARG_profilerReference)
    4648             (*ARG_profilerReference)->willExecute(CallFrame::create(r), static_cast<JSObject*>(funcVal));
    4649 
    4650         Register* argv = r - RegisterFile::CallFrameHeaderSize - argCount;
     4592            (*ARG_profilerReference)->willExecute(callFrame, static_cast<JSFunction*>(funcVal));
     4593
     4594        Register* argv = ARG_callFrame->registers() - RegisterFile::CallFrameHeaderSize - argCount;
    46514595        ArgList argList(argv + 1, argCount - 1);
    46524596
    46534597        CTI_MACHINE_SAMPLING_callingHostFunction();
    46544598
    4655         JSValue* returnValue = callData.native.function(CallFrame::create(r), static_cast<JSObject*>(funcVal), argv[0].jsValue(CallFrame::create(r)), argList);
    4656         ARG_setR(savedR);
     4599        JSValue* returnValue = callData.native.function(callFrame, static_cast<JSFunction*>(funcVal), argv[0].jsValue(callFrame), argList);
     4600        ARG_setCallFrame(previousCallFrame);
    46574601        VM_CHECK_EXCEPTION();
    46584602
    46594603        if (*ARG_profilerReference)
    4660             (*ARG_profilerReference)->didExecute(CallFrame::create(savedR), static_cast<JSObject*>(funcVal));
     4604            (*ARG_profilerReference)->didExecute(previousCallFrame, static_cast<JSFunction*>(funcVal));
    46614605
    46624606        return returnValue;
     
    46654609    ASSERT(callType == CallTypeNone);
    46664610
    4667     ARG_globalData->exception = createNotAFunctionError(CallFrame::create(ARG_r), funcVal, ARG_instr4, codeBlock(ARG_r));
     4611    ARG_globalData->exception = createNotAFunctionError(ARG_callFrame, funcVal, ARG_instr4, ARG_callFrame->codeBlock());
    46684612    VM_THROW_EXCEPTION();
    46694613}
     
    46714615void Machine::cti_op_create_arguments(CTI_ARGS)
    46724616{
    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;
     4617    Arguments* arguments = new (ARG_globalData) Arguments(ARG_callFrame);
     4618    ARG_callFrame->setCalleeArguments(arguments);
     4619    ARG_callFrame[RegisterFile::ArgumentsRegister] = arguments;
    46794620}
    46804621
    46814622void Machine::cti_op_tear_off_activation(CTI_ARGS)
    46824623{
    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);
     4624    ASSERT(ARG_callFrame->codeBlock()->needsFullScopeChain);
     4625    ASSERT(ARG_src1->isObject(&JSActivation::info));
     4626    static_cast<JSActivation*>(ARG_src1)->copyRegisters(ARG_callFrame->optionalCalleeArguments());
    46924627}
    46934628
    46944629void Machine::cti_op_tear_off_arguments(CTI_ARGS)
    46954630{
    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();
     4631    ASSERT(ARG_callFrame->codeBlock()->usesArguments && !ARG_callFrame->codeBlock()->needsFullScopeChain);
     4632    ARG_callFrame->optionalCalleeArguments()->copyRegisters();
    47034633}
    47044634
    47054635void Machine::cti_op_ret_profiler(CTI_ARGS)
    47064636{
    4707     ExecState* exec = ARG_exec;
    4708 
    4709     Register* r = ARG_r;
    47104637    ASSERT(*ARG_profilerReference);
    4711     (*ARG_profilerReference)->didExecute(exec, static_cast<JSObject*>(r[RegisterFile::Callee].jsValue(exec)));
     4638    (*ARG_profilerReference)->didExecute(ARG_callFrame, ARG_callFrame->callee());
    47124639}
    47134640
    47144641void Machine::cti_op_ret_scopeChain(CTI_ARGS)
    47154642{
    4716     Register* r = ARG_r;
    4717     ASSERT(codeBlock(r)->needsFullScopeChain);
    4718     scopeChain(r)->deref();
     4643    ASSERT(ARG_callFrame->codeBlock()->needsFullScopeChain);
     4644    ARG_callFrame->scopeChain()->deref();
    47194645}
    47204646
    47214647JSValue* Machine::cti_op_new_array(CTI_ARGS)
    47224648{
    4723     ArgList argsList(ARG_registers1, ARG_int2);
    4724     return constructArray(ARG_exec, argsList);
     4649    ArgList argList(ARG_registers1, ARG_int2);
     4650    return constructArray(ARG_callFrame, argList);
    47254651}
    47264652
    47274653JSValue* Machine::cti_op_resolve(CTI_ARGS)
    47284654{
    4729     ExecState* exec = ARG_exec;
    4730     Register* r = ARG_r;
    4731     ScopeChainNode* scopeChain = Machine::scopeChain(r);
     4655    CallFrame* callFrame = ARG_callFrame;
     4656    ScopeChainNode* scopeChain = callFrame->scopeChain();
    47324657
    47334658    ScopeChainIterator iter = scopeChain->begin();
     
    47394664        JSObject* o = *iter;
    47404665        PropertySlot slot(o);
    4741         if (o->getPropertySlot(exec, ident, slot)) {
    4742             JSValue* result = slot.getValue(exec, ident);
     4666        if (o->getPropertySlot(callFrame, ident, slot)) {
     4667            JSValue* result = slot.getValue(callFrame, ident);
    47434668            VM_CHECK_EXCEPTION_AT_END();
    47444669            return result;
     
    47464671    } while (++iter != end);
    47474672
    4748     CodeBlock* codeBlock = Machine::codeBlock(r);
     4673    CodeBlock* codeBlock = callFrame->codeBlock();
    47494674    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    47504675    unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
    4751     exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));
     4676    ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock);
    47524677    VM_THROW_EXCEPTION();
    47534678}
     
    47564681{
    47574682    RegisterFile* registerFile = ARG_registerFile;
    4758     Register* r = ARG_r;
     4683    CallFrame* callFrame = ARG_callFrame;
    47594684
    47604685    JSFunction* constructor = static_cast<JSFunction*>(ARG_src1);
     
    47704695
    47714696    if (*ARG_profilerReference)
    4772         (*ARG_profilerReference)->willExecute(CallFrame::create(r), constructor);
     4697        (*ARG_profilerReference)->willExecute(callFrame, constructor);
    47734698
    47744699    ScopeChainNode* callDataScopeChain = constructor->m_scopeChain.node();
     
    47834708    JSObject* newObject = new (ARG_globalData) JSObject(structure);
    47844709
    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));
     4710    callFrame[firstArg] = newObject; // "this" value
     4711
     4712    callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount);
     4713    if (UNLIKELY(!callFrame)) {
     4714        ARG_globalData->exception = createStackOverflowError(ARG_callFrame);
    47904715        VM_THROW_EXCEPTION_2();
    47914716    }
    47924717
    4793     VoidPtrPair pair = { newCodeBlock, r };
     4718    VoidPtrPair pair = { newCodeBlock, callFrame };
    47944719    return pair;
    47954720}
     
    47974722JSValue* Machine::cti_op_construct_NotJSConstruct(CTI_ARGS)
    47984723{
    4799     ExecState* exec = ARG_exec;
    4800     Register* r = ARG_r;
     4724    CallFrame* callFrame = ARG_callFrame;
    48014725
    48024726    JSValue* constrVal = ARG_src1;
     
    48114735    if (constructType == ConstructTypeHost) {
    48124736        if (*ARG_profilerReference)
    4813             (*ARG_profilerReference)->willExecute(exec, constructor);
    4814 
    4815         ArgList argList(r + firstArg + 1, argCount - 1);
     4737            (*ARG_profilerReference)->willExecute(callFrame, constructor);
     4738
     4739        ArgList argList(callFrame->registers() + firstArg + 1, argCount - 1);
    48164740
    48174741        CTI_MACHINE_SAMPLING_callingHostFunction();
    48184742
    4819         JSValue* returnValue = constructData.native.function(exec, constructor, argList);
     4743        JSValue* returnValue = constructData.native.function(callFrame, constructor, argList);
    48204744        VM_CHECK_EXCEPTION();
    48214745
    48224746        if (*ARG_profilerReference)
    4823             (*ARG_profilerReference)->didExecute(exec, constructor);
     4747            (*ARG_profilerReference)->didExecute(callFrame, constructor);
    48244748
    48254749        return returnValue;
     
    48284752    ASSERT(constructType == ConstructTypeNone);
    48294753
    4830     exec->setException(createNotAConstructorError(exec, constrVal, ARG_instr6, codeBlock(r)));
     4754    ARG_globalData->exception = createNotAConstructorError(callFrame, constrVal, ARG_instr6, callFrame->codeBlock());
    48314755    VM_THROW_EXCEPTION();
    48324756}
     
    48344758JSValue* Machine::cti_op_get_by_val(CTI_ARGS)
    48354759{
    4836     ExecState* exec = ARG_exec;
     4760    CallFrame* callFrame = ARG_callFrame;
    48374761    Machine* machine = ARG_globalData->machine;
    48384762
     
    48504774                result = jsArray->getIndex(i);
    48514775            else
    4852                 result = jsArray->JSArray::get(exec, i);
     4776                result = jsArray->JSArray::get(callFrame, i);
    48534777        } else if (machine->isJSString(baseValue) && static_cast<JSString*>(baseValue)->canGetIndex(i))
    48544778            result = static_cast<JSString*>(baseValue)->getIndex(ARG_globalData, i);
    48554779        else
    4856             result = baseValue->get(exec, i);
     4780            result = baseValue->get(callFrame, i);
    48574781    } else {
    4858         Identifier property(exec, subscript->toString(exec));
    4859         result = baseValue->get(exec, property);
     4782        Identifier property(callFrame, subscript->toString(callFrame));
     4783        result = baseValue->get(callFrame, property);
    48604784    }
    48614785
     
    48664790VoidPtrPair Machine::cti_op_resolve_func(CTI_ARGS)
    48674791{
    4868     ExecState* exec = ARG_exec;
    4869     Register* r = ARG_r;
    4870     ScopeChainNode* scopeChain = Machine::scopeChain(r);
     4792    CallFrame* callFrame = ARG_callFrame;
     4793    ScopeChainNode* scopeChain = callFrame->scopeChain();
    48714794
    48724795    ScopeChainIterator iter = scopeChain->begin();
     
    48824805        base = *iter;
    48834806        PropertySlot slot(base);
    4884         if (base->getPropertySlot(exec, ident, slot)) {           
     4807        if (base->getPropertySlot(callFrame, ident, slot)) {           
    48854808            // ECMA 11.2.3 says that if we hit an activation the this value should be null.
    48864809            // However, section 10.2.3 says that in the case where the value provided
     
    48904813            // that in host objects you always get a valid object for this.
    48914814            // 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);
     4815            JSObject* thisObj = base->toThisObject(callFrame);
     4816            JSValue* result = slot.getValue(callFrame, ident);
    48944817            VM_CHECK_EXCEPTION_AT_END();
    48954818
     
    49004823    } while (iter != end);
    49014824
    4902     CodeBlock* codeBlock = Machine::codeBlock(r);
     4825    CodeBlock* codeBlock = callFrame->codeBlock();
    49034826    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    49044827    unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
    4905     exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));
     4828    ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock);
    49064829    VM_THROW_EXCEPTION_2();
    49074830}
     
    49174840        return jsNumber(ARG_globalData, left - right);
    49184841
    4919     ExecState* exec = ARG_exec;
    4920     JSValue* result = jsNumber(ARG_globalData, src1->toNumber(exec) - src2->toNumber(exec));
     4842    CallFrame* callFrame = ARG_callFrame;
     4843    JSValue* result = jsNumber(ARG_globalData, src1->toNumber(callFrame) - src2->toNumber(callFrame));
    49214844    VM_CHECK_EXCEPTION_AT_END();
    49224845    return result;
     
    49254848void Machine::cti_op_put_by_val(CTI_ARGS)
    49264849{
    4927     ExecState* exec = ARG_exec;
     4850    CallFrame* callFrame = ARG_callFrame;
    49284851    Machine* machine = ARG_globalData->machine;
    49294852
     
    49414864                jsArray->setIndex(i, value);
    49424865            else
    4943                 jsArray->JSArray::put(exec, i, value);
     4866                jsArray->JSArray::put(callFrame, i, value);
    49444867        } else
    4945             baseValue->put(exec, i, value);
     4868            baseValue->put(callFrame, i, value);
    49464869    } else {
    4947         Identifier property(exec, subscript->toString(exec));
     4870        Identifier property(callFrame, subscript->toString(callFrame));
    49484871        if (!ARG_globalData->exception) { // Don't put to an object if toString threw an exception.
    49494872            PutPropertySlot slot;
    4950             baseValue->put(exec, property, value, slot);
     4873            baseValue->put(callFrame, property, value, slot);
    49514874        }
    49524875    }
     
    49574880void Machine::cti_op_put_by_val_array(CTI_ARGS)
    49584881{
    4959     ExecState* exec = ARG_exec;
     4882    CallFrame* callFrame = ARG_callFrame;
    49604883
    49614884    JSValue* baseValue = ARG_src1;
     
    49664889
    49674890    if (LIKELY(i >= 0))
    4968         static_cast<JSArray*>(baseValue)->JSArray::put(exec, i, value);
     4891        static_cast<JSArray*>(baseValue)->JSArray::put(callFrame, i, value);
    49694892    else {
    4970         Identifier property(exec, JSImmediate::from(i)->toString(exec));
     4893        Identifier property(callFrame, JSImmediate::from(i)->toString(callFrame));
    49714894        // FIXME: can toString throw an exception here?
    49724895        if (!ARG_globalData->exception) { // Don't put to an object if toString threw an exception.
    49734896            PutPropertySlot slot;
    4974             baseValue->put(exec, property, value, slot);
     4897            baseValue->put(callFrame, property, value, slot);
    49754898        }
    49764899    }
     
    49814904JSValue* Machine::cti_op_lesseq(CTI_ARGS)
    49824905{
    4983     ExecState* exec = ARG_exec;
    4984     JSValue* result = jsBoolean(jsLessEq(exec, ARG_src1, ARG_src2));
     4906    CallFrame* callFrame = ARG_callFrame;
     4907    JSValue* result = jsBoolean(jsLessEq(callFrame, ARG_src1, ARG_src2));
    49854908    VM_CHECK_EXCEPTION_AT_END();
    49864909    return result;
     
    49914914    JSValue* src1 = ARG_src1;
    49924915
    4993     ExecState* exec = ARG_exec;
    4994 
    4995     bool result = src1->toBoolean(exec);
     4916    CallFrame* callFrame = ARG_callFrame;
     4917
     4918    bool result = src1->toBoolean(callFrame);
    49964919    VM_CHECK_EXCEPTION_AT_END();
    49974920    return result;
     
    50064929        return jsNumber(ARG_globalData, -v);
    50074930
    5008     ExecState* exec = ARG_exec;
    5009     JSValue* result = jsNumber(ARG_globalData, -src->toNumber(exec));
     4931    CallFrame* callFrame = ARG_callFrame;
     4932    JSValue* result = jsNumber(ARG_globalData, -src->toNumber(callFrame));
    50104933    VM_CHECK_EXCEPTION_AT_END();
    50114934    return result;
     
    50144937JSValue* Machine::cti_op_resolve_base(CTI_ARGS)
    50154938{
    5016     return inlineResolveBase(ARG_exec, *ARG_id1, scopeChain(ARG_r));
     4939    return inlineResolveBase(ARG_callFrame, *ARG_id1, ARG_callFrame->scopeChain());
    50174940}
    50184941
    50194942JSValue* Machine::cti_op_resolve_skip(CTI_ARGS)
    50204943{
    5021     ExecState* exec = ARG_exec;
    5022     Register* r = ARG_r;
    5023     ScopeChainNode* scopeChain = Machine::scopeChain(r);
     4944    CallFrame* callFrame = ARG_callFrame;
     4945    ScopeChainNode* scopeChain = callFrame->scopeChain();
    50244946
    50254947    int skip = ARG_int2;
     
    50364958        JSObject* o = *iter;
    50374959        PropertySlot slot(o);
    5038         if (o->getPropertySlot(exec, ident, slot)) {
    5039             JSValue* result = slot.getValue(exec, ident);
     4960        if (o->getPropertySlot(callFrame, ident, slot)) {
     4961            JSValue* result = slot.getValue(callFrame, ident);
    50404962            VM_CHECK_EXCEPTION_AT_END();
    50414963            return result;
     
    50434965    } while (++iter != end);
    50444966
    5045     CodeBlock* codeBlock = Machine::codeBlock(r);
     4967    CodeBlock* codeBlock = callFrame->codeBlock();
    50464968    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    50474969    unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
    5048     exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));
     4970    ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock);
    50494971    VM_THROW_EXCEPTION();
    50504972}
     
    50524974JSValue* Machine::cti_op_resolve_global(CTI_ARGS)
    50534975{
    5054     ExecState* exec = ARG_exec;
     4976    CallFrame* callFrame = ARG_callFrame;
    50554977    JSGlobalObject* globalObject = static_cast<JSGlobalObject*>(ARG_src1);
    50564978    Identifier& ident = *ARG_id2;
     
    50594981
    50604982    PropertySlot slot(globalObject);
    5061     if (globalObject->getPropertySlot(exec, ident, slot)) {
    5062         JSValue* result = slot.getValue(exec, ident);
     4983    if (globalObject->getPropertySlot(callFrame, ident, slot)) {
     4984        JSValue* result = slot.getValue(callFrame, ident);
    50634985        if (slot.isCacheable()) {
    50644986            if (vPC[4].u.structureID)
     
    50744996    }
    50754997   
    5076     Register* r = ARG_r;
    5077     exec->setException(createUndefinedVariableError(exec, ident, vPC, codeBlock(r)));   
     4998    ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, vPC, callFrame->codeBlock());
    50784999    VM_THROW_EXCEPTION();
    50795000}
     
    50895010        return jsNumber(ARG_globalData, left / right);
    50905011
    5091     ExecState* exec = ARG_exec;
    5092     JSValue* result = jsNumber(ARG_globalData, src1->toNumber(exec) / src2->toNumber(exec));
     5012    CallFrame* callFrame = ARG_callFrame;
     5013    JSValue* result = jsNumber(ARG_globalData, src1->toNumber(callFrame) / src2->toNumber(callFrame));
    50935014    VM_CHECK_EXCEPTION_AT_END();
    50945015    return result;
     
    50995020    JSValue* v = ARG_src1;
    51005021
    5101     ExecState* exec = ARG_exec;
    5102     JSValue* result = jsNumber(ARG_globalData, v->toNumber(exec) - 1);
     5022    CallFrame* callFrame = ARG_callFrame;
     5023    JSValue* result = jsNumber(ARG_globalData, v->toNumber(callFrame) - 1);
    51035024    VM_CHECK_EXCEPTION_AT_END();
    51045025    return result;
     
    51095030    JSValue* src1 = ARG_src1;
    51105031    JSValue* src2 = ARG_src2;
    5111     ExecState* exec = ARG_exec;
    5112 
    5113     bool result = jsLess(exec, src1, src2);
     5032    CallFrame* callFrame = ARG_callFrame;
     5033
     5034    bool result = jsLess(callFrame, src1, src2);
    51145035    VM_CHECK_EXCEPTION_AT_END();
    51155036    return result;
     
    51205041    JSValue* src = ARG_src1;
    51215042
    5122     ExecState* exec = ARG_exec;
    5123 
    5124     JSValue* result = jsBoolean(!src->toBoolean(exec));
     5043    CallFrame* callFrame = ARG_callFrame;
     5044
     5045    JSValue* result = jsBoolean(!src->toBoolean(callFrame));
    51255046    VM_CHECK_EXCEPTION_AT_END();
    51265047    return result;
     
    51315052    JSValue* src1 = ARG_src1;
    51325053
    5133     ExecState* exec = ARG_exec;
    5134 
    5135     bool result = src1->toBoolean(exec);
     5054    CallFrame* callFrame = ARG_callFrame;
     5055
     5056    bool result = src1->toBoolean(callFrame);
    51365057    VM_CHECK_EXCEPTION_AT_END();
    51375058    return result;
     
    51425063    JSValue* v = ARG_src1;
    51435064
    5144     ExecState* exec = ARG_exec;
    5145 
    5146     JSValue* number = v->toJSNumber(exec);
     5065    CallFrame* callFrame = ARG_callFrame;
     5066
     5067    JSValue* number = v->toJSNumber(callFrame);
    51475068    VM_CHECK_EXCEPTION_2();
    51485069
     
    51565077    JSValue* src2 = ARG_src2;
    51575078
    5158     ExecState* exec = ARG_exec;
     5079    CallFrame* callFrame = ARG_callFrame;
    51595080
    51605081    ASSERT(!JSImmediate::areBothImmediateNumbers(src1, src2));
    5161     JSValue* result = jsBoolean(equalSlowCaseInline(exec, src1, src2));
     5082    JSValue* result = jsBoolean(equalSlowCaseInline(callFrame, src1, src2));
    51625083    VM_CHECK_EXCEPTION_AT_END();
    51635084    return result;
     
    51765097        return jsNumber(ARG_globalData, left << (right & 0x1f));
    51775098
    5178     ExecState* exec = ARG_exec;
    5179     JSValue* result = jsNumber(ARG_globalData, (val->toInt32(exec)) << (shift->toUInt32(exec) & 0x1f));
     5099    CallFrame* callFrame = ARG_callFrame;
     5100    JSValue* result = jsNumber(ARG_globalData, (val->toInt32(callFrame)) << (shift->toUInt32(callFrame) & 0x1f));
    51805101    VM_CHECK_EXCEPTION_AT_END();
    51815102    return result;
     
    51925113        return jsNumber(ARG_globalData, left & right);
    51935114
    5194     ExecState* exec = ARG_exec;
    5195     JSValue* result = jsNumber(ARG_globalData, src1->toInt32(exec) & src2->toInt32(exec));
     5115    CallFrame* callFrame = ARG_callFrame;
     5116    JSValue* result = jsNumber(ARG_globalData, src1->toInt32(callFrame) & src2->toInt32(callFrame));
    51965117    VM_CHECK_EXCEPTION_AT_END();
    51975118    return result;
     
    52105131        return jsNumber(ARG_globalData, left >> (right & 0x1f));
    52115132
    5212     ExecState* exec = ARG_exec;
    5213     JSValue* result = jsNumber(ARG_globalData, (val->toInt32(exec)) >> (shift->toUInt32(exec) & 0x1f));
     5133    CallFrame* callFrame = ARG_callFrame;
     5134    JSValue* result = jsNumber(ARG_globalData, (val->toInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
    52145135    VM_CHECK_EXCEPTION_AT_END();
    52155136    return result;
     
    52245145        return jsNumber(ARG_globalData, ~value);
    52255146           
    5226     ExecState* exec = ARG_exec;
    5227     JSValue* result = jsNumber(ARG_globalData, ~src->toInt32(exec));
     5147    CallFrame* callFrame = ARG_callFrame;
     5148    JSValue* result = jsNumber(ARG_globalData, ~src->toInt32(callFrame));
    52285149    VM_CHECK_EXCEPTION_AT_END();
    52295150    return result;
     
    52325153VoidPtrPair Machine::cti_op_resolve_with_base(CTI_ARGS)
    52335154{
    5234     ExecState* exec = ARG_exec;
    5235     Register* r = ARG_r;
    5236     ScopeChainNode* scopeChain = Machine::scopeChain(r);
     5155    CallFrame* callFrame = ARG_callFrame;
     5156    ScopeChainNode* scopeChain = callFrame->scopeChain();
    52375157
    52385158    ScopeChainIterator iter = scopeChain->begin();
     
    52485168        base = *iter;
    52495169        PropertySlot slot(base);
    5250         if (base->getPropertySlot(exec, ident, slot)) {
    5251             JSValue* result = slot.getValue(exec, ident);
     5170        if (base->getPropertySlot(callFrame, ident, slot)) {
     5171            JSValue* result = slot.getValue(callFrame, ident);
    52525172            VM_CHECK_EXCEPTION_AT_END();
    52535173
     
    52585178    } while (iter != end);
    52595179
    5260     CodeBlock* codeBlock = Machine::codeBlock(r);
     5180    CodeBlock* codeBlock = callFrame->codeBlock();
    52615181    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    52625182    unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
    5263     exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));
     5183    ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock);
    52645184    VM_THROW_EXCEPTION_2();
    52655185}
     
    52675187JSValue* Machine::cti_op_new_func_exp(CTI_ARGS)
    52685188{
    5269     return ARG_funcexp1->makeFunction(ARG_exec, scopeChain(ARG_r));
     5189    return ARG_funcexp1->makeFunction(ARG_callFrame, ARG_callFrame->scopeChain());
    52705190}
    52715191
     
    52755195    JSValue* divisorValue = ARG_src2;
    52765196
    5277     ExecState* exec = ARG_exec;
    5278     double d = dividendValue->toNumber(exec);
    5279     JSValue* result = jsNumber(ARG_globalData, fmod(d, divisorValue->toNumber(exec)));
     5197    CallFrame* callFrame = ARG_callFrame;
     5198    double d = dividendValue->toNumber(callFrame);
     5199    JSValue* result = jsNumber(ARG_globalData, fmod(d, divisorValue->toNumber(callFrame)));
    52805200    VM_CHECK_EXCEPTION_AT_END();
    52815201    return result;
     
    52845204JSValue* Machine::cti_op_less(CTI_ARGS)
    52855205{
    5286     ExecState* exec = ARG_exec;
    5287     JSValue* result = jsBoolean(jsLess(exec, ARG_src1, ARG_src2));
     5206    CallFrame* callFrame = ARG_callFrame;
     5207    JSValue* result = jsBoolean(jsLess(callFrame, ARG_src1, ARG_src2));
    52885208    VM_CHECK_EXCEPTION_AT_END();
    52895209    return result;
     
    52975217    ASSERT(!JSImmediate::areBothImmediateNumbers(src1, src2));
    52985218
    5299     ExecState* exec = ARG_exec;
    5300     JSValue* result = jsBoolean(!equalSlowCaseInline(exec, src1, src2));
     5219    CallFrame* callFrame = ARG_callFrame;
     5220    JSValue* result = jsBoolean(!equalSlowCaseInline(callFrame, src1, src2));
    53015221    VM_CHECK_EXCEPTION_AT_END();
    53025222    return result;
     
    53075227    JSValue* v = ARG_src1;
    53085228
    5309     ExecState* exec = ARG_exec;
    5310 
    5311     JSValue* number = v->toJSNumber(exec);
     5229    CallFrame* callFrame = ARG_callFrame;
     5230
     5231    JSValue* number = v->toJSNumber(callFrame);
    53125232    VM_CHECK_EXCEPTION_2();
    53135233
     
    53215241    JSValue* shift = ARG_src2;
    53225242
    5323     ExecState* exec = ARG_exec;
     5243    CallFrame* callFrame = ARG_callFrame;
    53245244
    53255245    if (JSImmediate::areBothImmediateNumbers(val, shift) && !JSImmediate::isNegative(val))
    53265246        return JSImmediate::rightShiftImmediateNumbers(val, shift);
    53275247    else {
    5328         JSValue* result = jsNumber(ARG_globalData, (val->toUInt32(exec)) >> (shift->toUInt32(exec) & 0x1f));
     5248        JSValue* result = jsNumber(ARG_globalData, (val->toUInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
    53295249        VM_CHECK_EXCEPTION_AT_END();
    53305250        return result;
     
    53375257    JSValue* src2 = ARG_src2;
    53385258
    5339     ExecState* exec = ARG_exec;
    5340 
    5341     JSValue* result = jsNumber(ARG_globalData, src1->toInt32(exec) ^ src2->toInt32(exec));
     5259    CallFrame* callFrame = ARG_callFrame;
     5260
     5261    JSValue* result = jsNumber(ARG_globalData, src1->toInt32(callFrame) ^ src2->toInt32(callFrame));
    53425262    VM_CHECK_EXCEPTION_AT_END();
    53435263    return result;
     
    53465266JSValue* Machine::cti_op_new_regexp(CTI_ARGS)
    53475267{
    5348     return new (ARG_globalData) RegExpObject(scopeChain(ARG_r)->globalObject()->regExpStructure(), ARG_regexp1);
     5268    return new (ARG_globalData) RegExpObject(ARG_callFrame->lexicalGlobalObject()->regExpStructure(), ARG_regexp1);
    53495269}
    53505270
     
    53545274    JSValue* src2 = ARG_src2;
    53555275
    5356     ExecState* exec = ARG_exec;
    5357 
    5358     JSValue* result = jsNumber(ARG_globalData, src1->toInt32(exec) | src2->toInt32(exec));
     5276    CallFrame* callFrame = ARG_callFrame;
     5277
     5278    JSValue* result = jsNumber(ARG_globalData, src1->toInt32(callFrame) | src2->toInt32(callFrame));
    53595279    VM_CHECK_EXCEPTION_AT_END();
    53605280    return result;
     
    53635283JSValue* Machine::cti_op_call_eval(CTI_ARGS)
    53645284{
    5365     ExecState* exec = ARG_exec;
     5285    CallFrame* callFrame = ARG_callFrame;
    53665286    RegisterFile* registerFile = ARG_registerFile;
    5367     Register* r = ARG_r;
    5368     CodeBlock* codeBlock = Machine::codeBlock(r);
    5369     ScopeChainNode* scopeChain = Machine::scopeChain(r);
     5287    CodeBlock* codeBlock = callFrame->codeBlock();
     5288    ScopeChainNode* scopeChain = callFrame->scopeChain();
    53705289
    53715290    Machine* machine = ARG_globalData->machine;
     
    53775296
    53785297    if (baseVal == scopeChain->globalObject() && funcVal == scopeChain->globalObject()->evalFunction()) {
    5379         JSObject* thisObject = static_cast<JSObject*>(r[codeBlock->thisRegister].jsValue(exec));
     5298        JSObject* thisObject = static_cast<JSObject*>(callFrame[codeBlock->thisRegister].jsValue(callFrame));
    53805299        JSValue* exceptionValue = 0;
    5381         JSValue* result = machine->callEval(exec, thisObject, scopeChain, registerFile,  r, registerOffset - RegisterFile::CallFrameHeaderSize - argCount, argCount, exceptionValue);
     5300        JSValue* result = machine->callEval(callFrame, thisObject, scopeChain, registerFile, registerOffset - RegisterFile::CallFrameHeaderSize - argCount, argCount, exceptionValue);
    53825301        VM_CHECK_EXCEPTION_ARG(exceptionValue);
    53835302        return result;
     
    53895308void* Machine::cti_op_throw(CTI_ARGS)
    53905309{
    5391     ExecState* exec = ARG_exec;
    5392     Register* r = ARG_r;
    5393     CodeBlock* codeBlock = Machine::codeBlock(r);
     5310    CallFrame* callFrame = ARG_callFrame;
     5311    CodeBlock* codeBlock = callFrame->codeBlock();
    53945312
    53955313    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
     
    53995317    ASSERT(exceptionValue);
    54005318
    5401     Instruction* handlerVPC = ARG_globalData->machine->throwException(exec, exceptionValue, codeBlock->instructions.begin() + vPCIndex, r, true);
     5319    Instruction* handlerVPC = ARG_globalData->machine->throwException(callFrame, exceptionValue, codeBlock->instructions.begin() + vPCIndex, true);
    54025320
    54035321    if (!handlerVPC) {
     
    54065324    }
    54075325
    5408     ARG_setR(r);
    5409     void* catchRoutine = Machine::codeBlock(r)->nativeExceptionCodeForHandlerVPC(handlerVPC);
     5326    ARG_setCallFrame(callFrame);
     5327    void* catchRoutine = callFrame->codeBlock()->nativeExceptionCodeForHandlerVPC(handlerVPC);
    54105328    ASSERT(catchRoutine);
    54115329    ctiSetReturnAddress(&CTI_RETURN_ADDRESS, catchRoutine);
     
    54155333JSPropertyNameIterator* Machine::cti_op_get_pnames(CTI_ARGS)
    54165334{
    5417     return JSPropertyNameIterator::create(ARG_exec, ARG_src1);
     5335    return JSPropertyNameIterator::create(ARG_callFrame, ARG_src1);
    54185336}
    54195337
     
    54215339{
    54225340    JSPropertyNameIterator* it = ARG_pni1;
    5423     JSValue* temp = it->next(ARG_exec);
     5341    JSValue* temp = it->next(ARG_callFrame);
    54245342    if (!temp)
    54255343        it->invalidate();
     
    54295347void Machine::cti_op_push_scope(CTI_ARGS)
    54305348{
    5431     ExecState* exec = ARG_exec;
    5432     JSValue* v = ARG_src1;
    5433 
    5434     JSObject* o = v->toObject(exec);
     5349    JSObject* o = ARG_src1->toObject(ARG_callFrame);
    54355350    VM_CHECK_EXCEPTION_VOID();
    5436 
    5437     Register* r = ARG_r;
    5438     r[RegisterFile::ScopeChain] = scopeChain(r)->push(o);
     5351    ARG_callFrame->setScopeChain(ARG_callFrame->scopeChain()->push(o));
    54395352}
    54405353
    54415354void Machine::cti_op_pop_scope(CTI_ARGS)
    54425355{
    5443     Register* r = ARG_r;
    5444     r[RegisterFile::ScopeChain] = scopeChain(r)->pop();
     5356    CallFrame* callFrame = ARG_callFrame;
     5357    callFrame->setScopeChain(callFrame->scopeChain()->pop());
    54455358}
    54465359
    54475360JSValue* Machine::cti_op_typeof(CTI_ARGS)
    54485361{
    5449     return jsTypeStringForValue(ARG_exec, ARG_src1);
     5362    return jsTypeStringForValue(ARG_callFrame, ARG_src1);
    54505363}
    54515364
     
    55085421{
    55095422    JSValue* src = ARG_src1;
    5510     ExecState* exec = ARG_exec;
    5511 
    5512     JSValue* result = src->toJSNumber(exec);
     5423    CallFrame* callFrame = ARG_callFrame;
     5424
     5425    JSValue* result = src->toJSNumber(callFrame);
    55135426    VM_CHECK_EXCEPTION_AT_END();
    55145427    return result;
     
    55175430JSValue* Machine::cti_op_in(CTI_ARGS)
    55185431{
    5519     ExecState* exec = ARG_exec;
     5432    CallFrame* callFrame = ARG_callFrame;
    55205433    JSValue* baseVal = ARG_src2;
    55215434
    55225435    if (!baseVal->isObject()) {
    5523         Register* r = ARG_r;
    5524         CodeBlock* codeBlock = Machine::codeBlock(r);
     5436        CallFrame* callFrame = ARG_callFrame;
     5437        CodeBlock* codeBlock = callFrame->codeBlock();
    55255438        ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
    55265439        unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
    5527         exec->setException(createInvalidParamError(exec, "in", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock));
     5440        ARG_globalData->exception = createInvalidParamError(callFrame, "in", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock);
    55285441        VM_THROW_EXCEPTION();
    55295442    }
     
    55345447    uint32_t i;
    55355448    if (propName->getUInt32(i))
    5536         return jsBoolean(baseObj->hasProperty(exec, i));
    5537 
    5538     Identifier property(exec, propName->toString(exec));
     5449        return jsBoolean(baseObj->hasProperty(callFrame, i));
     5450
     5451    Identifier property(callFrame, propName->toString(callFrame));
    55395452    VM_CHECK_EXCEPTION();
    5540     return jsBoolean(baseObj->hasProperty(exec, property));
     5453    return jsBoolean(baseObj->hasProperty(callFrame, property));
    55415454}
    55425455
    55435456JSValue* Machine::cti_op_push_new_scope(CTI_ARGS)
    55445457{
    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);
     5458    JSObject* scope = new (ARG_globalData) JSStaticScopeObject(ARG_callFrame, *ARG_id1, ARG_src2, DontDelete);
     5459
     5460    CallFrame* callFrame = ARG_callFrame;
     5461    callFrame->setScopeChain(callFrame->scopeChain()->push(scope));
    55495462    return scope;
    55505463}
     
    55535466{
    55545467    unsigned count = ARG_int1;
    5555     Register* r = ARG_r;
    5556 
    5557     ScopeChainNode* tmp = scopeChain(r);
     5468    CallFrame* callFrame = ARG_callFrame;
     5469
     5470    ScopeChainNode* tmp = callFrame->scopeChain();
    55585471    while (count--)
    55595472        tmp = tmp->pop();
    5560     r[RegisterFile::ScopeChain] = tmp;
     5473    callFrame->setScopeChain(tmp);
    55615474}
    55625475
    55635476void Machine::cti_op_put_by_index(CTI_ARGS)
    55645477{
    5565     ExecState* exec = ARG_exec;
     5478    CallFrame* callFrame = ARG_callFrame;
    55665479    unsigned property = ARG_int2;
    55675480
    5568     ARG_src1->put(exec, property, ARG_src3);
     5481    ARG_src1->put(callFrame, property, ARG_src3);
    55695482}
    55705483
     
    55735486    JSValue* scrutinee = ARG_src1;
    55745487    unsigned tableIndex = ARG_int2;
    5575     Register* r = ARG_r;
    5576     CodeBlock* codeBlock = Machine::codeBlock(r);
     5488    CallFrame* callFrame = ARG_callFrame;
     5489    CodeBlock* codeBlock = callFrame->codeBlock();
    55775490
    55785491    if (JSImmediate::isNumber(scrutinee)) {
     
    55885501    JSValue* scrutinee = ARG_src1;
    55895502    unsigned tableIndex = ARG_int2;
    5590     Register* r = ARG_r;
    5591     CodeBlock* codeBlock = Machine::codeBlock(r);
     5503    CallFrame* callFrame = ARG_callFrame;
     5504    CodeBlock* codeBlock = callFrame->codeBlock();
    55925505
    55935506    void* result = codeBlock->characterSwitchJumpTables[tableIndex].ctiDefault;
     
    56065519    JSValue* scrutinee = ARG_src1;
    56075520    unsigned tableIndex = ARG_int2;
    5608     Register* r = ARG_r;
    5609     CodeBlock* codeBlock = Machine::codeBlock(r);
     5521    CallFrame* callFrame = ARG_callFrame;
     5522    CodeBlock* codeBlock = callFrame->codeBlock();
    56105523
    56115524    void* result = codeBlock->stringSwitchJumpTables[tableIndex].ctiDefault;
     
    56215534JSValue* Machine::cti_op_del_by_val(CTI_ARGS)
    56225535{
    5623     ExecState* exec = ARG_exec;
     5536    CallFrame* callFrame = ARG_callFrame;
    56245537
    56255538    JSValue* baseValue = ARG_src1;
    5626     JSObject* baseObj = baseValue->toObject(exec); // may throw
     5539    JSObject* baseObj = baseValue->toObject(callFrame); // may throw
    56275540
    56285541    JSValue* subscript = ARG_src2;
     
    56305543    uint32_t i;
    56315544    if (subscript->getUInt32(i))
    5632         result = jsBoolean(baseObj->deleteProperty(exec, i));
     5545        result = jsBoolean(baseObj->deleteProperty(callFrame, i));
    56335546    else {
    56345547        VM_CHECK_EXCEPTION();
    5635         Identifier property(exec, subscript->toString(exec));
     5548        Identifier property(callFrame, subscript->toString(callFrame));
    56365549        VM_CHECK_EXCEPTION();
    5637         result = jsBoolean(baseObj->deleteProperty(exec, property));
     5550        result = jsBoolean(baseObj->deleteProperty(callFrame, property));
    56385551    }
    56395552
     
    56445557void Machine::cti_op_put_getter(CTI_ARGS)
    56455558{
    5646     ExecState* exec = ARG_exec;
     5559    CallFrame* callFrame = ARG_callFrame;
    56475560
    56485561    ASSERT(ARG_src1->isObject());
     
    56505563    Identifier& ident = *ARG_id2;
    56515564    ASSERT(ARG_src3->isObject());
    5652     baseObj->defineGetter(exec, ident, static_cast<JSObject*>(ARG_src3));
     5565    baseObj->defineGetter(callFrame, ident, static_cast<JSObject*>(ARG_src3));
    56535566}
    56545567
    56555568void Machine::cti_op_put_setter(CTI_ARGS)
    56565569{
    5657     ExecState* exec = ARG_exec;
     5570    CallFrame* callFrame = ARG_callFrame;
    56585571
    56595572    ASSERT(ARG_src1->isObject());
     
    56615574    Identifier& ident = *ARG_id2;
    56625575    ASSERT(ARG_src3->isObject());
    5663     baseObj->defineSetter(exec, ident, static_cast<JSObject*>(ARG_src3));
     5576    baseObj->defineSetter(callFrame, ident, static_cast<JSObject*>(ARG_src3));
    56645577}
    56655578
    56665579JSValue* Machine::cti_op_new_error(CTI_ARGS)
    56675580{
    5668     ExecState* exec = ARG_exec;
    5669     Register* r = ARG_r;
    5670     CodeBlock* codeBlock = Machine::codeBlock(r);
     5581    CallFrame* callFrame = ARG_callFrame;
     5582    CodeBlock* codeBlock = callFrame->codeBlock();
    56715583    unsigned type = ARG_int1;
    56725584    JSValue* message = ARG_src2;
    56735585    unsigned lineNumber = ARG_int3;
    56745586
    5675     return Error::create(exec, static_cast<ErrorType>(type), message->toString(exec), lineNumber, codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL());
     5587    return Error::create(callFrame, static_cast<ErrorType>(type), message->toString(callFrame), lineNumber, codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL());
    56765588}
    56775589
    56785590void Machine::cti_op_debug(CTI_ARGS)
    56795591{
    5680     ExecState* exec = ARG_exec;
    5681     Register* r = ARG_r;
     5592    CallFrame* callFrame = ARG_callFrame;
    56825593
    56835594    int debugHookID = ARG_int1;
     
    56855596    int lastLine = ARG_int3;
    56865597
    5687     ARG_globalData->machine->debug(exec, r, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
     5598    ARG_globalData->machine->debug(callFrame, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
    56885599}
    56895600
    56905601void* Machine::cti_vm_throw(CTI_ARGS)
    56915602{
    5692     ExecState* exec = ARG_exec;
    5693     Register* r = ARG_r;
    5694     CodeBlock* codeBlock = Machine::codeBlock(r);
     5603    CallFrame* callFrame = ARG_callFrame;
     5604    CodeBlock* codeBlock = callFrame->codeBlock();
    56955605
    56965606    ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(ARG_globalData->throwReturnAddress));
     
    57015611    ARG_globalData->exception = 0;
    57025612
    5703     Instruction* handlerVPC = ARG_globalData->machine->throwException(exec, exceptionValue, codeBlock->instructions.begin() + vPCIndex, r, false);
     5613    Instruction* handlerVPC = ARG_globalData->machine->throwException(callFrame, exceptionValue, codeBlock->instructions.begin() + vPCIndex, false);
    57045614
    57055615    if (!handlerVPC) {
     
    57085618    }
    57095619
    5710     ARG_setR(r);
    5711     void* catchRoutine = Machine::codeBlock(r)->nativeExceptionCodeForHandlerVPC(handlerVPC);
     5620    ARG_setCallFrame(callFrame);
     5621    void* catchRoutine = callFrame->codeBlock()->nativeExceptionCodeForHandlerVPC(handlerVPC);
    57125622    ASSERT(catchRoutine);
    57135623    ctiSetReturnAddress(&CTI_RETURN_ADDRESS, catchRoutine);
  • trunk/JavaScriptCore/VM/Machine.h

    r37406 r37427  
    4545    class CodeBlock;
    4646    class EvalNode;
    47     class ExecState;
    4847    class FunctionBodyNode;
    4948    class Instruction;
     
    9695        bool isOpcode(Opcode opcode);
    9796       
    98         JSValue* execute(ProgramNode*, ExecState*, ScopeChainNode*, JSObject* thisObj, JSValue** exception);
    99         JSValue* execute(FunctionBodyNode*, ExecState*, JSFunction*, JSObject* thisObj, const ArgList& args, ScopeChainNode*, JSValue** exception);
    100         JSValue* execute(EvalNode* evalNode, ExecState* exec, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue** exception);
    101 
    102         JSValue* retrieveArguments(ExecState*, JSFunction*) const;
    103         JSValue* retrieveCaller(ExecState*, InternalFunction*) const;
    104         void retrieveLastCaller(ExecState* exec, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const;
    105        
    106         static ScopeChainNode* scopeChain(const Register* r) { return r[RegisterFile::ScopeChain].scopeChain(); }
    107         static CodeBlock* codeBlock(const Register* r) { return r[RegisterFile::CodeBlock].codeBlock(); }
    108 
    109         void getArgumentsData(Register* callFrame, JSFunction*&, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc);
     97        JSValue* execute(ProgramNode*, CallFrame*, ScopeChainNode*, JSObject* thisObj, JSValue** exception);
     98        JSValue* execute(FunctionBodyNode*, CallFrame*, JSFunction*, JSObject* thisObj, const ArgList& args, ScopeChainNode*, JSValue** exception);
     99        JSValue* execute(EvalNode* evalNode, CallFrame* exec, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue** exception);
     100
     101        JSValue* retrieveArguments(CallFrame*, JSFunction*) const;
     102        JSValue* retrieveCaller(CallFrame*, InternalFunction*) const;
     103        void retrieveLastCaller(CallFrame*, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const;
     104       
     105        void getArgumentsData(CallFrame*, JSFunction*&, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc);
    110106        void setTimeoutTime(unsigned timeoutTime) { m_timeoutTime = timeoutTime; }
    111107       
     
    240236        bool isJSArray(JSValue* v) { return !JSImmediate::isImmediate(v) && v->asCell()->vptr() == m_jsArrayVptr; }
    241237        bool isJSString(JSValue* v) { return !JSImmediate::isImmediate(v) && v->asCell()->vptr() == m_jsStringVptr; }
    242        
    243         ALWAYS_INLINE static void initializeCallFrame(Register* callFrame, CodeBlock*, Instruction*, ScopeChainNode*, Register* r, int returnValueRegister, int argc, JSValue* function);
    244238
    245239    private:
    246240        enum ExecutionFlag { Normal, InitializeAndReturn };
    247241
    248         NEVER_INLINE JSValue* callEval(ExecState* exec, JSObject* thisObj, ScopeChainNode* scopeChain, RegisterFile*, Register* r, int argv, int argc, JSValue*& exceptionValue);
    249         JSValue* execute(EvalNode*, ExecState*, JSObject* thisObj, int registerOffset, ScopeChainNode*, JSValue** exception);
    250 
    251         NEVER_INLINE void debug(ExecState*, Register*, DebugHookID, int firstLine, int lastLine);
    252 
    253         NEVER_INLINE bool resolve(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue);
    254         NEVER_INLINE bool resolveSkip(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue);
    255         NEVER_INLINE bool resolveGlobal(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue);
    256         NEVER_INLINE void resolveBase(ExecState* exec, Instruction* vPC, Register* r);
    257         NEVER_INLINE bool resolveBaseAndProperty(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue);
    258         NEVER_INLINE ScopeChainNode* createExceptionScope(ExecState* exec, const Instruction* vPC, Register* r);
    259 
    260         NEVER_INLINE bool unwindCallFrame(ExecState*&, JSValue*, const Instruction*&, CodeBlock*&, Register*&);
    261         NEVER_INLINE Instruction* throwException(ExecState*, JSValue*&, const Instruction*, Register*&, bool);
    262         NEVER_INLINE bool resolveBaseAndFunc(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue);
    263 
    264         Register* callFrame(ExecState*, InternalFunction*) const;
    265 
    266         JSValue* privateExecute(ExecutionFlag, RegisterFile*, Register*, JSValue** exception);
    267 
    268         void dumpCallFrame(const RegisterFile*, const Register*);
    269         void dumpRegisters(const RegisterFile*, const Register*);
     242        NEVER_INLINE JSValue* callEval(CallFrame*, JSObject* thisObject, ScopeChainNode*, RegisterFile*, int argv, int argc, JSValue*& exceptionValue);
     243        JSValue* execute(EvalNode*, CallFrame*, JSObject* thisObject, int registerOffset, ScopeChainNode*, JSValue** exception);
     244
     245        NEVER_INLINE void debug(CallFrame*, DebugHookID, int firstLine, int lastLine);
     246
     247        NEVER_INLINE bool resolve(CallFrame*, Instruction*, JSValue*& exceptionValue);
     248        NEVER_INLINE bool resolveSkip(CallFrame*, Instruction*, JSValue*& exceptionValue);
     249        NEVER_INLINE bool resolveGlobal(CallFrame*, Instruction*, JSValue*& exceptionValue);
     250        NEVER_INLINE void resolveBase(CallFrame*, Instruction* vPC);
     251        NEVER_INLINE bool resolveBaseAndProperty(CallFrame*, Instruction*, JSValue*& exceptionValue);
     252        NEVER_INLINE ScopeChainNode* createExceptionScope(CallFrame*, const Instruction* vPC);
     253
     254        NEVER_INLINE bool unwindCallFrame(CallFrame*&, JSValue*, const Instruction*&, CodeBlock*&);
     255        NEVER_INLINE Instruction* throwException(CallFrame*&, JSValue*&, const Instruction*, bool);
     256        NEVER_INLINE bool resolveBaseAndFunc(CallFrame*, Instruction*, JSValue*& exceptionValue);
     257
     258        static ALWAYS_INLINE CallFrame* slideRegisterWindowForCall(CodeBlock*, RegisterFile*, CallFrame*, size_t registerOffset, int argc);
     259
     260        static CallFrame* findFunctionCallFrame(CallFrame*, InternalFunction*);
     261
     262        JSValue* privateExecute(ExecutionFlag, RegisterFile*, CallFrame*, JSValue** exception);
     263
     264        void dumpCallFrame(const RegisterFile*, CallFrame*);
     265        void dumpRegisters(const RegisterFile*, CallFrame*);
    270266
    271267        JSValue* checkTimeout(JSGlobalObject*);
    272268        void resetTimeoutCheck();
    273269
    274         void tryCacheGetByID(ExecState*, CodeBlock*, Instruction* vPC, JSValue* baseValue, const Identifier& propertyName, const PropertySlot&);
     270        void tryCacheGetByID(CallFrame*, CodeBlock*, Instruction*, JSValue* baseValue, const Identifier& propertyName, const PropertySlot&);
    275271        void uncacheGetByID(CodeBlock*, Instruction* vPC);
    276         void tryCachePutByID(ExecState* exec, CodeBlock*, Instruction* vPC, JSValue* baseValue, const PutPropertySlot&);
     272        void tryCachePutByID(CallFrame*, CodeBlock*, Instruction*, JSValue* baseValue, const PutPropertySlot&);
    277273        void uncachePutByID(CodeBlock*, Instruction* vPC);
    278274
    279275#if ENABLE(CTI)
    280         void tryCTICacheGetByID(ExecState*, CodeBlock*, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot&);
    281         void tryCTICachePutByID(ExecState*, CodeBlock*, void* returnAddress, JSValue* baseValue, const PutPropertySlot&);
    282 
    283         void* getCTIArrayLengthTrampoline(ExecState*, CodeBlock*);
    284         void* getCTIStringLengthTrampoline(ExecState*, CodeBlock*);
     276        void tryCTICacheGetByID(CallFrame*, CodeBlock*, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot&);
     277        void tryCTICachePutByID(CallFrame*, CodeBlock*, void* returnAddress, JSValue* baseValue, const PutPropertySlot&);
     278
     279        void* getCTIArrayLengthTrampoline(CallFrame*, CodeBlock*);
     280        void* getCTIStringLengthTrampoline(CallFrame*, CodeBlock*);
    285281
    286282        void* m_ctiArrayLengthTrampoline;
     
    310306    };
    311307
    312     ALWAYS_INLINE void Machine::initializeCallFrame(Register* callFrame, CodeBlock* codeBlock, Instruction* vPC, ScopeChainNode* scopeChain, Register* r, int returnValueRegister, int argc, JSValue* function)
    313     {
    314         ASSERT(r); // use makeHostCallFramePointer(0) to create a host call frame sentinel.
    315         callFrame[RegisterFile::CodeBlock] = codeBlock;
    316         callFrame[RegisterFile::ScopeChain] = scopeChain;
    317         callFrame[RegisterFile::CallerRegisters] = r;
    318         callFrame[RegisterFile::ReturnPC] = vPC;
    319         callFrame[RegisterFile::ReturnValueRegister] = returnValueRegister;
    320         callFrame[RegisterFile::ArgumentCount] = argc; // original argument count (for the sake of the "arguments" object)
    321         callFrame[RegisterFile::Callee] = function;
    322         callFrame[RegisterFile::OptionalCalleeArguments] = nullJSValue;
    323     }
    324 
    325     const intptr_t HostCallFrameMask = 1;
    326 
    327     inline Register* makeHostCallFramePointer(Register* callFrame)
    328     {
    329         return reinterpret_cast<Register*>(reinterpret_cast<intptr_t>(callFrame) | HostCallFrameMask);
    330     }
    331 
    332     inline bool isHostCallFrame(Register* callFrame)
    333     {
    334         return reinterpret_cast<intptr_t>(callFrame) & HostCallFrameMask;
    335     }
    336 
    337     inline Register* stripHostCallFrameBit(Register* callFrame)
    338     {
    339         return reinterpret_cast<Register*>(reinterpret_cast<intptr_t>(callFrame) & ~HostCallFrameMask);
    340     }
    341 
    342308} // namespace JSC
    343309
  • trunk/JavaScriptCore/VM/Register.h

    r36263 r37427  
    3535namespace JSC {
    3636
     37    class Arguments;
    3738    class CodeBlock;
    3839    class ExecState;
     40    class JSActivation;
     41    class JSFunction;
    3942    class JSPropertyNameIterator;
    4043    class JSValue;
    4144    class ScopeChainNode;
     45
    4246    struct Instruction;
    43    
     47
     48    typedef ExecState CallFrame;
     49
    4450    static JSValue* const nullJSValue = 0;
    4551
     
    4955        Register(JSValue*);
    5056
    51         JSValue* jsValue(ExecState*) const;
     57        JSValue* jsValue(CallFrame*) const;
    5258        JSValue* getJSValue() const;
    5359
     
    5662       
    5763    private:
     64        friend class ExecState;
    5865        friend class Machine;
    5966
    60         // Only the Machine should use these functions.
    61 
     67        // Only CallFrame and Machine should use these functions.
     68
     69        Register(intptr_t);
     70
     71        Register(JSActivation*);
     72        Register(Arguments*);
     73        Register(CallFrame*);
    6274        Register(CodeBlock*);
     75        Register(JSFunction*);
     76        Register(JSPropertyNameIterator*);
    6377        Register(ScopeChainNode*);
    64         Register(intptr_t);
    65         Register(Register*);
    6678        Register(Instruction*);
    67         Register(JSPropertyNameIterator*);
    68         explicit Register(void*);
    69 
     79
     80        intptr_t i() const;
     81        void* v() const;
     82
     83        JSActivation* activation() const;
     84        Arguments* arguments() const;
     85        CallFrame* callFrame() const;
    7086        CodeBlock* codeBlock() const;
     87        JSFunction* function() const;
     88        JSPropertyNameIterator* propertyNameIterator() const;
    7189        ScopeChainNode* scopeChain() const;
    72         intptr_t i() const;
    73         Register* r() const;
    7490        Instruction* vPC() const;
    75         JSPropertyNameIterator* jsPropertyNameIterator() const;
    76         void* v() const;
    7791
    7892        union {
    79         private:
    80             friend class Register;
    81 
     93            intptr_t i;
     94            void* v;
     95            JSValue* value;
     96
     97            JSActivation* activation;
     98            Arguments* arguments;
     99            CallFrame* callFrame;
    82100            CodeBlock* codeBlock;
     101            JSFunction* function;
     102            JSPropertyNameIterator* propertyNameIterator;
     103            ScopeChainNode* scopeChain;
    83104            Instruction* vPC;
    84             JSValue* jsValue;
    85             ScopeChainNode* scopeChain;
    86             JSPropertyNameIterator* jsPropertyNameIterator;
    87             Register* r;
    88             void* v;
    89             intptr_t i;
    90105        } u;
    91106
    92107#ifndef NDEBUG
    93108        enum {
    94             CodeBlockType = 0,
    95             InstructionType,
    96             JSValueType,
    97             ScopeChainNodeType,
    98             JSPropertyNameIteratorType,
    99             RegisterType,
    100             IntType
     109            EmptyType,
     110
     111            IntType,
     112            ValueType,
     113
     114            ActivationType,
     115            ArgumentsType,
     116            CallFrameType,
     117            CodeBlockType,
     118            FunctionType,
     119            InstructionType,
     120            PropertyNameIteratorType,
     121            RegisterType,
     122            ScopeChainNodeType
    101123        } m_type;
    102124#endif
    103 
    104 // FIXME: The commented out ASSERTs below are valid; NDEBUG CTI should set these when up to date.
    105 //        static inline ptrdiff_t offsetOf_type()
    106 //        {
    107 //            return OBJECT_OFFSET(Register, m_type);
    108 //        }
    109125    };
    110126
     127#ifndef NDEBUG
     128    #define SET_TYPE(type) m_type = (type)
     129    // FIXME: The CTI code to put value into registers doesn't set m_type.
     130    // Once it does, we can turn this assertion back on.
     131    #define ASSERT_TYPE(type)
     132#else
     133    #define SET_TYPE(type)
     134    #define ASSERT_TYPE(type)
     135#endif
     136
    111137    ALWAYS_INLINE Register::Register()
    112138    {
    113139#ifndef NDEBUG
     140        SET_TYPE(EmptyType);
    114141        *this = nullJSValue;
    115142#endif
     
    118145    ALWAYS_INLINE Register::Register(JSValue* v)
    119146    {
    120 #ifndef NDEBUG
    121         m_type = JSValueType;
    122 #endif
    123         u.jsValue = v;
     147        SET_TYPE(ValueType);
     148        u.value = v;
    124149    }
    125150   
    126151    // This function is scaffolding for legacy clients. It will eventually go away.
    127     ALWAYS_INLINE JSValue* Register::jsValue(ExecState*) const
     152    ALWAYS_INLINE JSValue* Register::jsValue(CallFrame*) const
    128153    {
    129154        // Once registers hold doubles, this function will allocate a JSValue*
    130155        // if the register doesn't hold one already.
    131 //        ASSERT(m_type == JSValueType);
    132         return u.jsValue;
     156        ASSERT_TYPE(ValueType);
     157        return u.value;
    133158    }
    134159   
    135160    ALWAYS_INLINE JSValue* Register::getJSValue() const
    136161    {
    137 //        ASSERT(m_type == JSValueType);
    138         return u.jsValue;
     162        ASSERT_TYPE(JSValueType);
     163        return u.value;
    139164    }
    140165   
     
    151176    // Machine functions
    152177
     178    ALWAYS_INLINE Register::Register(Arguments* arguments)
     179    {
     180        SET_TYPE(ArgumentsType);
     181        u.arguments = arguments;
     182    }
     183
     184    ALWAYS_INLINE Register::Register(JSActivation* activation)
     185    {
     186        SET_TYPE(ActivationType);
     187        u.activation = activation;
     188    }
     189
     190    ALWAYS_INLINE Register::Register(CallFrame* callFrame)
     191    {
     192        SET_TYPE(CallFrameType);
     193        u.callFrame = callFrame;
     194    }
     195
    153196    ALWAYS_INLINE Register::Register(CodeBlock* codeBlock)
    154197    {
    155 #ifndef NDEBUG
    156         m_type = CodeBlockType;
    157 #endif
     198        SET_TYPE(CodeBlockType);
    158199        u.codeBlock = codeBlock;
    159200    }
    160201
     202    ALWAYS_INLINE Register::Register(JSFunction* function)
     203    {
     204        SET_TYPE(FunctionType);
     205        u.function = function;
     206    }
     207
    161208    ALWAYS_INLINE Register::Register(Instruction* vPC)
    162209    {
    163 #ifndef NDEBUG
    164         m_type = InstructionType;
    165 #endif
     210        SET_TYPE(InstructionType);
    166211        u.vPC = vPC;
    167212    }
     
    169214    ALWAYS_INLINE Register::Register(ScopeChainNode* scopeChain)
    170215    {
    171 #ifndef NDEBUG
    172         m_type = ScopeChainNodeType;
    173 #endif
     216        SET_TYPE(ScopeChainNodeType);
    174217        u.scopeChain = scopeChain;
    175218    }
    176219
    177     ALWAYS_INLINE Register::Register(JSPropertyNameIterator* jsPropertyNameIterator)
    178     {
    179 #ifndef NDEBUG
    180         m_type = JSPropertyNameIteratorType;
    181 #endif
    182         u.jsPropertyNameIterator = jsPropertyNameIterator;
    183     }
    184 
    185     ALWAYS_INLINE Register::Register(Register* r)
    186     {
    187 #ifndef NDEBUG
    188         m_type = RegisterType;
    189 #endif
    190         u.r = r;
     220    ALWAYS_INLINE Register::Register(JSPropertyNameIterator* propertyNameIterator)
     221    {
     222        SET_TYPE(PropertyNameIteratorType);
     223        u.propertyNameIterator = propertyNameIterator;
    191224    }
    192225
    193226    ALWAYS_INLINE Register::Register(intptr_t i)
    194227    {
    195 #ifndef NDEBUG
    196         m_type = IntType;
    197 #endif
     228        SET_TYPE(IntType);
    198229        u.i = i;
    199230    }
    200231
    201     ALWAYS_INLINE Register::Register(void* v)
    202     {
    203         u.v = v;
    204     }
    205 
     232    ALWAYS_INLINE intptr_t Register::i() const
     233    {
     234        ASSERT_TYPE(IntType);
     235        return u.i;
     236    }
     237   
     238    ALWAYS_INLINE void* Register::v() const
     239    {
     240        return u.v;
     241    }
     242
     243    ALWAYS_INLINE JSActivation* Register::activation() const
     244    {
     245        ASSERT_TYPE(ActivationType);
     246        return u.activation;
     247    }
     248   
     249    ALWAYS_INLINE Arguments* Register::arguments() const
     250    {
     251        ASSERT_TYPE(ArgumentsType);
     252        return u.arguments;
     253    }
     254   
     255    ALWAYS_INLINE CallFrame* Register::callFrame() const
     256    {
     257        ASSERT_TYPE(CallFrameType);
     258        return u.callFrame;
     259    }
     260   
    206261    ALWAYS_INLINE CodeBlock* Register::codeBlock() const
    207262    {
    208 //        ASSERT(m_type == CodeBlockType);
     263        ASSERT_TYPE(CodeBlockType);
    209264        return u.codeBlock;
    210265    }
    211266   
     267    ALWAYS_INLINE JSFunction* Register::function() const
     268    {
     269        ASSERT_TYPE(FunctionType);
     270        return u.function;
     271    }
     272   
     273    ALWAYS_INLINE JSPropertyNameIterator* Register::propertyNameIterator() const
     274    {
     275        ASSERT_TYPE(PropertyNameIteratorType);
     276        return u.propertyNameIterator;
     277    }
     278   
    212279    ALWAYS_INLINE ScopeChainNode* Register::scopeChain() const
    213280    {
    214 //        ASSERT(m_type == ScopeChainNodeType);
     281        ASSERT_TYPE(ScopeChainNodeType);
    215282        return u.scopeChain;
    216283    }
    217284   
    218     ALWAYS_INLINE intptr_t Register::i() const
    219     {
    220 //        ASSERT(m_type == IntType);
    221         return u.i;
    222     }
    223    
    224     ALWAYS_INLINE Register* Register::r() const
    225     {
    226 //        ASSERT(m_type == RegisterType);
    227         return u.r;
    228     }
    229    
    230285    ALWAYS_INLINE Instruction* Register::vPC() const
    231286    {
    232 //        ASSERT(m_type == InstructionType);
     287        ASSERT_TYPE(InstructionType);
    233288        return u.vPC;
    234289    }
    235    
    236     ALWAYS_INLINE JSPropertyNameIterator* Register::jsPropertyNameIterator() const
    237     {
    238 //        ASSERT(m_type == JSPropertyNameIteratorType);
    239         return u.jsPropertyNameIterator;
    240     }
    241    
    242     ALWAYS_INLINE void* Register::v() const
    243     {
    244         return u.v;
    245     }
     290
     291    #undef SET_TYPE
     292    #undef ASSERT_TYPE
    246293
    247294} // namespace JSC
  • trunk/JavaScriptCore/VM/RegisterFile.h

    r37366 r37427  
    9595            CodeBlock = -8,
    9696            ScopeChain = -7,
    97             CallerRegisters = -6,
     97            CallerFrame = -6,
    9898            ReturnPC = -5,
    9999            ReturnValueRegister = -4,
  • trunk/JavaScriptCore/kjs/Arguments.h

    r37324 r37427  
    5252    class Arguments : public JSObject {
    5353    public:
    54         Arguments(ExecState*, Register* callFrame);
     54        Arguments(CallFrame*);
    5555        virtual ~Arguments();
    5656
     
    7575        virtual const ClassInfo* classInfo() const { return &info; }
    7676
    77         void init(ExecState*, Register* callFrame);
     77        void init(CallFrame*);
    7878
    7979        OwnPtr<ArgumentsData> d;
    8080    };
    8181
    82     inline Arguments::Arguments(ExecState* exec, Register* callFrame)
    83         : JSObject(exec->lexicalGlobalObject()->argumentsStructure())
     82    inline Arguments::Arguments(CallFrame* callFrame)
     83        : JSObject(callFrame->lexicalGlobalObject()->argumentsStructure())
    8484        , d(new ArgumentsData)
    8585    {
     
    8888        Register* argv;
    8989        int numArguments;
    90         exec->machine()->getArgumentsData(callFrame, callee, firstParameterIndex, argv, numArguments);
     90        callFrame->machine()->getArgumentsData(callFrame, callee, firstParameterIndex, argv, numArguments);
    9191
    9292        d->numParameters = callee->m_body->parameterCount();
     
    9494        d->numArguments = numArguments;
    9595
    96         d->registers = callFrame;
     96        d->registers = callFrame->registers();
    9797
    9898        Register* extraArguments;
  • trunk/JavaScriptCore/kjs/DebuggerCallFrame.cpp

    r37297 r37427  
    3939const UString* DebuggerCallFrame::functionName() const
    4040{
    41     if (!m_codeBlock)
     41    if (!m_callFrame->codeBlock())
    4242        return 0;
    4343
    44     JSFunction* function = static_cast<JSFunction*>(m_registers[RegisterFile::Callee].getJSValue());
     44    JSFunction* function = static_cast<JSFunction*>(m_callFrame->callee());
    4545    if (!function)
    4646        return 0;
    47     return &function->name(m_scopeChain->globalData);
     47    return &function->name(&m_callFrame->globalData());
    4848}
    4949
    5050DebuggerCallFrame::Type DebuggerCallFrame::type() const
    5151{
    52     if (m_registers[RegisterFile::Callee].getJSValue())
     52    if (m_callFrame->callee())
    5353        return FunctionType;
    5454
     
    5858JSObject* DebuggerCallFrame::thisObject() const
    5959{
    60     if (!m_codeBlock)
     60    if (!m_callFrame->codeBlock())
    6161        return 0;
    6262
    63     return static_cast<JSObject*>(m_registers[m_codeBlock->thisRegister].getJSValue());
     63    // FIXME: Why is it safe to cast this to JSObject?
     64    return static_cast<JSObject*>(m_callFrame->thisValue());
    6465}
    6566
    6667JSValue* DebuggerCallFrame::evaluate(const UString& script, JSValue*& exception) const
    6768{
    68     if (!m_codeBlock)
     69    if (!m_callFrame->codeBlock())
    6970        return 0;
    7071
     
    7273    UString errMsg;
    7374    SourceCode source = makeSource(script);
    74     RefPtr<EvalNode> evalNode = m_scopeChain->globalData->parser->parse<EvalNode>(CallFrame::create(m_registers), source, &errLine, &errMsg);
     75    RefPtr<EvalNode> evalNode = m_callFrame->scopeChain()->globalData->parser->parse<EvalNode>(m_callFrame, source, &errLine, &errMsg);
    7576    if (!evalNode)
    76         return Error::create(CallFrame::create(m_registers), SyntaxError, errMsg, errLine, source.provider()->asID(), source.provider()->url());
     77        return Error::create(m_callFrame, SyntaxError, errMsg, errLine, source.provider()->asID(), source.provider()->url());
    7778
    78     return m_scopeChain->globalData->machine->execute(evalNode.get(), CallFrame::create(m_registers), thisObject(), m_scopeChain, &exception);
     79    return m_callFrame->scopeChain()->globalData->machine->execute(evalNode.get(), m_callFrame, thisObject(), m_callFrame->scopeChain(), &exception);
    7980}
    8081
  • trunk/JavaScriptCore/kjs/DebuggerCallFrame.h

    r37297 r37427  
    3030#define DebuggerCallFrame_h
    3131
     32#include "ExecState.h"
     33
    3234namespace JSC {
    33    
    34     class CodeBlock;
    35     class ExecState;
    36     class JSGlobalObject;
    37     class JSObject;
    38     class JSValue;
    39     class Machine;
    40     class UString;
    41     class Register;
    42     class ScopeChainNode;
    4335   
    4436    class DebuggerCallFrame {
    4537    public:
    46         enum Type {
    47             ProgramType,
    48             FunctionType
    49         };
     38        enum Type { ProgramType, FunctionType };
    5039
    51         DebuggerCallFrame(JSGlobalObject* dynamicGlobalObject, const CodeBlock* codeBlock, ScopeChainNode* scopeChain, Register* r, JSValue* exception)
    52             : m_dynamicGlobalObject(dynamicGlobalObject)
    53             , m_codeBlock(codeBlock)
    54             , m_scopeChain(scopeChain)
    55             , m_registers(r)
     40        DebuggerCallFrame(CallFrame* callFrame, JSValue* exception)
     41            : m_callFrame(callFrame)
    5642            , m_exception(exception)
    5743        {
    5844        }
    5945
    60         JSGlobalObject* dynamicGlobalObject() const { return m_dynamicGlobalObject; }
    61         const ScopeChainNode* scopeChain() const { return m_scopeChain; }
     46        JSGlobalObject* dynamicGlobalObject() const { return m_callFrame->dynamicGlobalObject(); }
     47        const ScopeChainNode* scopeChain() const { return m_callFrame->scopeChain(); }
    6248        const UString* functionName() const;
    6349        Type type() const;
     
    6753
    6854    private:
    69         JSGlobalObject* m_dynamicGlobalObject;
    70         const CodeBlock* m_codeBlock;
    71         ScopeChainNode* m_scopeChain;
    72         Register* m_registers;
     55        CallFrame* m_callFrame;
    7356        JSValue* m_exception;
    7457    };
  • trunk/JavaScriptCore/kjs/ExecState.cpp

    r37257 r37427  
    1 /* delete me */
     1/*
     2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
     3 *
     4 * Redistribution and use in source and binary forms, with or without
     5 * modification, are permitted provided that the following conditions
     6 * are met:
     7 * 1. Redistributions of source code must retain the above copyright
     8 *    notice, this list of conditions and the following disclaimer.
     9 * 2. Redistributions in binary form must reproduce the above copyright
     10 *    notice, this list of conditions and the following disclaimer in the
     11 *    documentation and/or other materials provided with the distribution.
     12 *
     13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
     14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     16 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
     17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
     20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
     21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     24 */
     25
     26#include "config.h"
     27#include "ExecState.h"
     28
     29#include "CodeBlock.h"
     30
     31namespace JSC {
     32
     33JSValue* CallFrame::thisValue()
     34{
     35    return this[codeBlock()->thisRegister].jsValue(this);
     36}
     37
     38}
  • trunk/JavaScriptCore/kjs/ExecState.h

    r37323 r37427  
    2424#define ExecState_h
    2525
     26// FIXME: Rename this file to CallFrame.h.
     27
    2628#include "JSGlobalData.h"
    2729#include "Machine.h"
     
    3032namespace JSC  {
    3133
    32     class ExecState;
    33     class JSValue;
    34     class Register;
    35 
    36     typedef ExecState CallFrame;
     34    class Arguments;
     35    class JSActivation;
    3736
    3837    // Represents the current state of script execution.
    3938    // Passed as the first argument to most functions.
    40     class ExecState : private Register, Noncopyable {
     39    class ExecState : private Register {
    4140    public:
    42         static CallFrame* create(Register* callFrameBase) { return static_cast<CallFrame*>(callFrameBase); }
    43         Register* registers() { return this; }
     41        JSFunction* callee() const { return this[RegisterFile::Callee].function(); }
     42        CodeBlock* codeBlock() const { return this[RegisterFile::CodeBlock].codeBlock(); }
     43        ScopeChainNode* scopeChain() const { return this[RegisterFile::ScopeChain].scopeChain(); }
     44
     45        JSValue* thisValue();
    4446
    4547        // Global object in which execution began.
     
    4850        // Global object in which the currently executing code was defined.
    4951        // Differs from dynamicGlobalObject() during function calls across web browser frames.
    50         JSGlobalObject* lexicalGlobalObject()
     52        JSGlobalObject* lexicalGlobalObject() const
    5153        {
    52             return Machine::scopeChain(this)->globalObject();
     54            return scopeChain()->globalObject();
    5355        }
    5456
    5557        // Differs from lexicalGlobalObject because this will have DOM window shell rather than
    56         // the actual DOM window.
    57         JSObject* globalThisValue()
     58        // the actual DOM window, which can't be "this" for security reasons.
     59        JSObject* globalThisValue() const
    5860        {
    59             return Machine::scopeChain(this)->globalThisObject();
     61            return scopeChain()->globalThisObject();
    6062        }
    6163
    62         JSGlobalData& globalData()
     64        // FIXME: Elsewhere, we use JSGlobalData* rather than JSGlobalData&.
     65        // We should make this more uniform and either use a reference everywhere
     66        // or a pointer everywhere.
     67        JSGlobalData& globalData() const
    6368        {
    64             return *Machine::scopeChain(this)->globalData;
     69            return *scopeChain()->globalData;
    6570        }
    6671
    6772        // Convenience functions for access to global data.
     73        // It takes a few memory references to get from a call frame to the global data
     74        // pointer, so these are inefficient, and should be used sparingly in new code.
     75        // But they're used in many places in legacy code, so they're not going away any time soon.
    6876
    6977        void setException(JSValue* exception) { globalData().exception = exception; }
    7078        void clearException() { globalData().exception = 0; }
    71         JSValue* exception() { return globalData().exception; }
     79        JSValue* exception() const { return globalData().exception; }
    7280        JSValue** exceptionSlot() { return &globalData().exception; }
    73         bool hadException() { return !!globalData().exception; }
     81        bool hadException() const { return !!globalData().exception; }
    7482
    75         IdentifierTable* identifierTable() { return globalData().identifierTable; }
    76         const CommonIdentifiers& propertyNames() { return *globalData().propertyNames; }
    77         const ArgList& emptyList() { return *globalData().emptyList; }
    78         Lexer* lexer() { return globalData().lexer; }
    79         Parser* parser() { return globalData().parser; }
     83        const CommonIdentifiers& propertyNames() const { return *globalData().propertyNames; }
     84        const ArgList& emptyList() const { return *globalData().emptyList; }
    8085        Machine* machine() { return globalData().machine; }
    8186        Heap* heap() { return &globalData().heap; }
     
    9095
    9196    private:
     97        friend class Arguments;
     98        friend class JSActivation;
     99        friend class JSGlobalObject;
     100        friend class Machine;
     101
     102        static CallFrame* create(Register* callFrameBase) { return static_cast<CallFrame*>(callFrameBase); }
     103        Register* registers() { return this; }
     104
     105        CallFrame& operator=(const Register& r) { *static_cast<Register*>(this) = r; return *this; }
     106
     107        int argumentCount() const { return this[RegisterFile::ArgumentCount].i(); }
     108        CallFrame* callerFrame() const { return this[RegisterFile::CallerFrame].callFrame(); }
     109        Arguments* optionalCalleeArguments() const { return this[RegisterFile::OptionalCalleeArguments].arguments(); }
     110        Instruction* returnPC() const { return this[RegisterFile::ReturnPC].vPC(); }
     111        int returnValueRegister() const { return this[RegisterFile::ReturnValueRegister].i(); }
     112
     113        void setArgumentCount(int count) { this[RegisterFile::ArgumentCount] = count; }
     114        void setCallee(JSFunction* callee) { this[RegisterFile::Callee] = callee; }
     115        void setCalleeArguments(Arguments* arguments) { this[RegisterFile::OptionalCalleeArguments] = arguments; }
     116        void setCallerFrame(CallFrame* callerFrame) { this[RegisterFile::CallerFrame] = callerFrame; }
     117        void setCodeBlock(CodeBlock* codeBlock) { this[RegisterFile::CodeBlock] = codeBlock; }
     118        void setScopeChain(ScopeChainNode* scopeChain) { this[RegisterFile::ScopeChain] = scopeChain; }
     119
     120        ALWAYS_INLINE void init(CodeBlock* codeBlock, Instruction* vPC, ScopeChainNode* scopeChain,
     121            CallFrame* callerFrame, int returnValueRegister, int argc, JSFunction* function)
     122        {
     123            ASSERT(callerFrame); // Use noCaller() rather than 0 for the outer host call frame caller.
     124
     125            setCodeBlock(codeBlock);
     126            setScopeChain(scopeChain);
     127            setCallerFrame(callerFrame);
     128            this[RegisterFile::ReturnPC] = vPC;
     129            this[RegisterFile::ReturnValueRegister] = returnValueRegister;
     130            setArgumentCount(argc); // original argument count (for the sake of the "arguments" object)
     131            setCallee(function);
     132            setCalleeArguments(0);
     133        }
     134
     135        static const intptr_t HostCallFrameFlag = 1;
     136
     137        static CallFrame* noCaller() { return reinterpret_cast<CallFrame*>(HostCallFrameFlag); }
     138        bool hasHostCallFrameFlag() const { return reinterpret_cast<intptr_t>(this) & HostCallFrameFlag; }
     139        CallFrame* addHostCallFrameFlag() const { return reinterpret_cast<CallFrame*>(reinterpret_cast<intptr_t>(this) | HostCallFrameFlag); }
     140        CallFrame* removeHostCallFrameFlag() { return reinterpret_cast<CallFrame*>(reinterpret_cast<intptr_t>(this) & ~HostCallFrameFlag); }
     141
    92142        ExecState();
    93143        ~ExecState();
  • trunk/JavaScriptCore/kjs/FunctionConstructor.cpp

    r37257 r37427  
    8888    UString errMsg;
    8989    SourceCode source = makeSource(body, sourceURL, lineNumber);
    90     RefPtr<FunctionBodyNode> functionBody = exec->parser()->parse<FunctionBodyNode>(exec, source, &errLine, &errMsg);
     90    RefPtr<FunctionBodyNode> functionBody = exec->globalData().parser->parse<FunctionBodyNode>(exec, source, &errLine, &errMsg);
    9191
    9292    // No program node == syntax error - throw a syntax error
  • trunk/JavaScriptCore/kjs/JSActivation.cpp

    r37324 r37427  
    4040const ClassInfo JSActivation::info = { "JSActivation", 0, 0, 0 };
    4141
    42 JSActivation::JSActivation(ExecState* exec, PassRefPtr<FunctionBodyNode> functionBody, Register* registers)
    43     : Base(exec->globalData().activationStructureID, new JSActivationData(functionBody, registers))
     42JSActivation::JSActivation(CallFrame* callFrame, PassRefPtr<FunctionBodyNode> functionBody)
     43    : Base(callFrame->globalData().activationStructureID, new JSActivationData(functionBody, callFrame))
    4444{
    4545}
     
    154154JSValue* JSActivation::argumentsGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
    155155{
    156     JSActivation* thisObj = static_cast<JSActivation*>(slot.slotBase());
     156    JSActivation* activation = static_cast<JSActivation*>(slot.slotBase());
    157157
    158     if (thisObj->d()->functionBody->usesArguments()) {
     158    if (activation->d()->functionBody->usesArguments()) {
    159159        PropertySlot slot;
    160         thisObj->symbolTableGet(exec->propertyNames().arguments, slot);
     160        activation->symbolTableGet(exec->propertyNames().arguments, slot);
    161161        return slot.getValue(exec, exec->propertyNames().arguments);
    162162    }
    163163
    164     Arguments* arguments = static_cast<Arguments*>(thisObj->d()->registers[RegisterFile::OptionalCalleeArguments].getJSValue());
     164    CallFrame* callFrame = CallFrame::create(activation->d()->registers);
     165    Arguments* arguments = callFrame->optionalCalleeArguments();
    165166    if (!arguments) {
    166         arguments = new (exec) Arguments(exec, &thisObj->registerAt(0));
     167        arguments = new (exec) Arguments(exec);
    167168        arguments->copyRegisters();
    168         thisObj->d()->registers[RegisterFile::OptionalCalleeArguments] = arguments;
     169        callFrame->setCalleeArguments(arguments);
    169170    }
    170171    ASSERT(arguments->isObject(&Arguments::info));
  • trunk/JavaScriptCore/kjs/JSActivation.h

    r37324 r37427  
    4444        typedef JSVariableObject Base;
    4545    public:
    46         JSActivation(ExecState*, PassRefPtr<FunctionBodyNode>, Register*);
     46        JSActivation(CallFrame*, PassRefPtr<FunctionBodyNode>);
    4747        virtual ~JSActivation();
    4848
  • trunk/JavaScriptCore/kjs/JSGlobalObject.cpp

    r37297 r37427  
    130130    d()->globalScopeChain = ScopeChain(this, d()->globalData.get(), thisValue);
    131131
    132     Machine::initializeCallFrame(d()->globalCallFrame + RegisterFile::CallFrameHeaderSize, 0, 0, d()->globalScopeChain.node(), makeHostCallFramePointer(0), 0, 0, 0);
     132    JSGlobalObject::globalExec()->init(0, 0, d()->globalScopeChain.node(), CallFrame::noCaller(), 0, 0, 0);
    133133
    134134    if (JSGlobalObject*& headObject = head()) {
  • trunk/JavaScriptCore/kjs/JSGlobalObjectFunctions.cpp

    r37184 r37427  
    287287
    288288    SourceCode source = makeSource(s);
    289     RefPtr<EvalNode> evalNode = exec->parser()->parse<EvalNode>(exec, source, &errLine, &errMsg);
     289    RefPtr<EvalNode> evalNode = exec->globalData().parser->parse<EvalNode>(exec, source, &errLine, &errMsg);
    290290
    291291    if (!evalNode)
  • trunk/JavaScriptCore/kjs/JSVariableObject.h

    r36851 r37427  
    6262        // size of a JSCell).
    6363        struct JSVariableObjectData {
    64             JSVariableObjectData(SymbolTable* symbolTable_, Register* registers_)
    65                 : symbolTable(symbolTable_)
    66                 , registers(registers_)
     64            JSVariableObjectData(SymbolTable* symbolTable, Register* registers)
     65                : symbolTable(symbolTable)
     66                , registers(registers)
    6767            {
    68                 ASSERT(symbolTable_);
     68                ASSERT(symbolTable);
    6969            }
    7070
  • trunk/JavaScriptCore/kjs/Parser.cpp

    r37275 r37427  
    4848    *errMsg = 0;
    4949
    50     Lexer& lexer = *exec->lexer();
     50    Lexer& lexer = *exec->globalData().lexer;
    5151    lexer.setCode(*m_source);
    5252
  • trunk/JavaScriptCore/kjs/RegExpConstructor.cpp

    r37337 r37427  
    332332    UString flags = arg1->isUndefined() ? UString("") : arg1->toString(exec);
    333333
    334     RefPtr<RegExp> regExp = RegExp::create(exec, pattern, flags);
     334    RefPtr<RegExp> regExp = RegExp::create(&exec->globalData(), pattern, flags);
    335335    if (!regExp->isValid())
    336336        return throwError(exec, SyntaxError, UString("Invalid regular expression: ").append(regExp->errorMessage()));
  • trunk/JavaScriptCore/kjs/RegExpPrototype.cpp

    r37337 r37427  
    8686        UString pattern = args.isEmpty() ? UString("") : arg0->toString(exec);
    8787        UString flags = arg1->isUndefined() ? UString("") : arg1->toString(exec);
    88         regExp = RegExp::create(exec, pattern, flags);
     88        regExp = RegExp::create(&exec->globalData(), pattern, flags);
    8989    }
    9090
  • trunk/JavaScriptCore/kjs/Shell.cpp

    r37316 r37427  
    306306    int errLine = 0;
    307307    UString errMsg;
    308     RefPtr<ProgramNode> programNode = exec->parser()->parse<ProgramNode>(exec, makeSource(script.data(), fileName), &errLine, &errMsg);
     308    RefPtr<ProgramNode> programNode = exec->globalData().parser->parse<ProgramNode>(exec, makeSource(script.data(), fileName), &errLine, &errMsg);
    309309    if (!programNode) {
    310310        fprintf(stderr, "%s:%d: %s.\n", fileName.UTF8String().c_str(), errLine, errMsg.UTF8String().c_str());
  • trunk/JavaScriptCore/kjs/StringPrototype.cpp

    r37063 r37427  
    413413         *  replaced with the result of the expression new RegExp(regexp).
    414414         */
    415         reg = RegExp::create(exec, a0->toString(exec));
     415        reg = RegExp::create(&exec->globalData(), a0->toString(exec));
    416416    }
    417417    RegExpConstructor* regExpObj = exec->lexicalGlobalObject()->regExpConstructor();
     
    463463         *  replaced with the result of the expression new RegExp(regexp).
    464464         */
    465         reg = RegExp::create(exec, a0->toString(exec));
     465        reg = RegExp::create(&exec->globalData(), a0->toString(exec));
    466466    }
    467467    RegExpConstructor* regExpObj = exec->lexicalGlobalObject()->regExpConstructor();
  • trunk/JavaScriptCore/kjs/identifier.cpp

    r36291 r37427  
    241241void Identifier::checkSameIdentifierTable(ExecState* exec, UString::Rep* rep)
    242242{
    243     ASSERT(rep->identifierTable() == exec->identifierTable());
     243    ASSERT(rep->identifierTable() == exec->globalData().identifierTable);
    244244}
    245245
  • trunk/JavaScriptCore/kjs/interpreter.cpp

    r37184 r37427  
    4747    UString errMsg;
    4848
    49     RefPtr<ProgramNode> progNode = exec->parser()->parse<ProgramNode>(exec, source, &errLine, &errMsg);
     49    RefPtr<ProgramNode> progNode = exec->globalData().parser->parse<ProgramNode>(exec, source, &errLine, &errMsg);
    5050    if (!progNode)
    5151        return Completion(Throw, Error::create(exec, SyntaxError, errMsg, errLine, source.provider()->asID(), source.provider()->url()));
     
    5959    int errLine;
    6060    UString errMsg;
    61     RefPtr<ProgramNode> programNode = exec->parser()->parse<ProgramNode>(exec, source, &errLine, &errMsg);
     61    RefPtr<ProgramNode> programNode = exec->globalData().parser->parse<ProgramNode>(exec, source, &errLine, &errMsg);
    6262
    6363    if (!programNode)
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r37275 r37427  
    160160{
    161161    generator.emitExpressionInfo(m_divot, m_startOffset, m_endOffset);
    162     RegisterID* exception = generator.emitNewError(generator.newTemporary(), e, jsString(generator.globalExec(), msg));
     162    RegisterID* exception = generator.emitNewError(generator.newTemporary(), e, jsString(generator.globalData(), msg));
    163163    generator.emitThrow(exception);
    164164    return exception;
     
    170170    substitute(message, label.ustring());
    171171    generator.emitExpressionInfo(m_divot, m_startOffset, m_endOffset);
    172     RegisterID* exception = generator.emitNewError(generator.newTemporary(), e, jsString(generator.globalExec(), message));
     172    RegisterID* exception = generator.emitNewError(generator.newTemporary(), e, jsString(generator.globalData(), message));
    173173    generator.emitThrow(exception);
    174174    return exception;
     
    239239RegisterID* RegExpNode::emitCode(CodeGenerator& generator, RegisterID* dst)
    240240{
    241     RefPtr<RegExp> regExp = RegExp::create(generator.globalExec(), m_pattern, m_flags);
     241    RefPtr<RegExp> regExp = RegExp::create(generator.globalData(), m_pattern, m_flags);
    242242    if (!regExp->isValid())
    243243        return emitThrowError(generator, SyntaxError, ("Invalid regular expression: " + UString(regExp->errorMessage())).UTF8String().c_str());
     
    301301
    302302    if (m_elision) {
    303         RegisterID* value = generator.emitLoad(0, jsNumber(generator.globalExec(), m_elision + length));
     303        RegisterID* value = generator.emitLoad(0, jsNumber(generator.globalData(), m_elision + length));
    304304        generator.emitPutById(array.get(), generator.propertyNames().length, value);
    305305    }
     
    776776
    777777    generator.emitExpressionInfo(m_divot, m_startOffset, m_endOffset);
    778     RegisterID* src2Prototype = generator.emitGetById(generator.newTemporary(), src2.get(), generator.globalExec()->propertyNames().prototype);
     778    RegisterID* src2Prototype = generator.emitGetById(generator.newTemporary(), src2.get(), generator.globalData()->propertyNames->prototype);
    779779
    780780    generator.emitExpressionInfo(m_divot, m_startOffset, m_endOffset);
  • trunk/JavaScriptCore/kjs/nodes.h

    r37417 r37427  
    117117    };
    118118
    119     struct DeclarationStacks {
     119    namespace DeclarationStacks {
    120120        typedef Vector<Node*, 16> NodeStack;
    121         enum { IsConstant = 1, HasInitializer = 2 } VarAttrs;
     121        enum VarAttrs { IsConstant = 1, HasInitializer = 2 };
    122122        typedef Vector<std::pair<Identifier, unsigned>, 16> VarStack;
    123123        typedef Vector<RefPtr<FuncDeclNode>, 16> FunctionStack;
    124 
    125         DeclarationStacks(ExecState* e, NodeStack& n, VarStack& v, FunctionStack& f)
    126             : exec(e)
    127             , nodeStack(n)
    128             , varStack(v)
    129             , functionStack(f)
    130         {
    131         }
    132 
    133         ExecState* exec;
    134         NodeStack& nodeStack;
    135         VarStack& varStack;
    136         FunctionStack& functionStack;
    137     };
     124    }
    138125
    139126    struct SwitchInfo {
  • trunk/JavaScriptCore/kjs/regexp.cpp

    r36263 r37427  
    3333namespace JSC {
    3434
    35 
    36 
    37 inline RegExp::RegExp(ExecState* exec, const UString& pattern)
     35inline RegExp::RegExp(JSGlobalData* globalData, const UString& pattern)
    3836    : m_pattern(pattern)
    3937    , m_flagBits(0)
     
    4341{
    4442#if ENABLE(WREC)
    45     if (!(m_wrecFunction = (WRECFunction)CTI::compileRegExp(exec, pattern, &m_numSubpatterns, &m_constructionError)))
     43    m_wrecFunction = reinterpret_cast<WRECFunction>(CTI::compileRegExp(globalData->machine, pattern, &m_numSubpatterns, &m_constructionError));
     44    if (m_wrecFunction)
     45        return;
     46    // Fall through to non-WREC case.
    4647#else
    47     UNUSED_PARAM(exec);
     48    UNUSED_PARAM(globalData);
    4849#endif
    49     {
    50         m_regExp = jsRegExpCompile(reinterpret_cast<const UChar*>(pattern.data()), pattern.size(),
    51             JSRegExpDoNotIgnoreCase, JSRegExpSingleLine, &m_numSubpatterns, &m_constructionError);
    52     }
     50    m_regExp = jsRegExpCompile(reinterpret_cast<const UChar*>(pattern.data()), pattern.size(),
     51        JSRegExpDoNotIgnoreCase, JSRegExpSingleLine, &m_numSubpatterns, &m_constructionError);
    5352}
    5453
    55 PassRefPtr<RegExp> RegExp::create(ExecState* exec, const UString& pattern)
     54PassRefPtr<RegExp> RegExp::create(JSGlobalData* globalData, const UString& pattern)
    5655{
    57     return adoptRef(new RegExp(exec, pattern));
     56    return adoptRef(new RegExp(globalData, pattern));
    5857}
    5958
    60 inline RegExp::RegExp(ExecState* exec, const UString& pattern, const UString& flags)
     59inline RegExp::RegExp(JSGlobalData* globalData, const UString& pattern, const UString& flags)
    6160    : m_pattern(pattern)
    6261    , m_flags(flags)
     
    8584
    8685#if ENABLE(WREC)
    87     if (!(m_wrecFunction = (WRECFunction)CTI::compileRegExp(exec, pattern, &m_numSubpatterns, &m_constructionError, (m_flagBits & IgnoreCase), (m_flagBits & Multiline))))
     86    m_wrecFunction = reinterpret_cast<WRECFunction>(CTI::compileRegExp(globalData->machine, pattern, &m_numSubpatterns, &m_constructionError, (m_flagBits & IgnoreCase), (m_flagBits & Multiline)));
     87    if (m_wrecFunction)
     88        return;
     89    // Fall through to non-WREC case.
    8890#else
    89     UNUSED_PARAM(exec);
     91    UNUSED_PARAM(globalData);
    9092#endif
    91     {
    92         m_regExp = jsRegExpCompile(reinterpret_cast<const UChar*>(pattern.data()), pattern.size(),
    93             ignoreCaseOption, multilineOption, &m_numSubpatterns, &m_constructionError);
    94     }
     93    m_regExp = jsRegExpCompile(reinterpret_cast<const UChar*>(pattern.data()), pattern.size(),
     94        ignoreCaseOption, multilineOption, &m_numSubpatterns, &m_constructionError);
    9595}
    9696
    97 PassRefPtr<RegExp> RegExp::create(ExecState* exec, const UString& pattern, const UString& flags)
     97PassRefPtr<RegExp> RegExp::create(JSGlobalData* globalData, const UString& pattern, const UString& flags)
    9898{
    99     return adoptRef(new RegExp(exec, pattern, flags));
     99    return adoptRef(new RegExp(globalData, pattern, flags));
    100100}
    101101
  • trunk/JavaScriptCore/kjs/regexp.h

    r36263 r37427  
    2323
    2424#include "ustring.h"
    25 #include "ExecState.h"
    2625#include <wtf/Forward.h>
    2726#include <wtf/RefCounted.h>
     
    3231namespace JSC {
    3332
     33    class JSGlobalData;
     34
    3435    class RegExp : public RefCounted<RegExp> {
    3536    public:
    36         static PassRefPtr<RegExp> create(ExecState*, const UString& pattern);
    37         static PassRefPtr<RegExp> create(ExecState*, const UString& pattern, const UString& flags);
     37        static PassRefPtr<RegExp> create(JSGlobalData*, const UString& pattern);
     38        static PassRefPtr<RegExp> create(JSGlobalData*, const UString& pattern, const UString& flags);
    3839        ~RegExp();
    3940
     
    5253
    5354    private:
    54         RegExp(ExecState*, const UString& pattern);
    55         RegExp(ExecState*, const UString& pattern, const UString& flags);
     55        RegExp(JSGlobalData*, const UString& pattern);
     56        RegExp(JSGlobalData*, const UString& pattern, const UString& flags);
    5657
    5758        void compile();
  • trunk/JavaScriptCore/profiler/HeavyProfile.h

    r36263 r37427  
    3333namespace JSC {
    3434
    35     class ExecState;
    3635    class UString;
    3736
  • trunk/JavaScriptCore/profiler/Profile.h

    r36263 r37427  
    3333
    3434namespace JSC {
    35 
    36     class ExecState;
    3735
    3836    class Profile : public RefCounted<Profile> {
  • trunk/JavaScriptCore/wrec/WREC.cpp

    r37383 r37427  
    3030
    3131#include "CharacterClassConstructor.h"
    32 #include "ExecState.h"
    3332#include "Machine.h"
    3433#include "pcre_internal.h"
  • trunk/JavaScriptCore/wrec/WREC.h

    r37383 r37427  
    4444    typedef int (*WRECFunction)(const UChar* input, unsigned start, unsigned length, int* output) WREC_CALL;
    4545
    46     class ExecState;
    4746    class GenerateAtomFunctor;
    4847    struct CharacterClassRange;
  • trunk/WebKit/mac/ChangeLog

    r37387 r37427  
     12008-10-08  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Cameron Zwarich.
     4
     5        - https://bugs.webkit.org/show_bug.cgi?id=21403
     6          Bug 21403: use new CallFrame class rather than Register* for call frame manipulation
     7
     8        * WebView/WebScriptDebugger.mm:
     9        (WebScriptDebugger::WebScriptDebugger): Update since DebuggerCallFrame is simpler now.
     10
    1112008-10-07  David Hyatt  <hyatt@apple.com>
    212
  • trunk/WebKit/mac/WebView/WebScriptDebugger.mm

    r37297 r37427  
    8181{
    8282    attach(globalObject);
    83     DebuggerCallFrame globalCallFrame(globalObject, 0, globalObject->globalScopeChain().node(), 0, 0);
     83    DebuggerCallFrame globalCallFrame(globalObject->globalExec(), 0);
    8484    callEvent(globalCallFrame, 0, -1);
    8585}
Note: See TracChangeset for help on using the changeset viewer.