JavaScriptCore:
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Oct 2008 00:40:43 +0000 (00:40 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Oct 2008 00:40:43 +0000 (00:40 +0000)
2008-10-08  Darin Adler  <darin@apple.com>

        Reviewed by Cameron Zwarich.

        - https://bugs.webkit.org/show_bug.cgi?id=21403
          Bug 21403: use new CallFrame class rather than Register* for call frame manipulation

        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@apple.com>

        Reviewed by Cameron Zwarich.

        - https://bugs.webkit.org/show_bug.cgi?id=21403
          Bug 21403: use new CallFrame class rather than Register* for call frame manipulation

        * WebView/WebScriptDebugger.mm:
        (WebScriptDebugger::WebScriptDebugger): Update since DebuggerCallFrame is simpler now.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@37433 268f45cc-cd09-0410-ab3c-d52691b4dbfc

41 files changed:
JavaScriptCore/API/JSObjectRef.cpp
JavaScriptCore/API/OpaqueJSString.cpp
JavaScriptCore/API/OpaqueJSString.h
JavaScriptCore/ChangeLog
JavaScriptCore/VM/CTI.cpp
JavaScriptCore/VM/CTI.h
JavaScriptCore/VM/CodeBlock.h
JavaScriptCore/VM/CodeGenerator.cpp
JavaScriptCore/VM/CodeGenerator.h
JavaScriptCore/VM/Machine.cpp
JavaScriptCore/VM/Machine.h
JavaScriptCore/VM/Register.h
JavaScriptCore/VM/RegisterFile.h
JavaScriptCore/kjs/Arguments.h
JavaScriptCore/kjs/DebuggerCallFrame.cpp
JavaScriptCore/kjs/DebuggerCallFrame.h
JavaScriptCore/kjs/ExecState.cpp
JavaScriptCore/kjs/ExecState.h
JavaScriptCore/kjs/FunctionConstructor.cpp
JavaScriptCore/kjs/JSActivation.cpp
JavaScriptCore/kjs/JSActivation.h
JavaScriptCore/kjs/JSGlobalObject.cpp
JavaScriptCore/kjs/JSGlobalObjectFunctions.cpp
JavaScriptCore/kjs/JSVariableObject.h
JavaScriptCore/kjs/Parser.cpp
JavaScriptCore/kjs/RegExpConstructor.cpp
JavaScriptCore/kjs/RegExpPrototype.cpp
JavaScriptCore/kjs/Shell.cpp
JavaScriptCore/kjs/StringPrototype.cpp
JavaScriptCore/kjs/identifier.cpp
JavaScriptCore/kjs/interpreter.cpp
JavaScriptCore/kjs/nodes.cpp
JavaScriptCore/kjs/nodes.h
JavaScriptCore/kjs/regexp.cpp
JavaScriptCore/kjs/regexp.h
JavaScriptCore/profiler/HeavyProfile.h
JavaScriptCore/profiler/Profile.h
JavaScriptCore/wrec/WREC.cpp
JavaScriptCore/wrec/WREC.h
WebKit/mac/ChangeLog
WebKit/mac/WebView/WebScriptDebugger.mm

index 569a38c..a4f32ba 100644 (file)
@@ -92,7 +92,7 @@ JSObjectRef JSObjectMakeFunctionWithCallback(JSContextRef ctx, JSStringRef name,
     exec->globalData().heap.registerThread();
     JSLock lock(exec);
 
-    Identifier nameID = name ? name->identifier(exec) : Identifier(exec, "anonymous");
+    Identifier nameID = name ? name->identifier(&exec->globalData()) : Identifier(exec, "anonymous");
     
     return toRef(new (exec) JSCallbackFunction(exec, callAsFunction, nameID));
 }
@@ -118,7 +118,7 @@ JSObjectRef JSObjectMakeFunction(JSContextRef ctx, JSStringRef name, unsigned pa
     exec->globalData().heap.registerThread();
     JSLock lock(exec);
 
-    Identifier nameID = name ? name->identifier(exec) : Identifier(exec, "anonymous");
+    Identifier nameID = name ? name->identifier(&exec->globalData()) : Identifier(exec, "anonymous");
     
     ArgList args;
     for (unsigned i = 0; i < parameterCount; i++)
@@ -246,7 +246,7 @@ bool JSObjectHasProperty(JSContextRef ctx, JSObjectRef object, JSStringRef prope
 
     JSObject* jsObject = toJS(object);
     
-    return jsObject->hasProperty(exec, propertyName->identifier(exec));
+    return jsObject->hasProperty(exec, propertyName->identifier(&exec->globalData()));
 }
 
 JSValueRef JSObjectGetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
@@ -257,7 +257,7 @@ JSValueRef JSObjectGetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef
 
     JSObject* jsObject = toJS(object);
 
-    JSValue* jsValue = jsObject->get(exec, propertyName->identifier(exec));
+    JSValue* jsValue = jsObject->get(exec, propertyName->identifier(&exec->globalData()));
     if (exec->hadException()) {
         if (exception)
             *exception = toRef(exec->exception());
@@ -273,7 +273,7 @@ void JSObjectSetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef prope
     JSLock lock(exec);
 
     JSObject* jsObject = toJS(object);
-    Identifier name(propertyName->identifier(exec));
+    Identifier name(propertyName->identifier(&exec->globalData()));
     JSValue* jsValue = toJS(value);
 
     if (attributes && !jsObject->hasProperty(exec, name))
@@ -333,7 +333,7 @@ bool JSObjectDeleteProperty(JSContextRef ctx, JSObjectRef object, JSStringRef pr
 
     JSObject* jsObject = toJS(object);
 
-    bool result = jsObject->deleteProperty(exec,  propertyName->identifier(exec));
+    bool result = jsObject->deleteProperty(exec, propertyName->identifier(&exec->globalData()));
     if (exec->hadException()) {
         if (exception)
             *exception = toRef(exec->exception());
index 876c9c6..4d14b7b 100644 (file)
@@ -46,11 +46,6 @@ UString OpaqueJSString::ustring() const
     return UString::null();
 }
 
-Identifier OpaqueJSString::identifier(ExecState* exec) const
-{
-    return identifier(&exec->globalData());
-}
-
 Identifier OpaqueJSString::identifier(JSGlobalData* globalData) const
 {
     if (!this || !m_characters)
index 5d63c0f..da05b06 100644 (file)
 #include <kjs/ustring.h>
 
 namespace JSC {
-    class ExecState;
     class Identifier;
     class JSGlobalData;
-};
+}
 
 struct OpaqueJSString : public ThreadSafeShared<OpaqueJSString> {
 
@@ -52,8 +51,6 @@ struct OpaqueJSString : public ThreadSafeShared<OpaqueJSString> {
     unsigned length() { return this ? m_length : 0; }
 
     JSC::UString ustring() const;
-
-    JSC::Identifier identifier(JSC::ExecState*) const;
     JSC::Identifier identifier(JSC::JSGlobalData*) const;
 
 private:
index 3f7cbbf..522dc6a 100644 (file)
@@ -1,3 +1,230 @@
+2008-10-08  Darin Adler  <darin@apple.com>
+
+        Reviewed by Cameron Zwarich.
+
+        - https://bugs.webkit.org/show_bug.cgi?id=21403
+          Bug 21403: use new CallFrame class rather than Register* for call frame manipulation
+
+        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:
+
 2008-10-08  Mark Rowe  <mrowe@apple.com>
 
         Typed by Maciej Stachowiak, reviewed by Mark Rowe.
index 29d6537..5921d1b 100644 (file)
@@ -34,6 +34,7 @@
 #include "Machine.h"
 #include "wrec/WREC.h"
 #include "ResultType.h"
+
 #if PLATFORM(MAC)
 #include <sys/sysctl.h>
 #endif
@@ -43,12 +44,15 @@ using namespace std;
 namespace JSC {
 
 #if PLATFORM(MAC)
-bool isSSE2Present()
+
+static inline bool isSSE2Present()
 {
     return true; // All X86 Macs are guaranteed to support at least SSE2
 }
-#else COMPILER(MSVC)
-bool isSSE2Present()
+
+#else
+
+static bool isSSE2Present()
 {
     static const int SSE2FeatureBit = 1 << 26;
     struct SSE2Check {
@@ -72,8 +76,12 @@ bool isSSE2Present()
     static SSE2Check check;
     return check.present;
 }
+
 #endif
 
+COMPILE_ASSERT(CTI_ARGS_code == 0xC, CTI_ARGS_code_is_C);
+COMPILE_ASSERT(CTI_ARGS_callFrame == 0xE, CTI_ARGS_callFrame_is_E);
+
 #if COMPILER(GCC) && PLATFORM(X86)
 
 asm(
@@ -83,8 +91,8 @@ asm(
     "pushl %edi" "\n"
     "subl $0x24, %esp" "\n"
     "movl $512, %esi" "\n"
-    "movl 0x38(%esp), %edi" "\n" // Ox38 = 0x0E * 4, 0x0E = CTI_ARGS_r
-    "call *0x30(%esp)" "\n" // Ox30 = 0x0C * 4, 0x0C = CTI_ARGS_code
+    "movl 0x38(%esp), %edi" "\n" // Ox38 = 0x0E * 4, 0x0E = CTI_ARGS_callFrame (see assertion above)
+    "call *0x30(%esp)" "\n" // Ox30 = 0x0C * 4, 0x0C = CTI_ARGS_code (see assertion above)
     "addl $0x24, %esp" "\n"
     "popl %edi" "\n"
     "popl %esi" "\n"
@@ -114,7 +122,7 @@ extern "C" {
             mov esi, 512;
             mov ecx, esp;
             mov edi, [esp + 0x38];
-            call [esp + 0x30];
+            call [esp + 0x30]; // Ox30 = 0x0C * 4, 0x0C = CTI_ARGS_code (see assertion above)
             add esp, 0x24;
             pop edi;
             pop esi;
@@ -138,15 +146,14 @@ extern "C" {
 
 #endif
 
-
 ALWAYS_INLINE bool CTI::isConstant(int src)
 {
     return src >= m_codeBlock->numVars && src < m_codeBlock->numVars + m_codeBlock->numConstants;
 }
 
-ALWAYS_INLINE JSValue* CTI::getConstant(ExecState* exec, int src)
+ALWAYS_INLINE JSValue* CTI::getConstant(CallFrame* callFrame, int src)
 {
-    return m_codeBlock->constantRegisters[src - m_codeBlock->numVars].jsValue(exec);
+    return m_codeBlock->constantRegisters[src - m_codeBlock->numVars].jsValue(callFrame);
 }
 
 // get arg puts an arg from the SF register array into a h/w register
@@ -154,7 +161,7 @@ ALWAYS_INLINE void CTI::emitGetArg(int src, X86Assembler::RegisterID dst)
 {
     // TODO: we want to reuse values that are already in registers if we can - add a register allocator!
     if (isConstant(src)) {
-        JSValue* js = getConstant(m_exec, src);
+        JSValue* js = getConstant(m_callFrame, src);
         m_jit.movl_i32r(reinterpret_cast<unsigned>(js), dst);
     } else
         m_jit.movl_mr(src * sizeof(Register), X86::edi, dst);
@@ -164,7 +171,7 @@ ALWAYS_INLINE void CTI::emitGetArg(int src, X86Assembler::RegisterID dst)
 ALWAYS_INLINE void CTI::emitGetPutArg(unsigned src, unsigned offset, X86Assembler::RegisterID scratch)
 {
     if (isConstant(src)) {
-        JSValue* js = getConstant(m_exec, src);
+        JSValue* js = getConstant(m_callFrame, src);
         m_jit.movl_i32m(reinterpret_cast<unsigned>(js), offset + sizeof(void*), X86::esp);
     } else {
         m_jit.movl_mr(src * sizeof(Register), X86::edi, scratch);
@@ -186,7 +193,7 @@ ALWAYS_INLINE void CTI::emitPutArgConstant(unsigned value, unsigned offset)
 ALWAYS_INLINE JSValue* CTI::getConstantImmediateNumericArg(unsigned src)
 {
     if (isConstant(src)) {
-        JSValue* js = getConstant(m_exec, src);
+        JSValue* js = getConstant(m_callFrame, src);
         return JSImmediate::isNumber(js) ? js : 0;
     }
     return 0;
@@ -249,7 +256,7 @@ void CTI::printOpcodeOperandTypes(unsigned src1, unsigned src2)
 {
     char which1 = '*';
     if (isConstant(src1)) {
-        JSValue* js = getConstant(m_exec, src1);
+        JSValue* js = getConstant(m_callFrame, src1);
         which1 = 
             JSImmediate::isImmediate(js) ?
                 (JSImmediate::isNumber(js) ? 'i' :
@@ -263,7 +270,7 @@ void CTI::printOpcodeOperandTypes(unsigned src1, unsigned src2)
     }
     char which2 = '*';
     if (isConstant(src2)) {
-        JSValue* js = getConstant(m_exec, src2);
+        JSValue* js = getConstant(m_callFrame, src2);
         which2 = 
             JSImmediate::isImmediate(js) ?
                 (JSImmediate::isNumber(js) ? 'i' :
@@ -445,10 +452,10 @@ ALWAYS_INLINE void CTI::emitTagAsBoolImmediate(X86Assembler::RegisterID reg)
     m_jit.orl_i32r(JSImmediate::FullTagTypeBool, reg);
 }
 
-CTI::CTI(Machine* machine, ExecState* exec, CodeBlock* codeBlock)
+CTI::CTI(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock)
     : m_jit(machine->jitCodeBuffer())
     , m_machine(machine)
-    , m_exec(exec)
+    , m_callFrame(callFrame)
     , m_codeBlock(codeBlock)
     , m_labels(codeBlock ? codeBlock->instructions.size() : 0)
     , m_structureStubCompilationInfo(codeBlock ? codeBlock->structureIDInstructions.size() : 0)
@@ -487,7 +494,7 @@ void CTI::compileOpCallInitializeCallFrame(unsigned callee, unsigned argCount)
 
     m_jit.movl_mr(OBJECT_OFFSET(JSFunction, m_scopeChain) + OBJECT_OFFSET(ScopeChain, m_node), X86::ecx, X86::ecx); // newScopeChain
     m_jit.movl_i32m(argCount, RegisterFile::ArgumentCount * static_cast<int>(sizeof(Register)), X86::edx);
-    m_jit.movl_rm(X86::edi, RegisterFile::CallerRegisters * static_cast<int>(sizeof(Register)), X86::edx);
+    m_jit.movl_rm(X86::edi, RegisterFile::CallerFrame * static_cast<int>(sizeof(Register)), X86::edx);
     m_jit.movl_rm(X86::ecx, RegisterFile::ScopeChain * static_cast<int>(sizeof(Register)), X86::edx);
 }
 
@@ -515,8 +522,8 @@ void CTI::compileOpCall(Instruction* instruction, unsigned i, CompileOpCallType
 
         int thisVal = instruction[i + 3].u.operand;
         if (thisVal == missingThisObjectMarker()) {
-            // FIXME: should this be loaded dynamically off m_exec?
-            m_jit.movl_i32m(reinterpret_cast<unsigned>(m_exec->globalThisValue()), firstArg * sizeof(Register), X86::edi);
+            // FIXME: should this be loaded dynamically off m_callFrame?
+            m_jit.movl_i32m(reinterpret_cast<unsigned>(m_callFrame->globalThisValue()), firstArg * sizeof(Register), X86::edi);
         } else {
             emitGetArg(thisVal, X86::ecx);
             emitPutResult(firstArg, X86::ecx);
@@ -559,8 +566,8 @@ void CTI::compileOpCall(Instruction* instruction, unsigned i, CompileOpCallType
     // load ctiCode from the new codeBlock.
     m_jit.movl_mr(OBJECT_OFFSET(CodeBlock, ctiCode), X86::eax, X86::eax);
 
-    // Setup the new value of 'r' in edi, and on the stack, too.
-    emitPutCTIParam(X86::edx, CTI_ARGS_r);
+    // Put the new value of 'callFrame' into edi and onto the stack, too.
+    emitPutCTIParam(X86::edx, CTI_ARGS_callFrame);
     m_jit.movl_rr(X86::edx, X86::edi);
 
     // Check the ctiCode has been generated - if not, this is handled in a slow case.
@@ -685,7 +692,7 @@ void CTI::putDoubleResultToJSNumberCellOrJSImmediate(X86::XMMRegisterID xmmSourc
 
 void CTI::compileBinaryArithOp(OpcodeID opcodeID, unsigned dst, unsigned src1, unsigned src2, OperandTypes types, unsigned i)
 {
-    StructureID* numberStructureID = m_exec->globalData().numberStructureID.get();
+    StructureID* numberStructureID = m_callFrame->globalData().numberStructureID.get();
     X86Assembler::JmpSrc wasJSNumberCell1, wasJSNumberCell1b, wasJSNumberCell2, wasJSNumberCell2b;
 
     emitGetArg(src1, X86::eax);
@@ -878,7 +885,7 @@ void CTI::privateCompileMainPass()
         case op_mov: {
             unsigned src = instruction[i + 2].u.operand;
             if (isConstant(src))
-                m_jit.movl_i32r(reinterpret_cast<unsigned>(getConstant(m_exec, src)), X86::edx);
+                m_jit.movl_i32r(reinterpret_cast<unsigned>(getConstant(m_callFrame, src)), X86::edx);
             else
                 emitGetArg(src, X86::edx);
             emitPutResult(instruction[i + 1].u.operand, X86::edx);
@@ -1238,8 +1245,8 @@ void CTI::privateCompileMainPass()
             emitGetArg(RegisterFile::ReturnPC, X86::edx);
 
             // Restore our caller's "r".
-            emitGetArg(RegisterFile::CallerRegisters, X86::edi);
-            emitPutCTIParam(X86::edi, CTI_ARGS_r);
+            emitGetArg(RegisterFile::CallerFrame, X86::edi);
+            emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
 
             // Return.
             m_jit.pushl_r(X86::edx);
@@ -1803,7 +1810,7 @@ void CTI::privateCompileMainPass()
             break;
         }
         case op_catch: {
-            emitGetCTIParam(CTI_ARGS_r, X86::edi); // edi := r
+            emitGetCTIParam(CTI_ARGS_callFrame, X86::edi); // edi := r
             emitPutResult(instruction[i + 1].u.operand);
             i += 2;
             break;
@@ -2652,7 +2659,7 @@ void CTI::privateCompileGetByIdProto(StructureID* structureID, StructureID* prot
 
     // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a StructureID that is
     // referencing the prototype object - let's speculatively load it's table nice and early!)
-    JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(m_exec));
+    JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(m_callFrame));
     PropertyStorage* protoPropertyStorage = &protoObject->m_propertyStorage;
     m_jit.movl_mr(static_cast<void*>(protoPropertyStorage), X86::edx);
 
@@ -2695,7 +2702,7 @@ void CTI::privateCompileGetByIdProto(StructureID* structureID, StructureID* prot
 #else
     // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a StructureID that is
     // referencing the prototype object - let's speculatively load it's table nice and early!)
-    JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(m_exec));
+    JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(m_callFrame));
     PropertyStorage* protoPropertyStorage = &protoObject->m_propertyStorage;
     m_jit.movl_mr(static_cast<void*>(protoPropertyStorage), X86::edx);
 
@@ -2744,7 +2751,7 @@ void CTI::privateCompileGetByIdChain(StructureID* structureID, StructureIDChain*
     RefPtr<StructureID>* chainEntries = chain->head();
     JSObject* protoObject = 0;
     for (unsigned i = 0; i<count; ++i) {
-        protoObject = static_cast<JSObject*>(currStructureID->prototypeForLookup(m_exec));
+        protoObject = static_cast<JSObject*>(currStructureID->prototypeForLookup(m_callFrame));
         currStructureID = chainEntries[i].get();
 
         // Check the prototype object's StructureID had not changed.
@@ -3044,7 +3051,7 @@ void CTI::emitPutVariableObjectRegister(X86Assembler::RegisterID src, X86Assembl
 
 #if ENABLE(WREC)
 
-void* CTI::compileRegExp(ExecState* exec, const UString& pattern, unsigned* numSubpatterns_ptr, const char** error_ptr, bool ignoreCase, bool multiline)
+void* CTI::compileRegExp(Machine* machine, const UString& pattern, unsigned* numSubpatterns_ptr, const char** error_ptr, bool ignoreCase, bool multiline)
 {
     // TODO: better error messages
     if (pattern.size() > MaxPatternSize) {
@@ -3052,7 +3059,7 @@ void* CTI::compileRegExp(ExecState* exec, const UString& pattern, unsigned* numS
         return 0;
     }
 
-    X86Assembler jit(exec->machine()->jitCodeBuffer());
+    X86Assembler jit(machine->jitCodeBuffer());
     WRECParser parser(pattern, ignoreCase, multiline, jit);
     
     jit.emitConvertToFastCall();
index d27a88e..165b468 100644 (file)
 
 #define CTI_ARGS_code 0x0C
 #define CTI_ARGS_registerFile 0x0D
-#define CTI_ARGS_r 0x0E
+#define CTI_ARGS_callFrame 0x0E
 #define CTI_ARGS_exception 0x0F
 #define CTI_ARGS_profilerReference 0x10
 #define CTI_ARGS_globalData 0x11
 #define ARG_registerFile ((RegisterFile*)(ARGS)[CTI_ARGS_registerFile])
-#define ARG_r ((Register*)(ARGS)[CTI_ARGS_r])
+#define ARG_callFrame ((CallFrame*)(ARGS)[CTI_ARGS_callFrame])
 #define ARG_exception ((JSValue**)(ARGS)[CTI_ARGS_exception])
 #define ARG_profilerReference ((Profiler**)(ARGS)[CTI_ARGS_profilerReference])
 #define ARG_globalData ((JSGlobalData*)(ARGS)[CTI_ARGS_globalData])
 
-#define ARG_exec CallFrame::create(ARG_r)
-
-#define ARG_setR(newR) (*(Register**)&(ARGS)[CTI_ARGS_r] = newR)
+#define ARG_setCallFrame(newCallFrame) (*(CallFrame**)&(ARGS)[CTI_ARGS_callFrame] = (newCallFrame))
 
 #define ARG_src1 ((JSValue*)((ARGS)[1]))
 #define ARG_src2 ((JSValue*)((ARGS)[2]))
@@ -92,7 +90,6 @@
 namespace JSC {
 
     class CodeBlock;
-    class ExecState;
     class JSPropertyNameIterator;
     class JSValue;
     class Machine;
@@ -249,7 +246,7 @@ namespace JSC {
     };
 
     extern "C" {
-        JSValue* ctiTrampoline(void* code, RegisterFile*, Register* callFrame, JSValue** exception, Profiler**, JSGlobalData*);
+        JSValue* ctiTrampoline(void* code, RegisterFile*, CallFrame*, JSValue** exception, Profiler**, JSGlobalData*);
         void ctiVMThrowTrampoline();
     };
 
@@ -283,77 +280,77 @@ namespace JSC {
 #endif
 
     public:
-        static void compile(Machine* machine, ExecState* exec, CodeBlock* codeBlock)
+        static void compile(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock)
         {
-            CTI cti(machine, exec, codeBlock);
+            CTI cti(machine, callFrame, codeBlock);
             cti.privateCompile();
         }
 
 #if ENABLE(WREC)
-        static void* compileRegExp(ExecState* exec, const UString& pattern, unsigned* numSubpatterns_ptr, const char** error_ptr, bool ignoreCase = false, bool multiline = false);
+        static void* compileRegExp(Machine*, const UString& pattern, unsigned* numSubpatterns_ptr, const char** error_ptr, bool ignoreCase = false, bool multiline = false);
 #endif
 
-        static void compileGetByIdSelf(Machine* machine, ExecState* exec, CodeBlock* codeBlock, StructureID* structureID, size_t cachedOffset, void* returnAddress)
+        static void compileGetByIdSelf(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock, StructureID* structureID, size_t cachedOffset, void* returnAddress)
         {
-            CTI cti(machine, exec, codeBlock);
+            CTI cti(machine, callFrame, codeBlock);
             cti.privateCompileGetByIdSelf(structureID, cachedOffset, returnAddress);
         }
 
-        static void compileGetByIdProto(Machine* machine, ExecState* exec, CodeBlock* codeBlock, StructureID* structureID, StructureID* prototypeStructureID, size_t cachedOffset, void* returnAddress)
+        static void compileGetByIdProto(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock, StructureID* structureID, StructureID* prototypeStructureID, size_t cachedOffset, void* returnAddress)
         {
-            CTI cti(machine, exec, codeBlock);
+            CTI cti(machine, callFrame, codeBlock);
             cti.privateCompileGetByIdProto(structureID, prototypeStructureID, cachedOffset, returnAddress);
         }
 
-        static void compileGetByIdChain(Machine* machine, ExecState* exec, CodeBlock* codeBlock, StructureID* structureID, StructureIDChain* chain, size_t count, size_t cachedOffset, void* returnAddress)
+        static void compileGetByIdChain(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock, StructureID* structureID, StructureIDChain* chain, size_t count, size_t cachedOffset, void* returnAddress)
         {
-            CTI cti(machine, exec, codeBlock);
+            CTI cti(machine, callFrame, codeBlock);
             cti.privateCompileGetByIdChain(structureID, chain, count, cachedOffset, returnAddress);
         }
 
-        static void compilePutByIdReplace(Machine* machine, ExecState* exec, CodeBlock* codeBlock, StructureID* structureID, size_t cachedOffset, void* returnAddress)
+        static void compilePutByIdReplace(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock, StructureID* structureID, size_t cachedOffset, void* returnAddress)
         {
-            CTI cti(machine, exec, codeBlock);
+            CTI cti(machine, callFrame, codeBlock);
             cti.privateCompilePutByIdReplace(structureID, cachedOffset, returnAddress);
         }
         
-        static void compilePutByIdTransition(Machine* machine, ExecState* exec, CodeBlock* codeBlock, StructureID* oldStructureID, StructureID* newStructureID, size_t cachedOffset, StructureIDChain* sIDC, void* returnAddress)
+        static void compilePutByIdTransition(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock, StructureID* oldStructureID, StructureID* newStructureID, size_t cachedOffset, StructureIDChain* sIDC, void* returnAddress)
         {
-            CTI cti(machine, exec, codeBlock);
+            CTI cti(machine, callFrame, codeBlock);
             cti.privateCompilePutByIdTransition(oldStructureID, newStructureID, cachedOffset, sIDC, returnAddress);
         }
 
-        static void* compileArrayLengthTrampoline(Machine* machine, ExecState* exec, CodeBlock* codeBlock)
+        static void* compileArrayLengthTrampoline(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock)
         {
-            CTI cti(machine, exec, codeBlock);
+            CTI cti(machine, callFrame, codeBlock);
             return cti.privateCompileArrayLengthTrampoline();
         }
 
-        static void* compileStringLengthTrampoline(Machine* machine, ExecState* exec, CodeBlock* codeBlock)
+        static void* compileStringLengthTrampoline(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock)
         {
-            CTI cti(machine, exec, codeBlock);
+            CTI cti(machine, callFrame, codeBlock);
             return cti.privateCompileStringLengthTrampoline();
         }
 
         static void patchGetByIdSelf(CodeBlock* codeBlock, StructureID* structureID, size_t cachedOffset, void* returnAddress);
         static void patchPutByIdReplace(CodeBlock* codeBlock, StructureID* structureID, size_t cachedOffset, void* returnAddress);
 
-        static void compilePatchGetArrayLength(Machine* machine, ExecState* exec, CodeBlock* codeBlock, void* returnAddress)
+        static void compilePatchGetArrayLength(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress)
         {
-            CTI cti(machine, exec, codeBlock);
+            CTI cti(machine, callFrame, codeBlock);
             return cti.privateCompilePatchGetArrayLength(returnAddress);
         }
 
-        inline static JSValue* execute(void* code, RegisterFile* registerFile, Register* r, JSGlobalData* globalData, JSValue** exception)
+        inline static JSValue* execute(void* code, RegisterFile* registerFile, CallFrame* callFrame, JSGlobalData* globalData, JSValue** exception)
         {
-            return ctiTrampoline(code, registerFile, r, exception, Profiler::enabledProfilerReference(), globalData);
+            return ctiTrampoline(code, registerFile, callFrame, exception, Profiler::enabledProfilerReference(), globalData);
         }
 
     private:
-        CTI(Machine*, ExecState*, CodeBlock*);
+        CTI(Machine*, CallFrame*, CodeBlock*);
         
         bool isConstant(int src);
-        JSValue* getConstant(ExecState*, int src);
+        JSValue* getConstant(CallFrame*, int src);
 
         void privateCompileMainPass();
         void privateCompileLinkPass();
@@ -429,7 +426,7 @@ namespace JSC {
 
         X86Assembler m_jit;
         Machine* m_machine;
-        ExecState* m_exec;
+        CallFrame* m_callFrame;
         CodeBlock* m_codeBlock;
 
         Vector<CallRecord> m_calls;
index 30a5275..3313cf9 100644 (file)
@@ -161,7 +161,7 @@ namespace JSC {
                 UString errMsg;
                 
                 SourceCode source = makeSource(evalSource);
-                evalNode = exec->parser()->parse<EvalNode>(exec, source, &errLine, &errMsg);
+                evalNode = exec->globalData().parser->parse<EvalNode>(exec, source, &errLine, &errMsg);
                 if (evalNode) {
                     if (evalSource.size() < maxCacheableSourceLength && (*scopeChain->begin())->isVariableObject() && cacheMap.size() < maxCacheEntries)
                         cacheMap.set(evalSource.rep(), evalNode);
index e2b825d..0f7b537 100644 (file)
@@ -718,8 +718,8 @@ RegisterID* CodeGenerator::emitEqualityOp(OpcodeID opcode, RegisterID* dst, Regi
         if (src1->index() == dstIndex
             && src1->isTemporary()
             && static_cast<unsigned>(src2->index()) < m_codeBlock->constantRegisters.size()
-            && m_codeBlock->constantRegisters[src2->index()].jsValue(globalExec())->isString()) {
-            const UString& value = static_cast<JSString*>(m_codeBlock->constantRegisters[src2->index()].jsValue(globalExec()))->value();
+            && m_codeBlock->constantRegisters[src2->index()].jsValue(m_scopeChain->globalObject()->globalExec())->isString()) {
+            const UString& value = static_cast<JSString*>(m_codeBlock->constantRegisters[src2->index()].jsValue(m_scopeChain->globalObject()->globalExec()))->value();
             if (value == "undefined") {
                 rewindUnaryOp();
                 emitOpcode(op_is_undefined);
@@ -782,10 +782,10 @@ RegisterID* CodeGenerator::emitLoad(RegisterID* dst, double number)
     // FIXME: Our hash tables won't hold infinity, so we make a new JSNumberCell each time.
     // Later we can do the extra work to handle that like the other cases.
     if (number == HashTraits<double>::emptyValue() || HashTraits<double>::isDeletedValue(number))
-        return emitLoad(dst, jsNumber(globalExec(), number));
+        return emitLoad(dst, jsNumber(globalData(), number));
     JSValue*& valueInMap = m_numberMap.add(number, 0).first->second;
     if (!valueInMap)
-        valueInMap = jsNumber(globalExec(), number);
+        valueInMap = jsNumber(globalData(), number);
     return emitLoad(dst, valueInMap);
 }
 
@@ -793,7 +793,7 @@ RegisterID* CodeGenerator::emitLoad(RegisterID* dst, const Identifier& identifie
 {
     JSString*& valueInMap = m_stringMap.add(identifier.ustring().rep(), 0).first->second;
     if (!valueInMap)
-        valueInMap = jsOwnedString(globalExec(), identifier.ustring());
+        valueInMap = jsOwnedString(globalData(), identifier.ustring());
     return emitLoad(dst, valueInMap);
 }
 
@@ -817,7 +817,7 @@ RegisterID* CodeGenerator::emitUnexpectedLoad(RegisterID* dst, double d)
 {
     emitOpcode(op_unexpected_load);
     instructions().append(dst->index());
-    instructions().append(addUnexpectedConstant(jsNumber(globalExec(), d)));
+    instructions().append(addUnexpectedConstant(jsNumber(globalData(), d)));
     return dst;
 }
 
@@ -1188,7 +1188,7 @@ RegisterID* CodeGenerator::emitConstruct(RegisterID* dst, RegisterID* func, Argu
     // Load prototype.
     emitExpressionInfo(divot, startOffset, endOffset);
     RefPtr<RegisterID> funcProto = newTemporary();
-    emitGetById(funcProto.get(), func, globalExec()->propertyNames().prototype);
+    emitGetById(funcProto.get(), func, globalData()->propertyNames->prototype);
 
     // Generate code for arguments.
     Vector<RefPtr<RegisterID>, 16> argv;
index b434c4c..6aea7f0 100644 (file)
@@ -320,8 +320,6 @@ namespace JSC {
 
         CodeType codeType() const { return m_codeType; }
 
-        ExecState* globalExec() { return m_scopeChain->globalObject()->globalExec(); }
-
     private:
         void emitOpcode(OpcodeID);
         void retrieveLastBinaryOp(int& dstIndex, int& src1Index, int& src2Index);
index af662ed..97544f1 100644 (file)
@@ -162,7 +162,7 @@ static ALWAYS_INLINE bool fastToUInt32(JSValue* value, uint32_t& arg)
     return true;
 }
 
-static inline bool jsLess(ExecState* exec, JSValue* v1, JSValue* v2)
+static inline bool jsLess(CallFrame* callFrame, JSValue* v1, JSValue* v2)
 {
     if (JSImmediate::areBothImmediateNumbers(v1, v2))
         return JSImmediate::getTruncatedInt32(v1) < JSImmediate::getTruncatedInt32(v2);
@@ -172,14 +172,14 @@ static inline bool jsLess(ExecState* exec, JSValue* v1, JSValue* v2)
     if (fastIsNumber(v1, n1) && fastIsNumber(v2, n2))
         return n1 < n2;
 
-    Machine* machine = exec->machine();
+    Machine* machine = callFrame->machine();
     if (machine->isJSString(v1) && machine->isJSString(v2))
         return static_cast<const JSString*>(v1)->value() < static_cast<const JSString*>(v2)->value();
 
     JSValue* p1;
     JSValue* p2;
-    bool wasNotString1 = v1->getPrimitiveNumber(exec, n1, p1);
-    bool wasNotString2 = v2->getPrimitiveNumber(exec, n2, p2);
+    bool wasNotString1 = v1->getPrimitiveNumber(callFrame, n1, p1);
+    bool wasNotString2 = v2->getPrimitiveNumber(callFrame, n2, p2);
 
     if (wasNotString1 | wasNotString2)
         return n1 < n2;
@@ -187,7 +187,7 @@ static inline bool jsLess(ExecState* exec, JSValue* v1, JSValue* v2)
     return static_cast<const JSString*>(p1)->value() < static_cast<const JSString*>(p2)->value();
 }
 
-static inline bool jsLessEq(ExecState* exec, JSValue* v1, JSValue* v2)
+static inline bool jsLessEq(CallFrame* callFrame, JSValue* v1, JSValue* v2)
 {
     if (JSImmediate::areBothImmediateNumbers(v1, v2))
         return JSImmediate::getTruncatedInt32(v1) <= JSImmediate::getTruncatedInt32(v2);
@@ -197,14 +197,14 @@ static inline bool jsLessEq(ExecState* exec, JSValue* v1, JSValue* v2)
     if (fastIsNumber(v1, n1) && fastIsNumber(v2, n2))
         return n1 <= n2;
 
-    Machine* machine = exec->machine();
+    Machine* machine = callFrame->machine();
     if (machine->isJSString(v1) && machine->isJSString(v2))
         return !(static_cast<const JSString*>(v2)->value() < static_cast<const JSString*>(v1)->value());
 
     JSValue* p1;
     JSValue* p2;
-    bool wasNotString1 = v1->getPrimitiveNumber(exec, n1, p1);
-    bool wasNotString2 = v2->getPrimitiveNumber(exec, n2, p2);
+    bool wasNotString1 = v1->getPrimitiveNumber(callFrame, n1, p1);
+    bool wasNotString2 = v2->getPrimitiveNumber(callFrame, n2, p2);
 
     if (wasNotString1 | wasNotString2)
         return n1 <= n2;
@@ -212,20 +212,20 @@ static inline bool jsLessEq(ExecState* exec, JSValue* v1, JSValue* v2)
     return !(static_cast<const JSString*>(p2)->value() < static_cast<const JSString*>(p1)->value());
 }
 
-static NEVER_INLINE JSValue* jsAddSlowCase(ExecState* exec, JSValue* v1, JSValue* v2)
+static NEVER_INLINE JSValue* jsAddSlowCase(CallFrame* callFrame, JSValue* v1, JSValue* v2)
 {
     // exception for the Date exception in defaultValue()
-    JSValue* p1 = v1->toPrimitive(exec);
-    JSValue* p2 = v2->toPrimitive(exec);
+    JSValue* p1 = v1->toPrimitive(callFrame);
+    JSValue* p2 = v2->toPrimitive(callFrame);
 
     if (p1->isString() || p2->isString()) {
-        RefPtr<UString::Rep> value = concatenate(p1->toString(exec).rep(), p2->toString(exec).rep());
+        RefPtr<UString::Rep> value = concatenate(p1->toString(callFrame).rep(), p2->toString(callFrame).rep());
         if (!value)
-            return throwOutOfMemoryError(exec);
-        return jsString(exec, value.release());
+            return throwOutOfMemoryError(callFrame);
+        return jsString(callFrame, value.release());
     }
 
-    return jsNumber(exec, p1->toNumber(exec) + p2->toNumber(exec));
+    return jsNumber(callFrame, p1->toNumber(callFrame) + p2->toNumber(callFrame));
 }
 
 // Fast-path choices here are based on frequency data from SunSpider:
@@ -237,21 +237,21 @@ static NEVER_INLINE JSValue* jsAddSlowCase(ExecState* exec, JSValue* v1, JSValue
 //    13962   Add case: 5 3
 //    4000    Add case: 3 5
 
-static ALWAYS_INLINE JSValue* jsAdd(ExecState* exec, JSValue* v1, JSValue* v2)
+static ALWAYS_INLINE JSValue* jsAdd(CallFrame* callFrame, JSValue* v1, JSValue* v2)
 {
     double left;
     double right = 0.0;
 
     bool rightIsNumber = fastIsNumber(v2, right);
     if (rightIsNumber && fastIsNumber(v1, left))
-        return jsNumber(exec, left + right);
+        return jsNumber(callFrame, left + right);
     
     bool leftIsString = v1->isString();
     if (leftIsString && v2->isString()) {
         RefPtr<UString::Rep> value = concatenate(static_cast<JSString*>(v1)->value().rep(), static_cast<JSString*>(v2)->value().rep());
         if (!value)
-            return throwOutOfMemoryError(exec);
-        return jsString(exec, value.release());
+            return throwOutOfMemoryError(callFrame);
+        return jsString(callFrame, value.release());
     }
 
     if (rightIsNumber & leftIsString) {
@@ -260,34 +260,34 @@ static ALWAYS_INLINE JSValue* jsAdd(ExecState* exec, JSValue* v1, JSValue* v2)
             concatenate(static_cast<JSString*>(v1)->value().rep(), right);
 
         if (!value)
-            return throwOutOfMemoryError(exec);
-        return jsString(exec, value.release());
+            return throwOutOfMemoryError(callFrame);
+        return jsString(callFrame, value.release());
     }
 
     // All other cases are pretty uncommon
-    return jsAddSlowCase(exec, v1, v2);
+    return jsAddSlowCase(callFrame, v1, v2);
 }
 
-static JSValue* jsTypeStringForValue(ExecState* exec, JSValue* v)
+static JSValue* jsTypeStringForValue(CallFrame* callFrame, JSValue* v)
 {
     if (v->isUndefined())
-        return jsNontrivialString(exec, "undefined");
+        return jsNontrivialString(callFrame, "undefined");
     if (v->isBoolean())
-        return jsNontrivialString(exec, "boolean");
+        return jsNontrivialString(callFrame, "boolean");
     if (v->isNumber())
-        return jsNontrivialString(exec, "number");
+        return jsNontrivialString(callFrame, "number");
     if (v->isString())
-        return jsNontrivialString(exec, "string");
+        return jsNontrivialString(callFrame, "string");
     if (v->isObject()) {
         // Return "undefined" for objects that should be treated
         // as null when doing comparisons.
         if (static_cast<JSObject*>(v)->structureID()->typeInfo().masqueradesAsUndefined())
-            return jsNontrivialString(exec, "undefined");
+            return jsNontrivialString(callFrame, "undefined");
         CallData callData;
         if (static_cast<JSObject*>(v)->getCallData(callData) != CallTypeNone)
-            return jsNontrivialString(exec, "function");
+            return jsNontrivialString(callFrame, "function");
     }
-    return jsNontrivialString(exec, "object");
+    return jsNontrivialString(callFrame, "object");
 }
 
 static bool jsIsObjectType(JSValue* v)
@@ -318,43 +318,43 @@ static bool jsIsFunctionType(JSValue* v)
     return false;
 }
 
-NEVER_INLINE bool Machine::resolve(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)
+NEVER_INLINE bool Machine::resolve(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)
 {
     int dst = (vPC + 1)->u.operand;
     int property = (vPC + 2)->u.operand;
 
-    ScopeChainNode* scopeChain = this->scopeChain(r);
+    ScopeChainNode* scopeChain = callFrame->scopeChain();
     ScopeChainIterator iter = scopeChain->begin();
     ScopeChainIterator end = scopeChain->end();
     ASSERT(iter != end);
 
-    CodeBlock* codeBlock = this->codeBlock(r);
+    CodeBlock* codeBlock = callFrame->codeBlock();
     Identifier& ident = codeBlock->identifiers[property];
     do {
         JSObject* o = *iter;
         PropertySlot slot(o);
-        if (o->getPropertySlot(exec, ident, slot)) {
-            JSValue* result = slot.getValue(exec, ident);
-            exceptionValue = exec->exception();
+        if (o->getPropertySlot(callFrame, ident, slot)) {
+            JSValue* result = slot.getValue(callFrame, ident);
+            exceptionValue = callFrame->globalData().exception;
             if (exceptionValue)
                 return false;
-            r[dst] = result;
+            callFrame[dst] = result;
             return true;
         }
     } while (++iter != end);
-    exceptionValue = createUndefinedVariableError(exec, ident, vPC, codeBlock);
+    exceptionValue = createUndefinedVariableError(callFrame, ident, vPC, codeBlock);
     return false;
 }
 
-NEVER_INLINE bool Machine::resolveSkip(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)
+NEVER_INLINE bool Machine::resolveSkip(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)
 {
-    CodeBlock* codeBlock = this->codeBlock(r);
+    CodeBlock* codeBlock = callFrame->codeBlock();
 
     int dst = (vPC + 1)->u.operand;
     int property = (vPC + 2)->u.operand;
     int skip = (vPC + 3)->u.operand + codeBlock->needsFullScopeChain;
 
-    ScopeChainNode* scopeChain = this->scopeChain(r);
+    ScopeChainNode* scopeChain = callFrame->scopeChain();
     ScopeChainIterator iter = scopeChain->begin();
     ScopeChainIterator end = scopeChain->end();
     ASSERT(iter != end);
@@ -366,20 +366,20 @@ NEVER_INLINE bool Machine::resolveSkip(ExecState* exec, Instruction* vPC, Regist
     do {
         JSObject* o = *iter;
         PropertySlot slot(o);
-        if (o->getPropertySlot(exec, ident, slot)) {
-            JSValue* result = slot.getValue(exec, ident);
-            exceptionValue = exec->exception();
+        if (o->getPropertySlot(callFrame, ident, slot)) {
+            JSValue* result = slot.getValue(callFrame, ident);
+            exceptionValue = callFrame->globalData().exception;
             if (exceptionValue)
                 return false;
-            r[dst] = result;
+            callFrame[dst] = result;
             return true;
         }
     } while (++iter != end);
-    exceptionValue = createUndefinedVariableError(exec, ident, vPC, codeBlock);
+    exceptionValue = createUndefinedVariableError(callFrame, ident, vPC, codeBlock);
     return false;
 }
 
-NEVER_INLINE bool Machine::resolveGlobal(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)
+NEVER_INLINE bool Machine::resolveGlobal(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)
 {
     int dst = (vPC + 1)->u.operand;
     JSGlobalObject* globalObject = static_cast<JSGlobalObject*>((vPC + 2)->u.jsCell);
@@ -389,37 +389,37 @@ NEVER_INLINE bool Machine::resolveGlobal(ExecState* exec, Instruction* vPC, Regi
     int offset = (vPC + 5)->u.operand;
 
     if (structureID == globalObject->structureID()) {
-        r[dst] = globalObject->getDirectOffset(offset);
+        callFrame[dst] = globalObject->getDirectOffset(offset);
         return true;
     }
 
-    CodeBlock* codeBlock = this->codeBlock(r);
+    CodeBlock* codeBlock = callFrame->codeBlock();
     Identifier& ident = codeBlock->identifiers[property];
     PropertySlot slot(globalObject);
-    if (globalObject->getPropertySlot(exec, ident, slot)) {
-        JSValue* result = slot.getValue(exec, ident);
+    if (globalObject->getPropertySlot(callFrame, ident, slot)) {
+        JSValue* result = slot.getValue(callFrame, ident);
         if (slot.isCacheable()) {
             if (vPC[4].u.structureID)
                 vPC[4].u.structureID->deref();
             globalObject->structureID()->ref();
             vPC[4] = globalObject->structureID();
             vPC[5] = slot.cachedOffset();
-            r[dst] = result;
+            callFrame[dst] = result;
             return true;
         }
 
-        exceptionValue = exec->exception();
+        exceptionValue = callFrame->globalData().exception;
         if (exceptionValue)
             return false;
-        r[dst] = result;
+        callFrame[dst] = result;
         return true;
     }
 
-    exceptionValue = createUndefinedVariableError(exec, ident, vPC, codeBlock);
+    exceptionValue = createUndefinedVariableError(callFrame, ident, vPC, codeBlock);
     return false;
 }
 
-ALWAYS_INLINE static JSValue* inlineResolveBase(ExecState* exec, Identifier& property, ScopeChainNode* scopeChain)
+ALWAYS_INLINE static JSValue* inlineResolveBase(CallFrame* callFrame, Identifier& property, ScopeChainNode* scopeChain)
 {
     ScopeChainIterator iter = scopeChain->begin();
     ScopeChainIterator next = iter;
@@ -431,7 +431,7 @@ ALWAYS_INLINE static JSValue* inlineResolveBase(ExecState* exec, Identifier& pro
     JSObject* base;
     while (true) {
         base = *iter;
-        if (next == end || base->getPropertySlot(exec, property, slot))
+        if (next == end || base->getPropertySlot(callFrame, property, slot))
             return base;
 
         iter = next;
@@ -442,22 +442,20 @@ ALWAYS_INLINE static JSValue* inlineResolveBase(ExecState* exec, Identifier& pro
     return 0;
 }
 
-NEVER_INLINE void Machine::resolveBase(ExecState* exec, Instruction* vPC, Register* r)
+NEVER_INLINE void Machine::resolveBase(CallFrame* callFrame, Instruction* vPC)
 {
     int dst = (vPC + 1)->u.operand;
     int property = (vPC + 2)->u.operand;
-    CodeBlock* codeBlock = this->codeBlock(r);
-    ScopeChainNode* scopeChain = this->scopeChain(r);
-    r[dst] = inlineResolveBase(exec, codeBlock->identifiers[property], scopeChain);
+    callFrame[dst] = inlineResolveBase(callFrame, callFrame->codeBlock()->identifiers[property], callFrame->scopeChain());
 }
 
-NEVER_INLINE bool Machine::resolveBaseAndProperty(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)
+NEVER_INLINE bool Machine::resolveBaseAndProperty(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)
 {
     int baseDst = (vPC + 1)->u.operand;
     int propDst = (vPC + 2)->u.operand;
     int property = (vPC + 3)->u.operand;
 
-    ScopeChainNode* scopeChain = this->scopeChain(r);
+    ScopeChainNode* scopeChain = callFrame->scopeChain();
     ScopeChainIterator iter = scopeChain->begin();
     ScopeChainIterator end = scopeChain->end();
 
@@ -465,35 +463,35 @@ NEVER_INLINE bool Machine::resolveBaseAndProperty(ExecState* exec, Instruction*
 
     ASSERT(iter != end);
 
-    CodeBlock* codeBlock = this->codeBlock(r);
+    CodeBlock* codeBlock = callFrame->codeBlock();
     Identifier& ident = codeBlock->identifiers[property];
     JSObject* base;
     do {
         base = *iter;
         PropertySlot slot(base);
-        if (base->getPropertySlot(exec, ident, slot)) {
-            JSValue* result = slot.getValue(exec, ident);
-            exceptionValue = exec->exception();
+        if (base->getPropertySlot(callFrame, ident, slot)) {
+            JSValue* result = slot.getValue(callFrame, ident);
+            exceptionValue = callFrame->globalData().exception;
             if (exceptionValue)
                 return false;
-            r[propDst] = result;
-            r[baseDst] = base;
+            callFrame[propDst] = result;
+            callFrame[baseDst] = base;
             return true;
         }
         ++iter;
     } while (iter != end);
 
-    exceptionValue = createUndefinedVariableError(exec, ident, vPC, codeBlock);
+    exceptionValue = createUndefinedVariableError(callFrame, ident, vPC, codeBlock);
     return false;
 }
 
-NEVER_INLINE bool Machine::resolveBaseAndFunc(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)
+NEVER_INLINE bool Machine::resolveBaseAndFunc(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)
 {
     int baseDst = (vPC + 1)->u.operand;
     int funcDst = (vPC + 2)->u.operand;
     int property = (vPC + 3)->u.operand;
 
-    ScopeChainNode* scopeChain = this->scopeChain(r);
+    ScopeChainNode* scopeChain = callFrame->scopeChain();
     ScopeChainIterator iter = scopeChain->begin();
     ScopeChainIterator end = scopeChain->end();
 
@@ -501,13 +499,13 @@ NEVER_INLINE bool Machine::resolveBaseAndFunc(ExecState* exec, Instruction* vPC,
 
     ASSERT(iter != end);
 
-    CodeBlock* codeBlock = this->codeBlock(r);
+    CodeBlock* codeBlock = callFrame->codeBlock();
     Identifier& ident = codeBlock->identifiers[property];
     JSObject* base;
     do {
         base = *iter;
         PropertySlot slot(base);
-        if (base->getPropertySlot(exec, ident, slot)) {            
+        if (base->getPropertySlot(callFrame, ident, slot)) {            
             // ECMA 11.2.3 says that if we hit an activation the this value should be null.
             // However, section 10.2.3 says that in the case where the value provided
             // by the caller is null, the global object should be used. It also says
@@ -515,25 +513,26 @@ NEVER_INLINE bool Machine::resolveBaseAndFunc(ExecState* exec, Instruction* vPC,
             // of implementation we use the global object anyway here. This guarantees
             // that in host objects you always get a valid object for this.
             // We also handle wrapper substitution for the global object at the same time.
-            JSObject* thisObj = base->toThisObject(exec);
-            JSValue* result = slot.getValue(exec, ident);
-            exceptionValue = exec->exception();
+            JSObject* thisObj = base->toThisObject(callFrame);
+            JSValue* result = slot.getValue(callFrame, ident);
+            exceptionValue = callFrame->globalData().exception;
             if (exceptionValue)
                 return false;
 
-            r[baseDst] = thisObj;
-            r[funcDst] = result;
+            callFrame[baseDst] = thisObj;
+            callFrame[funcDst] = result;
             return true;
         }
         ++iter;
     } while (iter != end);
 
-    exceptionValue = createUndefinedVariableError(exec, ident, vPC, codeBlock);
+    exceptionValue = createUndefinedVariableError(callFrame, ident, vPC, codeBlock);
     return false;
 }
 
-ALWAYS_INLINE Register* slideRegisterWindowForCall(CodeBlock* newCodeBlock, RegisterFile* registerFile, Register* r, size_t registerOffset, int argc)
+ALWAYS_INLINE CallFrame* Machine::slideRegisterWindowForCall(CodeBlock* newCodeBlock, RegisterFile* registerFile, CallFrame* callFrame, size_t registerOffset, int argc)
 {
+    Register* r = callFrame->registers();
     Register* newEnd = r + registerOffset + newCodeBlock->numCalleeRegisters;
 
     if (LIKELY(argc == newCodeBlock->numParameters)) { // correct number of arguments
@@ -565,42 +564,42 @@ ALWAYS_INLINE Register* slideRegisterWindowForCall(CodeBlock* newCodeBlock, Regi
             argv[i + argc] = argv[i];
     }
 
-    return r;
+    return CallFrame::create(r);
 }
 
-static NEVER_INLINE bool isNotObject(ExecState* exec, bool forInstanceOf, CodeBlock* codeBlock, const Instruction* vPC, JSValue* value, JSValue*& exceptionData)
+static NEVER_INLINE bool isNotObject(CallFrame* callFrame, bool forInstanceOf, CodeBlock* codeBlock, const Instruction* vPC, JSValue* value, JSValue*& exceptionData)
 {
     if (value->isObject())
         return false;
-    exceptionData = createInvalidParamError(exec, forInstanceOf ? "instanceof" : "in" , value, vPC, codeBlock);
+    exceptionData = createInvalidParamError(callFrame, forInstanceOf ? "instanceof" : "in" , value, vPC, codeBlock);
     return true;
 }
 
-NEVER_INLINE JSValue* Machine::callEval(ExecState* exec, JSObject* thisObj, ScopeChainNode* scopeChain, RegisterFile* registerFile, Register* r, int argv, int argc, JSValue*& exceptionValue)
+NEVER_INLINE JSValue* Machine::callEval(CallFrame* callFrame, JSObject* thisObj, ScopeChainNode* scopeChain, RegisterFile* registerFile, int argv, int argc, JSValue*& exceptionValue)
 {
     if (argc < 2)
         return jsUndefined();
 
-    JSValue* program = r[argv + 1].jsValue(exec);
+    JSValue* program = callFrame[argv + 1].jsValue(callFrame);
 
     if (!program->isString())
         return program;
 
     Profiler** profiler = Profiler::enabledProfilerReference();
     if (*profiler)
-        (*profiler)->willExecute(exec, scopeChain->globalObject()->evalFunction());
+        (*profiler)->willExecute(callFrame, scopeChain->globalObject()->evalFunction());
 
     UString programSource = static_cast<JSString*>(program)->value();
 
-    CodeBlock* codeBlock = this->codeBlock(r);
-    RefPtr<EvalNode> evalNode = codeBlock->evalCodeCache.get(exec, programSource, scopeChain, exceptionValue);
+    CodeBlock* codeBlock = callFrame->codeBlock();
+    RefPtr<EvalNode> evalNode = codeBlock->evalCodeCache.get(callFrame, programSource, scopeChain, exceptionValue);
 
     JSValue* result = 0;
     if (evalNode)
-        result = exec->globalData().machine->execute(evalNode.get(), exec, thisObj, r - registerFile->start() + argv + 1 + RegisterFile::CallFrameHeaderSize, scopeChain, &exceptionValue);
+        result = callFrame->globalData().machine->execute(evalNode.get(), callFrame, thisObj, callFrame->registers() - registerFile->start() + argv + 1 + RegisterFile::CallFrameHeaderSize, scopeChain, &exceptionValue);
 
     if (*profiler)
-        (*profiler)->didExecute(exec, scopeChain->globalObject()->evalFunction());
+        (*profiler)->didExecute(callFrame, scopeChain->globalObject()->evalFunction());
 
     return result;
 }
@@ -652,24 +651,24 @@ Machine::~Machine()
 
 #ifndef NDEBUG
 
-void Machine::dumpCallFrame(const RegisterFile* registerFile, const Register* r)
+void Machine::dumpCallFrame(const RegisterFile* registerFile, CallFrame* callFrame)
 {
-    JSGlobalObject* globalObject = scopeChain(r)->globalObject();
+    JSGlobalObject* globalObject = callFrame->scopeChain()->globalObject();
 
-    CodeBlock* codeBlock = this->codeBlock(r);
+    CodeBlock* codeBlock = callFrame->codeBlock();
     codeBlock->dump(globalObject->globalExec());
 
-    dumpRegisters(registerFile, r);
+    dumpRegisters(registerFile, callFrame);
 }
 
-void Machine::dumpRegisters(const RegisterFile* registerFile, const Register* r)
+void Machine::dumpRegisters(const RegisterFile* registerFile, CallFrame* callFrame)
 {
     printf("Register frame: \n\n");
     printf("----------------------------------------------------\n");
     printf("            use            |   address  |   value   \n");
     printf("----------------------------------------------------\n");
 
-    CodeBlock* codeBlock = this->codeBlock(r);
+    CodeBlock* codeBlock = callFrame->codeBlock();
     const Register* it;
     const Register* end;
 
@@ -683,7 +682,7 @@ void Machine::dumpRegisters(const RegisterFile* registerFile, const Register* r)
         printf("----------------------------------------------------\n");
     }
     
-    it = r - RegisterFile::CallFrameHeaderSize - codeBlock->numParameters;
+    it = callFrame->registers() - RegisterFile::CallFrameHeaderSize - codeBlock->numParameters;
     printf("[this]                     | %10p | %10p \n", it, (*it).v()); ++it;
     end = it + max(codeBlock->numParameters - 1, 0); // - 1 to skip "this"
     if (it != end) {
@@ -739,8 +738,6 @@ void Machine::dumpRegisters(const RegisterFile* registerFile, const Register* r)
 
 #endif
 
-//#if !defined(NDEBUG) || ENABLE(SAMPLING_TOOL)
-
 bool Machine::isOpcode(Opcode opcode)
 {
 #if HAVE(COMPUTED_GOTO)
@@ -752,41 +749,32 @@ bool Machine::isOpcode(Opcode opcode)
 #endif
 }
 
-//#endif
-
-NEVER_INLINE bool Machine::unwindCallFrame(ExecState*& exec, JSValue* exceptionValue, const Instruction*& vPC, CodeBlock*& codeBlock, Register*& r)
+NEVER_INLINE bool Machine::unwindCallFrame(CallFrame*& callFrame, JSValue* exceptionValue, const Instruction*& vPC, CodeBlock*& codeBlock)
 {
     CodeBlock* oldCodeBlock = codeBlock;
-    ScopeChainNode* scopeChain = this->scopeChain(r);
+    ScopeChainNode* scopeChain = callFrame->scopeChain();
 
-    if (Debugger* debugger = exec->dynamicGlobalObject()->debugger()) {
-        DebuggerCallFrame debuggerCallFrame(exec->dynamicGlobalObject(), codeBlock, scopeChain, r, exceptionValue);
-        if (r[RegisterFile::Callee].jsValue(exec))
+    if (Debugger* debugger = callFrame->dynamicGlobalObject()->debugger()) {
+        DebuggerCallFrame debuggerCallFrame(callFrame, exceptionValue);
+        if (callFrame->callee())
             debugger->returnEvent(debuggerCallFrame, codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->lastLine());
         else
             debugger->didExecuteProgram(debuggerCallFrame, codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->lastLine());
     }
 
     if (Profiler* profiler = *Profiler::enabledProfilerReference()) {
-        if (r[RegisterFile::Callee].jsValue(exec))
-            profiler->didExecute(exec, static_cast<JSObject*>(r[RegisterFile::Callee].jsValue(exec)));
+        if (callFrame->callee())
+            profiler->didExecute(callFrame, callFrame->callee());
         else
-            profiler->didExecute(exec, codeBlock->ownerNode->sourceURL(), codeBlock->ownerNode->lineNo());
+            profiler->didExecute(callFrame, codeBlock->ownerNode->sourceURL(), codeBlock->ownerNode->lineNo());
     }
 
     // If this call frame created an activation or an 'arguments' object, tear it off.
     if (oldCodeBlock->codeType == FunctionCode && oldCodeBlock->needsFullScopeChain) {
         while (!scopeChain->object->isObject(&JSActivation::info))
             scopeChain = scopeChain->pop();
-        JSActivation* activation = static_cast<JSActivation*>(scopeChain->object);
-        ASSERT(activation->isObject(&JSActivation::info));
-
-        Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue());
-        ASSERT(!arguments || arguments->isObject(&Arguments::info));
-
-        activation->copyRegisters(arguments);
-    } else if (Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue())) {
-        ASSERT(arguments->isObject(&Arguments::info));
+        static_cast<JSActivation*>(scopeChain->object)->copyRegisters(callFrame->optionalCalleeArguments());
+    } else if (Arguments* arguments = callFrame->optionalCalleeArguments()) {
         if (!arguments->isTornOff())
             arguments->copyRegisters();
     }
@@ -794,53 +782,52 @@ NEVER_INLINE bool Machine::unwindCallFrame(ExecState*& exec, JSValue* exceptionV
     if (oldCodeBlock->needsFullScopeChain)
         scopeChain->deref();
 
-    void* returnPC = r[RegisterFile::ReturnPC].v();
-    r = r[RegisterFile::CallerRegisters].r();
-    exec = CallFrame::create(r);
-    if (isHostCallFrame(r))
+    void* returnPC = callFrame->returnPC();
+    callFrame = callFrame->callerFrame();
+    if (callFrame->hasHostCallFrameFlag())
         return false;
 
-    codeBlock = this->codeBlock(r);
+    codeBlock = callFrame->codeBlock();
     vPC = vPCForPC(codeBlock, returnPC);
     return true;
 }
 
-NEVER_INLINE Instruction* Machine::throwException(ExecState* exec, JSValue*& exceptionValue, const Instruction* vPC, Register*& r, bool explicitThrow)
+NEVER_INLINE Instruction* Machine::throwException(CallFrame*& callFrame, JSValue*& exceptionValue, const Instruction* vPC, bool explicitThrow)
 {
     // Set up the exception object
     
-    CodeBlock* codeBlock = this->codeBlock(r);
+    CodeBlock* codeBlock = callFrame->codeBlock();
     if (exceptionValue->isObject()) {
         JSObject* exception = static_cast<JSObject*>(exceptionValue);
         if (exception->isNotAnObjectErrorStub()) {
-            exception = createNotAnObjectError(exec, static_cast<JSNotAnObjectErrorStub*>(exception), vPC, codeBlock);
+            exception = createNotAnObjectError(callFrame, static_cast<JSNotAnObjectErrorStub*>(exception), vPC, codeBlock);
             exceptionValue = exception;
         } else {
-            if (!exception->hasProperty(exec, Identifier(exec, "line")) && 
-                !exception->hasProperty(exec, Identifier(exec, "sourceId")) && 
-                !exception->hasProperty(exec, Identifier(exec, "sourceURL")) && 
-                !exception->hasProperty(exec, Identifier(exec, expressionBeginOffsetPropertyName)) && 
-                !exception->hasProperty(exec, Identifier(exec, expressionCaretOffsetPropertyName)) && 
-                !exception->hasProperty(exec, Identifier(exec, expressionEndOffsetPropertyName))) {
+            if (!exception->hasProperty(callFrame, Identifier(callFrame, "line")) && 
+                !exception->hasProperty(callFrame, Identifier(callFrame, "sourceId")) && 
+                !exception->hasProperty(callFrame, Identifier(callFrame, "sourceURL")) && 
+                !exception->hasProperty(callFrame, Identifier(callFrame, expressionBeginOffsetPropertyName)) && 
+                !exception->hasProperty(callFrame, Identifier(callFrame, expressionCaretOffsetPropertyName)) && 
+                !exception->hasProperty(callFrame, Identifier(callFrame, expressionEndOffsetPropertyName))) {
                 if (explicitThrow) {
                     int startOffset = 0;
                     int endOffset = 0;
                     int divotPoint = 0;
                     int line = codeBlock->expressionRangeForVPC(vPC, divotPoint, startOffset, endOffset);
-                    exception->putWithAttributes(exec, Identifier(exec, "line"), jsNumber(exec, line), ReadOnly | DontDelete);
+                    exception->putWithAttributes(callFrame, Identifier(callFrame, "line"), jsNumber(callFrame, line), ReadOnly | DontDelete);
                     
                     // We only hit this path for error messages and throw statements, which don't have a specific failure position
                     // So we just give the full range of the error/throw statement.
-                    exception->putWithAttributes(exec, Identifier(exec, expressionBeginOffsetPropertyName), jsNumber(exec, divotPoint - startOffset), ReadOnly | DontDelete);
-                    exception->putWithAttributes(exec, Identifier(exec, expressionEndOffsetPropertyName), jsNumber(exec, divotPoint + endOffset), ReadOnly | DontDelete);
+                    exception->putWithAttributes(callFrame, Identifier(callFrame, expressionBeginOffsetPropertyName), jsNumber(callFrame, divotPoint - startOffset), ReadOnly | DontDelete);
+                    exception->putWithAttributes(callFrame, Identifier(callFrame, expressionEndOffsetPropertyName), jsNumber(callFrame, divotPoint + endOffset), ReadOnly | DontDelete);
                 } else
-                    exception->putWithAttributes(exec, Identifier(exec, "line"), jsNumber(exec, codeBlock->lineNumberForVPC(vPC)), ReadOnly | DontDelete);
-                exception->putWithAttributes(exec, Identifier(exec, "sourceId"), jsNumber(exec, codeBlock->ownerNode->sourceID()), ReadOnly | DontDelete);
-                exception->putWithAttributes(exec, Identifier(exec, "sourceURL"), jsOwnedString(exec, codeBlock->ownerNode->sourceURL()), ReadOnly | DontDelete);
+                    exception->putWithAttributes(callFrame, Identifier(callFrame, "line"), jsNumber(callFrame, codeBlock->lineNumberForVPC(vPC)), ReadOnly | DontDelete);
+                exception->putWithAttributes(callFrame, Identifier(callFrame, "sourceId"), jsNumber(callFrame, codeBlock->ownerNode->sourceID()), ReadOnly | DontDelete);
+                exception->putWithAttributes(callFrame, Identifier(callFrame, "sourceURL"), jsOwnedString(callFrame, codeBlock->ownerNode->sourceURL()), ReadOnly | DontDelete);
             }
             
             if (exception->isWatchdogException()) {
-                while (unwindCallFrame(exec, exceptionValue, vPC, codeBlock, r)) {
+                while (unwindCallFrame(callFrame, exceptionValue, vPC, codeBlock)) {
                     // Don't need handler checks or anything, we just want to unroll all the JS callframes possible.
                 }
                 return 0;
@@ -848,9 +835,8 @@ NEVER_INLINE Instruction* Machine::throwException(ExecState* exec, JSValue*& exc
         }
     }
 
-    if (Debugger* debugger = exec->dynamicGlobalObject()->debugger()) {
-        ScopeChainNode* scopeChain = this->scopeChain(r);
-        DebuggerCallFrame debuggerCallFrame(exec->dynamicGlobalObject(), codeBlock, scopeChain, r, exceptionValue);
+    if (Debugger* debugger = callFrame->dynamicGlobalObject()->debugger()) {
+        DebuggerCallFrame debuggerCallFrame(callFrame, exceptionValue);
         debugger->exception(debuggerCallFrame, codeBlock->ownerNode->sourceID(), codeBlock->lineNumberForVPC(vPC));
     }
 
@@ -860,47 +846,47 @@ NEVER_INLINE Instruction* Machine::throwException(ExecState* exec, JSValue*& exc
     Instruction* handlerVPC;
 
     while (!codeBlock->getHandlerForVPC(vPC, handlerVPC, scopeDepth)) {
-        if (!unwindCallFrame(exec, exceptionValue, vPC, codeBlock, r))
+        if (!unwindCallFrame(callFrame, exceptionValue, vPC, codeBlock))
             return 0;
     }
 
     // Now unwind the scope chain within the exception handler's call frame.
 
-    ScopeChain sc(this->scopeChain(r));
+    ScopeChain sc(callFrame->scopeChain());
     int scopeDelta = depth(codeBlock, sc) - scopeDepth;
     ASSERT(scopeDelta >= 0);
     while (scopeDelta--)
         sc.pop();
-    r[RegisterFile::ScopeChain] = sc.node();
+    callFrame->setScopeChain(sc.node());
 
     return handlerVPC;
 }
 
-class DynamicGlobalObjectScope {
+class DynamicGlobalObjectScope : Noncopyable {
 public:
-    DynamicGlobalObjectScope(ExecState* exec, JSGlobalObject* dynamicGlobalObject) 
-        : m_exec(exec)
-        , m_savedGlobalObject(exec->globalData().dynamicGlobalObject)
+    DynamicGlobalObjectScope(CallFrame* callFrame, JSGlobalObject* dynamicGlobalObject) 
+        : m_dynamicGlobalObjectSlot(callFrame->globalData().dynamicGlobalObject)
+        , m_savedDynamicGlobalObject(m_dynamicGlobalObjectSlot)
     {
-        exec->globalData().dynamicGlobalObject = dynamicGlobalObject;
+        m_dynamicGlobalObjectSlot = dynamicGlobalObject;
     }
 
     ~DynamicGlobalObjectScope()
     {
-        m_exec->globalData().dynamicGlobalObject = m_savedGlobalObject;
+        m_dynamicGlobalObjectSlot = m_savedDynamicGlobalObject;
     }
 
 private:
-    ExecState* m_exec;
-    JSGlobalObject* m_savedGlobalObject;
+    JSGlobalObject*& m_dynamicGlobalObjectSlot;
+    JSGlobalObject* m_savedDynamicGlobalObject;
 };
 
-JSValue* Machine::execute(ProgramNode* programNode, ExecState* exec, ScopeChainNode* scopeChain, JSObject* thisObj, JSValue** exception)
+JSValue* Machine::execute(ProgramNode* programNode, CallFrame* callFrame, ScopeChainNode* scopeChain, JSObject* thisObj, JSValue** exception)
 {
-    ASSERT(!exec->hadException());
+    ASSERT(!scopeChain->globalData->exception);
 
     if (m_reentryDepth >= MaxReentryDepth) {
-        *exception = createStackOverflowError(exec);
+        *exception = createStackOverflowError(callFrame);
         return jsNull();
     }
 
@@ -909,41 +895,41 @@ JSValue* Machine::execute(ProgramNode* programNode, ExecState* exec, ScopeChainN
     Register* oldEnd = m_registerFile.end();
     Register* newEnd = oldEnd + codeBlock->numParameters + RegisterFile::CallFrameHeaderSize + codeBlock->numCalleeRegisters;
     if (!m_registerFile.grow(newEnd)) {
-        *exception = createStackOverflowError(exec);
+        *exception = createStackOverflowError(callFrame);
         return jsNull();
     }
 
-    DynamicGlobalObjectScope globalObjectScope(exec, scopeChain->globalObject());
+    DynamicGlobalObjectScope globalObjectScope(callFrame, scopeChain->globalObject());
 
     JSGlobalObject* lastGlobalObject = m_registerFile.globalObject();
-    JSGlobalObject* globalObject = exec->dynamicGlobalObject();
+    JSGlobalObject* globalObject = callFrame->dynamicGlobalObject();
     globalObject->copyGlobalsTo(m_registerFile);
 
-    Register* r = oldEnd + codeBlock->numParameters + RegisterFile::CallFrameHeaderSize;
-    r[codeBlock->thisRegister] = thisObj;
-    initializeCallFrame(r, codeBlock, 0, scopeChain, makeHostCallFramePointer(0), 0, 0, 0);
+    CallFrame* newCallFrame = CallFrame::create(oldEnd + codeBlock->numParameters + RegisterFile::CallFrameHeaderSize);
+    newCallFrame[codeBlock->thisRegister] = thisObj;
+    newCallFrame->init(codeBlock, 0, scopeChain, CallFrame::noCaller(), 0, 0, 0);
 
     if (codeBlock->needsFullScopeChain)
-        scopeChain = scopeChain->copy();
+        scopeChain->ref();
 
     Profiler** profiler = Profiler::enabledProfilerReference();
     if (*profiler)
-        (*profiler)->willExecute(exec, programNode->sourceURL(), programNode->lineNo());
+        (*profiler)->willExecute(newCallFrame, programNode->sourceURL(), programNode->lineNo());
 
     m_reentryDepth++;
 #if ENABLE(CTI)
     if (!codeBlock->ctiCode)
-        CTI::compile(this, exec, codeBlock);
-    JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, r, scopeChain->globalData, exception);
+        CTI::compile(this, newCallFrame, codeBlock);
+    JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);
 #else
-    JSValue* result = privateExecute(Normal, &m_registerFile, r, exception);
+    JSValue* result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
 #endif
     m_reentryDepth--;
 
     MACHINE_SAMPLING_privateExecuteReturned();
 
     if (*profiler)
-        (*profiler)->didExecute(exec, programNode->sourceURL(), programNode->lineNo());
+        (*profiler)->didExecute(callFrame, programNode->sourceURL(), programNode->lineNo());
 
     if (m_reentryDepth && lastGlobalObject && globalObject != lastGlobalObject)
         lastGlobalObject->copyGlobalsTo(m_registerFile);
@@ -953,12 +939,12 @@ JSValue* Machine::execute(ProgramNode* programNode, ExecState* exec, ScopeChainN
     return result;
 }
 
-JSValue* Machine::execute(FunctionBodyNode* functionBodyNode, ExecState* exec, JSFunction* function, JSObject* thisObj, const ArgList& args, ScopeChainNode* scopeChain, JSValue** exception)
+JSValue* Machine::execute(FunctionBodyNode* functionBodyNode, CallFrame* callFrame, JSFunction* function, JSObject* thisObj, const ArgList& args, ScopeChainNode* scopeChain, JSValue** exception)
 {
-    ASSERT(!exec->hadException());
+    ASSERT(!scopeChain->globalData->exception);
 
     if (m_reentryDepth >= MaxReentryDepth) {
-        *exception = createStackOverflowError(exec);
+        *exception = createStackOverflowError(callFrame);
         return jsNull();
     }
 
@@ -966,41 +952,40 @@ JSValue* Machine::execute(FunctionBodyNode* functionBodyNode, ExecState* exec, J
     int argc = 1 + args.size(); // implicit "this" parameter
 
     if (!m_registerFile.grow(oldEnd + argc)) {
-        *exception = createStackOverflowError(exec);
+        *exception = createStackOverflowError(callFrame);
         return jsNull();
     }
 
-    DynamicGlobalObjectScope globalObjectScope(exec, exec->globalData().dynamicGlobalObject ? exec->globalData().dynamicGlobalObject : scopeChain->globalObject());
+    DynamicGlobalObjectScope globalObjectScope(callFrame, callFrame->globalData().dynamicGlobalObject ? callFrame->globalData().dynamicGlobalObject : scopeChain->globalObject());
 
-    Register* argv = oldEnd;
+    CallFrame* newCallFrame = CallFrame::create(oldEnd);
     size_t dst = 0;
-    argv[dst] = thisObj;
-
+    newCallFrame[0] = thisObj;
     ArgList::const_iterator end = args.end();
     for (ArgList::const_iterator it = args.begin(); it != end; ++it)
-        argv[++dst] = *it;
+        newCallFrame[++dst] = *it;
 
     CodeBlock* codeBlock = &functionBodyNode->byteCode(scopeChain);
-    Register* r = slideRegisterWindowForCall(codeBlock, &m_registerFile, argv, argc + RegisterFile::CallFrameHeaderSize, argc);
-    if (UNLIKELY(!r)) {
-        *exception = createStackOverflowError(exec);
+    newCallFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc);
+    if (UNLIKELY(!newCallFrame)) {
+        *exception = createStackOverflowError(callFrame);
         m_registerFile.shrink(oldEnd);
         return jsNull();
     }
     // a 0 codeBlock indicates a built-in caller
-    initializeCallFrame(r, codeBlock, 0, scopeChain, makeHostCallFramePointer(exec->registers()), 0, argc, function);
+    newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), 0, argc, function);
 
     Profiler** profiler = Profiler::enabledProfilerReference();
     if (*profiler)
-        (*profiler)->willExecute(exec, function);
+        (*profiler)->willExecute(newCallFrame, function);
 
     m_reentryDepth++;
 #if ENABLE(CTI)
     if (!codeBlock->ctiCode)
-        CTI::compile(this, exec, codeBlock);
-    JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, r, scopeChain->globalData, exception);
+        CTI::compile(this, newCallFrame, codeBlock);
+    JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);
 #else
-    JSValue* result = privateExecute(Normal, &m_registerFile, r, exception);
+    JSValue* result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
 #endif
     m_reentryDepth--;
 
@@ -1010,21 +995,21 @@ JSValue* Machine::execute(FunctionBodyNode* functionBodyNode, ExecState* exec, J
     return result;
 }
 
-JSValue* Machine::execute(EvalNode* evalNode, ExecState* exec, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue** exception)
+JSValue* Machine::execute(EvalNode* evalNode, CallFrame* callFrame, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue** exception)
 {
-    return execute(evalNode, exec, thisObj, m_registerFile.size() + evalNode->byteCode(scopeChain).numParameters + RegisterFile::CallFrameHeaderSize, scopeChain, exception);
+    return execute(evalNode, callFrame, thisObj, m_registerFile.size() + evalNode->byteCode(scopeChain).numParameters + RegisterFile::CallFrameHeaderSize, scopeChain, exception);
 }
 
-JSValue* Machine::execute(EvalNode* evalNode, ExecState* exec, JSObject* thisObj, int registerOffset, ScopeChainNode* scopeChain, JSValue** exception)
+JSValue* Machine::execute(EvalNode* evalNode, CallFrame* callFrame, JSObject* thisObj, int registerOffset, ScopeChainNode* scopeChain, JSValue** exception)
 {
-    ASSERT(!exec->hadException());
+    ASSERT(!scopeChain->globalData->exception);
 
     if (m_reentryDepth >= MaxReentryDepth) {
-        *exception = createStackOverflowError(exec);
+        *exception = createStackOverflowError(callFrame);
         return jsNull();
     }
 
-    DynamicGlobalObjectScope globalObjectScope(exec, exec->globalData().dynamicGlobalObject ? exec->globalData().dynamicGlobalObject : scopeChain->globalObject());
+    DynamicGlobalObjectScope globalObjectScope(callFrame, callFrame->globalData().dynamicGlobalObject ? callFrame->globalData().dynamicGlobalObject : scopeChain->globalObject());
 
     EvalCodeBlock* codeBlock = &evalNode->byteCode(scopeChain);
 
@@ -1045,9 +1030,9 @@ JSValue* Machine::execute(EvalNode* evalNode, ExecState* exec, JSObject* thisObj
         Node::VarStack::const_iterator varStackEnd = varStack.end();
         for (Node::VarStack::const_iterator it = varStack.begin(); it != varStackEnd; ++it) {
             const Identifier& ident = (*it).first;
-            if (!variableObject->hasProperty(exec, ident)) {
+            if (!variableObject->hasProperty(callFrame, ident)) {
                 PutPropertySlot slot;
-                variableObject->put(exec, ident, jsUndefined(), slot);
+                variableObject->put(callFrame, ident, jsUndefined(), slot);
             }
         }
 
@@ -1055,7 +1040,7 @@ JSValue* Machine::execute(EvalNode* evalNode, ExecState* exec, JSObject* thisObj
         Node::FunctionStack::const_iterator functionStackEnd = functionStack.end();
         for (Node::FunctionStack::const_iterator it = functionStack.begin(); it != functionStackEnd; ++it) {
             PutPropertySlot slot;
-            variableObject->put(exec, (*it)->m_ident, (*it)->makeFunction(exec, scopeChain), slot);
+            variableObject->put(callFrame, (*it)->m_ident, (*it)->makeFunction(callFrame, scopeChain), slot);
         }
 
     }
@@ -1063,70 +1048,66 @@ JSValue* Machine::execute(EvalNode* evalNode, ExecState* exec, JSObject* thisObj
     Register* oldEnd = m_registerFile.end();
     Register* newEnd = m_registerFile.start() + registerOffset + codeBlock->numCalleeRegisters;
     if (!m_registerFile.grow(newEnd)) {
-        *exception = createStackOverflowError(exec);
+        *exception = createStackOverflowError(callFrame);
         return jsNull();
     }
 
-    Register* r = m_registerFile.start() + registerOffset;
+    CallFrame* newCallFrame = CallFrame::create(m_registerFile.start() + registerOffset);
 
     // a 0 codeBlock indicates a built-in caller
-    r[codeBlock->thisRegister] = thisObj;
-    initializeCallFrame(r, codeBlock, 0, scopeChain, makeHostCallFramePointer(exec->registers()), 0, 0, 0);
+    newCallFrame[codeBlock->thisRegister] = thisObj;
+    newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), 0, 0, 0);
 
     if (codeBlock->needsFullScopeChain)
-        scopeChain = scopeChain->copy();
+        scopeChain->ref();
 
     Profiler** profiler = Profiler::enabledProfilerReference();
     if (*profiler)
-        (*profiler)->willExecute(exec, evalNode->sourceURL(), evalNode->lineNo());
+        (*profiler)->willExecute(newCallFrame, evalNode->sourceURL(), evalNode->lineNo());
 
     m_reentryDepth++;
 #if ENABLE(CTI)
     if (!codeBlock->ctiCode)
-        CTI::compile(this, exec, codeBlock);
-    JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, r, scopeChain->globalData, exception);
+        CTI::compile(this, newCallFrame, codeBlock);
+    JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);
 #else
-    JSValue* result = privateExecute(Normal, &m_registerFile, r, exception);
+    JSValue* result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
 #endif
     m_reentryDepth--;
 
     MACHINE_SAMPLING_privateExecuteReturned();
 
     if (*profiler)
-        (*profiler)->didExecute(exec, evalNode->sourceURL(), evalNode->lineNo());
+        (*profiler)->didExecute(callFrame, evalNode->sourceURL(), evalNode->lineNo());
 
     m_registerFile.shrink(oldEnd);
     return result;
 }
 
-NEVER_INLINE void Machine::debug(ExecState* exec, Register* r, DebugHookID debugHookID, int firstLine, int lastLine)
+NEVER_INLINE void Machine::debug(CallFrame* callFrame, DebugHookID debugHookID, int firstLine, int lastLine)
 {
-    Debugger* debugger = exec->dynamicGlobalObject()->debugger();
+    Debugger* debugger = callFrame->dynamicGlobalObject()->debugger();
     if (!debugger)
         return;
 
-    CodeBlock* codeBlock = this->codeBlock(r);
-    ScopeChainNode* scopeChain = this->scopeChain(r);
-    DebuggerCallFrame debuggerCallFrame(exec->dynamicGlobalObject(), codeBlock, scopeChain, r, 0);
-
     switch (debugHookID) {
         case DidEnterCallFrame:
-            debugger->callEvent(debuggerCallFrame, codeBlock->ownerNode->sourceID(), firstLine);
+            debugger->callEvent(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), firstLine);
             return;
         case WillLeaveCallFrame:
-            debugger->returnEvent(debuggerCallFrame, codeBlock->ownerNode->sourceID(), lastLine);
+            debugger->returnEvent(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), lastLine);
             return;
         case WillExecuteStatement:
-            debugger->atStatement(debuggerCallFrame, codeBlock->ownerNode->sourceID(), firstLine);
+            debugger->atStatement(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), firstLine);
             return;
         case WillExecuteProgram:
-            debugger->willExecuteProgram(debuggerCallFrame, codeBlock->ownerNode->sourceID(), firstLine);
+            debugger->willExecuteProgram(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), firstLine);
             return;
         case DidExecuteProgram:
-            debugger->didExecuteProgram(debuggerCallFrame, codeBlock->ownerNode->sourceID(), lastLine);
+            debugger->didExecuteProgram(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), lastLine);
             return;
         case DidReachBreakpoint:
-            debugger->didReachBreakpoint(debuggerCallFrame, codeBlock->ownerNode->sourceID(), lastLine);
+            debugger->didReachBreakpoint(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), lastLine);
             return;
     }
 }
@@ -1216,21 +1197,21 @@ ALWAYS_INLINE JSValue* Machine::checkTimeout(JSGlobalObject* globalObject)
     return 0;
 }
 
-NEVER_INLINE ScopeChainNode* Machine::createExceptionScope(ExecState* exec, const Instruction* vPC, Register* r)
+NEVER_INLINE ScopeChainNode* Machine::createExceptionScope(CallFrame* callFrame, const Instruction* vPC)
 {
     int dst = (++vPC)->u.operand;
-    CodeBlock* codeBlock = this->codeBlock(r);
+    CodeBlock* codeBlock = callFrame->codeBlock();
     Identifier& property = codeBlock->identifiers[(++vPC)->u.operand];
-    JSValue* value = r[(++vPC)->u.operand].jsValue(exec);
-    JSObject* scope = new (exec) JSStaticScopeObject(exec, property, value, DontDelete);
-    r[dst] = scope;
+    JSValue* value = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+    JSObject* scope = new (callFrame) JSStaticScopeObject(callFrame, property, value, DontDelete);
+    callFrame[dst] = scope;
 
-    return scopeChain(r)->push(scope);
+    return callFrame->scopeChain()->push(scope);
 }
 
-static StructureIDChain* cachePrototypeChain(ExecState* exec, StructureID* structureID)
+static StructureIDChain* cachePrototypeChain(CallFrame* callFrame, StructureID* structureID)
 {
-    JSValue* prototype = structureID->prototypeForLookup(exec);
+    JSValue* prototype = structureID->prototypeForLookup(callFrame);
     if (JSImmediate::isImmediate(prototype))
         return 0;
     RefPtr<StructureIDChain> chain = StructureIDChain::create(static_cast<JSObject*>(prototype)->structureID());
@@ -1238,7 +1219,7 @@ static StructureIDChain* cachePrototypeChain(ExecState* exec, StructureID* struc
     return structureID->cachedPrototypeChain();
 }
 
-NEVER_INLINE void Machine::tryCachePutByID(ExecState* exec, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const PutPropertySlot& slot)
+NEVER_INLINE void Machine::tryCachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const PutPropertySlot& slot)
 {
     // Recursive invocation may already have specialized this instruction.
     if (vPC[0].u.opcode != getOpcode(op_put_by_id))
@@ -1290,7 +1271,7 @@ NEVER_INLINE void Machine::tryCachePutByID(ExecState* exec, CodeBlock* codeBlock
         vPC[5] = structureID;
         StructureIDChain* chain = structureID->cachedPrototypeChain();
         if (!chain) {
-            chain = cachePrototypeChain(exec, structureID);
+            chain = cachePrototypeChain(callFrame, structureID);
             if (!chain) {
                 // This happens if someone has manually inserted null into the prototype chain
                 vPC[0] = getOpcode(op_put_by_id_generic);
@@ -1315,7 +1296,7 @@ NEVER_INLINE void Machine::uncachePutByID(CodeBlock* codeBlock, Instruction* vPC
     vPC[4] = 0;
 }
 
-NEVER_INLINE void Machine::tryCacheGetByID(ExecState* exec, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot)
+NEVER_INLINE void Machine::tryCacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot)
 {
     // Recursive invocation may already have specialized this instruction.
     if (vPC[0].u.opcode != getOpcode(op_get_by_id))
@@ -1327,12 +1308,12 @@ NEVER_INLINE void Machine::tryCacheGetByID(ExecState* exec, CodeBlock* codeBlock
         return;
     }
 
-    if (isJSArray(baseValue) && propertyName == exec->propertyNames().length) {
+    if (isJSArray(baseValue) && propertyName == callFrame->propertyNames().length) {
         vPC[0] = getOpcode(op_get_array_length);
         return;
     }
 
-    if (isJSString(baseValue) && propertyName == exec->propertyNames().length) {
+    if (isJSString(baseValue) && propertyName == callFrame->propertyNames().length) {
         vPC[0] = getOpcode(op_get_string_length);
         return;
     }
@@ -1374,7 +1355,7 @@ NEVER_INLINE void Machine::tryCacheGetByID(ExecState* exec, CodeBlock* codeBlock
         return;
     }
 
-    if (slot.slotBase() == structureID->prototypeForLookup(exec)) {
+    if (slot.slotBase() == structureID->prototypeForLookup(callFrame)) {
         ASSERT(slot.slotBase()->isObject());
 
         JSObject* baseObject = static_cast<JSObject*>(slot.slotBase());
@@ -1398,7 +1379,7 @@ NEVER_INLINE void Machine::tryCacheGetByID(ExecState* exec, CodeBlock* codeBlock
     size_t count = 0;
     JSObject* o = static_cast<JSObject*>(baseValue);
     while (slot.slotBase() != o) {
-        JSValue* v = o->structureID()->prototypeForLookup(exec);
+        JSValue* v = o->structureID()->prototypeForLookup(callFrame);
 
         // If we didn't find base in baseValue's prototype chain, then baseValue
         // must be a proxy for another object.
@@ -1422,7 +1403,7 @@ NEVER_INLINE void Machine::tryCacheGetByID(ExecState* exec, CodeBlock* codeBlock
 
     StructureIDChain* chain = structureID->cachedPrototypeChain();
     if (!chain)
-        chain = cachePrototypeChain(exec, structureID);
+        chain = cachePrototypeChain(callFrame, structureID);
     ASSERT(chain);
 
     vPC[0] = getOpcode(op_get_by_id_chain);
@@ -1440,7 +1421,7 @@ NEVER_INLINE void Machine::uncacheGetByID(CodeBlock* codeBlock, Instruction* vPC
     vPC[4] = 0;
 }
 
-JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile, Register* r, JSValue** exception)
+JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile, CallFrame* callFrame, JSValue** exception)
 {
     // One-time initialization of our address tables. We have to put this code
     // here because our labels are only in scope inside this function.
@@ -1465,13 +1446,11 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
     ASSERT_NOT_REACHED();
 #endif
 
-#define exec CallFrame::create(r)
-
-    JSGlobalData* globalData = &exec->globalData();
+    JSGlobalData* globalData = &callFrame->globalData();
     JSValue* exceptionValue = 0;
     Instruction* handlerVPC = 0;
 
-    Instruction* vPC = this->codeBlock(r)->instructions.begin();
+    Instruction* vPC = callFrame->codeBlock()->instructions.begin();
     Profiler** enabledProfilerReference = Profiler::enabledProfilerReference();
     unsigned tickCount = m_ticksUntilNextTimeoutCheck + 1;
 
@@ -1489,13 +1468,13 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
 
 #define CHECK_FOR_TIMEOUT() \
     if (!--tickCount) { \
-        if ((exceptionValue = checkTimeout(exec->dynamicGlobalObject()))) \
+        if ((exceptionValue = checkTimeout(callFrame->dynamicGlobalObject()))) \
             goto vm_throw; \
         tickCount = m_ticksUntilNextTimeoutCheck; \
     }
 
 #if HAVE(COMPUTED_GOTO)
-    #define NEXT_OPCODE MACHINE_SAMPLING_sample(this->codeBlock(r), vPC); goto *vPC->u.opcode
+    #define NEXT_OPCODE MACHINE_SAMPLING_sample(callFrame->codeBlock(), vPC); goto *vPC->u.opcode
 #if DUMP_OPCODE_STATS
     #define BEGIN_OPCODE(opcode) opcode: OpcodeStats::recordInstruction(opcode);
 #else
@@ -1503,7 +1482,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
 #endif
     NEXT_OPCODE;
 #else
-    #define NEXT_OPCODE MACHINE_SAMPLING_sample(this->codeBlock(r), vPC); goto interpreterLoopStart
+    #define NEXT_OPCODE MACHINE_SAMPLING_sample(callFrame->codeBlock(), vPC); goto interpreterLoopStart
 #if DUMP_OPCODE_STATS
     #define BEGIN_OPCODE(opcode) case opcode: OpcodeStats::recordInstruction(opcode);
 #else
@@ -1521,7 +1500,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            constructor, and puts the result in register dst.
         */
         int dst = (++vPC)->u.operand;
-        r[dst] = constructEmptyObject(exec);
+        callFrame[dst] = constructEmptyObject(callFrame);
 
         ++vPC;
         NEXT_OPCODE;
@@ -1537,8 +1516,8 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int dst = (++vPC)->u.operand;
         int firstArg = (++vPC)->u.operand;
         int argCount = (++vPC)->u.operand;
-        ArgList args(r + firstArg, argCount);
-        r[dst] = constructArray(exec, args);
+        ArgList args(callFrame->registers() + firstArg, argCount);
+        callFrame[dst] = constructArray(callFrame, args);
 
         ++vPC;
         NEXT_OPCODE;
@@ -1552,7 +1531,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
         int dst = (++vPC)->u.operand;
         int regExp = (++vPC)->u.operand;
-        r[dst] = new (globalData) RegExpObject(scopeChain(r)->globalObject()->regExpStructure(), codeBlock(r)->regexps[regExp]);
+        callFrame[dst] = new (globalData) RegExpObject(callFrame->scopeChain()->globalObject()->regExpStructure(), callFrame->codeBlock()->regexps[regExp]);
 
         ++vPC;
         NEXT_OPCODE;
@@ -1564,7 +1543,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
         int dst = (++vPC)->u.operand;
         int src = (++vPC)->u.operand;
-        r[dst] = r[src];
+        callFrame[dst] = callFrame[src];
 
         ++vPC;
         NEXT_OPCODE;
@@ -1577,14 +1556,14 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            as a boolean in register dst.
         */
         int dst = (++vPC)->u.operand;
-        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
-        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
         if (JSImmediate::areBothImmediateNumbers(src1, src2))
-            r[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2));
+            callFrame[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2));
         else {
-            JSValue* result = jsBoolean(equalSlowCase(exec, src1, src2));
+            JSValue* result = jsBoolean(equalSlowCase(callFrame, src1, src2));
             VM_CHECK_EXCEPTION();
-            r[dst] = result;
+            callFrame[dst] = result;
         }
 
         ++vPC;
@@ -1597,15 +1576,15 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            operator, and puts the result as a boolean in register dst.
         */
         int dst = (++vPC)->u.operand;
-        JSValue* src = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* src = callFrame[(++vPC)->u.operand].jsValue(callFrame);
 
         if (src->isUndefinedOrNull()) {
-            r[dst] = jsBoolean(true);
+            callFrame[dst] = jsBoolean(true);
             ++vPC;
             NEXT_OPCODE;
         }
         
-        r[dst] = jsBoolean(!JSImmediate::isImmediate(src) && src->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
+        callFrame[dst] = jsBoolean(!JSImmediate::isImmediate(src) && src->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
         ++vPC;
         NEXT_OPCODE;
     }
@@ -1617,14 +1596,14 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            result as a boolean in register dst.
         */
         int dst = (++vPC)->u.operand;
-        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
-        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
         if (JSImmediate::areBothImmediateNumbers(src1, src2))
-            r[dst] = jsBoolean(src1 != src2);
+            callFrame[dst] = jsBoolean(src1 != src2);
         else {
-            JSValue* result = jsBoolean(!equalSlowCase(exec, src1, src2));
+            JSValue* result = jsBoolean(!equalSlowCase(callFrame, src1, src2));
             VM_CHECK_EXCEPTION();
-            r[dst] = result;
+            callFrame[dst] = result;
         }
 
         ++vPC;
@@ -1637,15 +1616,15 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            operator, and puts the result as a boolean in register dst.
         */
         int dst = (++vPC)->u.operand;
-        JSValue* src = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* src = callFrame[(++vPC)->u.operand].jsValue(callFrame);
 
         if (src->isUndefinedOrNull()) {
-            r[dst] = jsBoolean(false);
+            callFrame[dst] = jsBoolean(false);
             ++vPC;
             NEXT_OPCODE;
         }
         
-        r[dst] = jsBoolean(JSImmediate::isImmediate(src) || !static_cast<JSCell*>(src)->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
+        callFrame[dst] = jsBoolean(JSImmediate::isImmediate(src) || !static_cast<JSCell*>(src)->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
         ++vPC;
         NEXT_OPCODE;
     }
@@ -1657,14 +1636,14 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            result as a boolean in register dst.
         */
         int dst = (++vPC)->u.operand;
-        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
-        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
         if (JSImmediate::areBothImmediate(src1, src2))
-            r[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2));
+            callFrame[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2));
         else if (JSImmediate::isEitherImmediate(src1, src2) & (src1 != JSImmediate::zeroImmediate()) & (src2 != JSImmediate::zeroImmediate()))
-            r[dst] = jsBoolean(false);
+            callFrame[dst] = jsBoolean(false);
         else
-            r[dst] = jsBoolean(strictEqualSlowCase(src1, src2));
+            callFrame[dst] = jsBoolean(strictEqualSlowCase(src1, src2));
 
         ++vPC;
         NEXT_OPCODE;
@@ -1677,15 +1656,15 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            puts the result as a boolean in register dst.
         */
         int dst = (++vPC)->u.operand;
-        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
-        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
 
         if (JSImmediate::areBothImmediate(src1, src2))
-            r[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) != reinterpret_cast<intptr_t>(src2));
+            callFrame[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) != reinterpret_cast<intptr_t>(src2));
         else if (JSImmediate::isEitherImmediate(src1, src2) & (src1 != JSImmediate::zeroImmediate()) & (src2 != JSImmediate::zeroImmediate()))
-            r[dst] = jsBoolean(true);
+            callFrame[dst] = jsBoolean(true);
         else
-            r[dst] = jsBoolean(!strictEqualSlowCase(src1, src2));
+            callFrame[dst] = jsBoolean(!strictEqualSlowCase(src1, src2));
 
         ++vPC;
         NEXT_OPCODE;
@@ -1698,11 +1677,11 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            a boolean in register dst.
         */
         int dst = (++vPC)->u.operand;
-        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
-        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
-        JSValue* result = jsBoolean(jsLess(exec, src1, src2));
+        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+        JSValue* result = jsBoolean(jsLess(callFrame, src1, src2));
         VM_CHECK_EXCEPTION();
-        r[dst] = result;
+        callFrame[dst] = result;
 
         ++vPC;
         NEXT_OPCODE;
@@ -1715,11 +1694,11 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            puts the result as a boolean in register dst.
         */
         int dst = (++vPC)->u.operand;
-        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
-        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
-        JSValue* result = jsBoolean(jsLessEq(exec, src1, src2));
+        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+        JSValue* result = jsBoolean(jsLessEq(callFrame, src1, src2));
         VM_CHECK_EXCEPTION();
-        r[dst] = result;
+        callFrame[dst] = result;
 
         ++vPC;
         NEXT_OPCODE;
@@ -1731,13 +1710,13 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            back in register srcDst.
         */
         int srcDst = (++vPC)->u.operand;
-        JSValue* v = r[srcDst].jsValue(exec);
+        JSValue* v = callFrame[srcDst].jsValue(callFrame);
         if (JSImmediate::canDoFastAdditiveOperations(v))
-            r[srcDst] = JSImmediate::incImmediateNumber(v);
+            callFrame[srcDst] = JSImmediate::incImmediateNumber(v);
         else {
-            JSValue* result = jsNumber(exec, v->toNumber(exec) + 1);
+            JSValue* result = jsNumber(callFrame, v->toNumber(callFrame) + 1);
             VM_CHECK_EXCEPTION();
-            r[srcDst] = result;
+            callFrame[srcDst] = result;
         }
 
         ++vPC;
@@ -1750,13 +1729,13 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            back in register srcDst.
         */
         int srcDst = (++vPC)->u.operand;
-        JSValue* v = r[srcDst].jsValue(exec);
+        JSValue* v = callFrame[srcDst].jsValue(callFrame);
         if (JSImmediate::canDoFastAdditiveOperations(v))
-            r[srcDst] = JSImmediate::decImmediateNumber(v);
+            callFrame[srcDst] = JSImmediate::decImmediateNumber(v);
         else {
-            JSValue* result = jsNumber(exec, v->toNumber(exec) - 1);
+            JSValue* result = jsNumber(callFrame, v->toNumber(callFrame) - 1);
             VM_CHECK_EXCEPTION();
-            r[srcDst] = result;
+            callFrame[srcDst] = result;
         }
 
         ++vPC;
@@ -1771,15 +1750,15 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
         int dst = (++vPC)->u.operand;
         int srcDst = (++vPC)->u.operand;
-        JSValue* v = r[srcDst].jsValue(exec);
+        JSValue* v = callFrame[srcDst].jsValue(callFrame);
         if (JSImmediate::canDoFastAdditiveOperations(v)) {
-            r[dst] = v;
-            r[srcDst] = JSImmediate::incImmediateNumber(v);
+            callFrame[dst] = v;
+            callFrame[srcDst] = JSImmediate::incImmediateNumber(v);
         } else {
-            JSValue* number = r[srcDst].jsValue(exec)->toJSNumber(exec);
+            JSValue* number = callFrame[srcDst].jsValue(callFrame)->toJSNumber(callFrame);
             VM_CHECK_EXCEPTION();
-            r[dst] = number;
-            r[srcDst] = jsNumber(exec, number->uncheckedGetNumber() + 1);
+            callFrame[dst] = number;
+            callFrame[srcDst] = jsNumber(callFrame, number->uncheckedGetNumber() + 1);
         }
 
         ++vPC;
@@ -1794,15 +1773,15 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
         int dst = (++vPC)->u.operand;
         int srcDst = (++vPC)->u.operand;
-        JSValue* v = r[srcDst].jsValue(exec);
+        JSValue* v = callFrame[srcDst].jsValue(callFrame);
         if (JSImmediate::canDoFastAdditiveOperations(v)) {
-            r[dst] = v;
-            r[srcDst] = JSImmediate::decImmediateNumber(v);
+            callFrame[dst] = v;
+            callFrame[srcDst] = JSImmediate::decImmediateNumber(v);
         } else {
-            JSValue* number = r[srcDst].jsValue(exec)->toJSNumber(exec);
+            JSValue* number = callFrame[srcDst].jsValue(callFrame)->toJSNumber(callFrame);
             VM_CHECK_EXCEPTION();
-            r[dst] = number;
-            r[srcDst] = jsNumber(exec, number->uncheckedGetNumber() - 1);
+            callFrame[dst] = number;
+            callFrame[srcDst] = jsNumber(callFrame, number->uncheckedGetNumber() - 1);
         }
 
         ++vPC;
@@ -1817,14 +1796,14 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int dst = (++vPC)->u.operand;
         int src = (++vPC)->u.operand;
 
-        JSValue* srcVal = r[src].jsValue(exec);
+        JSValue* srcVal = callFrame[src].jsValue(callFrame);
 
         if (LIKELY(srcVal->isNumber()))
-            r[dst] = r[src];
+            callFrame[dst] = callFrame[src];
         else {
-            JSValue* result = srcVal->toJSNumber(exec);
+            JSValue* result = srcVal->toJSNumber(callFrame);
             VM_CHECK_EXCEPTION();
-            r[dst] = result;
+            callFrame[dst] = result;
         }
 
         ++vPC;
@@ -1837,14 +1816,14 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            result in register dst.
         */
         int dst = (++vPC)->u.operand;
-        JSValue* src = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* src = callFrame[(++vPC)->u.operand].jsValue(callFrame);
         double v;
         if (fastIsNumber(src, v))
-            r[dst] = jsNumber(exec, -v);
+            callFrame[dst] = jsNumber(callFrame, -v);
         else {
-            JSValue* result = jsNumber(exec, -src->toNumber(exec));
+            JSValue* result = jsNumber(callFrame, -src->toNumber(callFrame));
             VM_CHECK_EXCEPTION();
-            r[dst] = result;
+            callFrame[dst] = result;
         }
 
         ++vPC;
@@ -1858,14 +1837,14 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            numeric add, depending on the types of the operands.)
         */
         int dst = (++vPC)->u.operand;
-        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
-        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
         if (JSImmediate::canDoFastAdditiveOperations(src1) && JSImmediate::canDoFastAdditiveOperations(src2))
-            r[dst] = JSImmediate::addImmediateNumbers(src1, src2);
+            callFrame[dst] = JSImmediate::addImmediateNumbers(src1, src2);
         else {
-            JSValue* result = jsAdd(exec, src1, src2);
+            JSValue* result = jsAdd(callFrame, src1, src2);
             VM_CHECK_EXCEPTION();
-            r[dst] = result;
+            callFrame[dst] = result;
         }
         vPC += 2;
         NEXT_OPCODE;
@@ -1877,16 +1856,16 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            numbers), and puts the product in register dst.
         */
         int dst = (++vPC)->u.operand;
-        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
-        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
         double left;
         double right;
         if (fastIsNumber(src1, left) && fastIsNumber(src2, right))
-            r[dst] = jsNumber(exec, left * right);
+            callFrame[dst] = jsNumber(callFrame, left * right);
         else {
-            JSValue* result = jsNumber(exec, src1->toNumber(exec) * src2->toNumber(exec));
+            JSValue* result = jsNumber(callFrame, src1->toNumber(callFrame) * src2->toNumber(callFrame));
             VM_CHECK_EXCEPTION();
-            r[dst] = result;
+            callFrame[dst] = result;
         }
 
         vPC += 2;
@@ -1900,16 +1879,16 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            quotient in register dst.
         */
         int dst = (++vPC)->u.operand;
-        JSValue* dividend = r[(++vPC)->u.operand].jsValue(exec);
-        JSValue* divisor = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* dividend = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+        JSValue* divisor = callFrame[(++vPC)->u.operand].jsValue(callFrame);
         double left;
         double right;
         if (fastIsNumber(dividend, left) && fastIsNumber(divisor, right))
-            r[dst] = jsNumber(exec, left / right);
+            callFrame[dst] = jsNumber(callFrame, left / right);
         else {
-            JSValue* result = jsNumber(exec, dividend->toNumber(exec) / divisor->toNumber(exec));
+            JSValue* result = jsNumber(callFrame, dividend->toNumber(callFrame) / divisor->toNumber(callFrame));
             VM_CHECK_EXCEPTION();
-            r[dst] = result;
+            callFrame[dst] = result;
         }
         ++vPC;
         NEXT_OPCODE;
@@ -1925,19 +1904,19 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int dividend = (++vPC)->u.operand;
         int divisor = (++vPC)->u.operand;
 
-        JSValue* dividendValue = r[dividend].jsValue(exec);
-        JSValue* divisorValue = r[divisor].jsValue(exec);
+        JSValue* dividendValue = callFrame[dividend].jsValue(callFrame);
+        JSValue* divisorValue = callFrame[divisor].jsValue(callFrame);
 
         if (JSImmediate::areBothImmediateNumbers(dividendValue, divisorValue) && divisorValue != JSImmediate::from(0)) {
-            r[dst] = JSImmediate::from(JSImmediate::getTruncatedInt32(dividendValue) % JSImmediate::getTruncatedInt32(divisorValue));
+            callFrame[dst] = JSImmediate::from(JSImmediate::getTruncatedInt32(dividendValue) % JSImmediate::getTruncatedInt32(divisorValue));
             ++vPC;
             NEXT_OPCODE;
         }
 
-        double d = dividendValue->toNumber(exec);
-        JSValue* result = jsNumber(exec, fmod(d, divisorValue->toNumber(exec)));
+        double d = dividendValue->toNumber(callFrame);
+        JSValue* result = jsNumber(callFrame, fmod(d, divisorValue->toNumber(callFrame)));
         VM_CHECK_EXCEPTION();
-        r[dst] = result;
+        callFrame[dst] = result;
         ++vPC;
         NEXT_OPCODE;
     }
@@ -1949,18 +1928,18 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            register dst.
         */
         int dst = (++vPC)->u.operand;
-        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
-        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
         double left;
         double right;
         if (JSImmediate::canDoFastAdditiveOperations(src1) && JSImmediate::canDoFastAdditiveOperations(src2))
-            r[dst] = JSImmediate::subImmediateNumbers(src1, src2);
+            callFrame[dst] = JSImmediate::subImmediateNumbers(src1, src2);
         else if (fastIsNumber(src1, left) && fastIsNumber(src2, right))
-            r[dst] = jsNumber(exec, left - right);
+            callFrame[dst] = jsNumber(callFrame, left - right);
         else {
-            JSValue* result = jsNumber(exec, src1->toNumber(exec) - src2->toNumber(exec));
+            JSValue* result = jsNumber(callFrame, src1->toNumber(callFrame) - src2->toNumber(callFrame));
             VM_CHECK_EXCEPTION();
-            r[dst] = result;
+            callFrame[dst] = result;
         }
         vPC += 2;
         NEXT_OPCODE;
@@ -1973,18 +1952,18 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            in register dst.
         */
         int dst = (++vPC)->u.operand;
-        JSValue* val = r[(++vPC)->u.operand].jsValue(exec);
-        JSValue* shift = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* val = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+        JSValue* shift = callFrame[(++vPC)->u.operand].jsValue(callFrame);
         int32_t left;
         uint32_t right;
         if (JSImmediate::areBothImmediateNumbers(val, shift))
-            r[dst] = jsNumber(exec, JSImmediate::getTruncatedInt32(val) << (JSImmediate::getTruncatedUInt32(shift) & 0x1f));
+            callFrame[dst] = jsNumber(callFrame, JSImmediate::getTruncatedInt32(val) << (JSImmediate::getTruncatedUInt32(shift) & 0x1f));
         else if (fastToInt32(val, left) && fastToUInt32(shift, right))
-            r[dst] = jsNumber(exec, left << (right & 0x1f));
+            callFrame[dst] = jsNumber(callFrame, left << (right & 0x1f));
         else {
-            JSValue* result = jsNumber(exec, (val->toInt32(exec)) << (shift->toUInt32(exec) & 0x1f));
+            JSValue* result = jsNumber(callFrame, (val->toInt32(callFrame)) << (shift->toUInt32(callFrame) & 0x1f));
             VM_CHECK_EXCEPTION();
-            r[dst] = result;
+            callFrame[dst] = result;
         }
 
         ++vPC;
@@ -1998,18 +1977,18 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            uint32), and puts the result in register dst.
         */
         int dst = (++vPC)->u.operand;
-        JSValue* val = r[(++vPC)->u.operand].jsValue(exec);
-        JSValue* shift = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* val = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+        JSValue* shift = callFrame[(++vPC)->u.operand].jsValue(callFrame);
         int32_t left;
         uint32_t right;
         if (JSImmediate::areBothImmediateNumbers(val, shift))
-            r[dst] = JSImmediate::rightShiftImmediateNumbers(val, shift);
+            callFrame[dst] = JSImmediate::rightShiftImmediateNumbers(val, shift);
         else if (fastToInt32(val, left) && fastToUInt32(shift, right))
-            r[dst] = jsNumber(exec, left >> (right & 0x1f));
+            callFrame[dst] = jsNumber(callFrame, left >> (right & 0x1f));
         else {
-            JSValue* result = jsNumber(exec, (val->toInt32(exec)) >> (shift->toUInt32(exec) & 0x1f));
+            JSValue* result = jsNumber(callFrame, (val->toInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
             VM_CHECK_EXCEPTION();
-            r[dst] = result;
+            callFrame[dst] = result;
         }
 
         ++vPC;
@@ -2023,14 +2002,14 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            uint32), and puts the result in register dst.
         */
         int dst = (++vPC)->u.operand;
-        JSValue* val = r[(++vPC)->u.operand].jsValue(exec);
-        JSValue* shift = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* val = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+        JSValue* shift = callFrame[(++vPC)->u.operand].jsValue(callFrame);
         if (JSImmediate::areBothImmediateNumbers(val, shift) && !JSImmediate::isNegative(val))
-            r[dst] = JSImmediate::rightShiftImmediateNumbers(val, shift);
+            callFrame[dst] = JSImmediate::rightShiftImmediateNumbers(val, shift);
         else {
-            JSValue* result = jsNumber(exec, (val->toUInt32(exec)) >> (shift->toUInt32(exec) & 0x1f));
+            JSValue* result = jsNumber(callFrame, (val->toUInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
             VM_CHECK_EXCEPTION();
-            r[dst] = result;
+            callFrame[dst] = result;
         }
 
         ++vPC;
@@ -2044,18 +2023,18 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            in register dst.
         */
         int dst = (++vPC)->u.operand;
-        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
-        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
         int32_t left;
         int32_t right;
         if (JSImmediate::areBothImmediateNumbers(src1, src2))
-            r[dst] = JSImmediate::andImmediateNumbers(src1, src2);
+            callFrame[dst] = JSImmediate::andImmediateNumbers(src1, src2);
         else if (fastToInt32(src1, left) && fastToInt32(src2, right))
-            r[dst] = jsNumber(exec, left & right);
+            callFrame[dst] = jsNumber(callFrame, left & right);
         else {
-            JSValue* result = jsNumber(exec, src1->toInt32(exec) & src2->toInt32(exec));
+            JSValue* result = jsNumber(callFrame, src1->toInt32(callFrame) & src2->toInt32(callFrame));
             VM_CHECK_EXCEPTION();
-            r[dst] = result;
+            callFrame[dst] = result;
         }
 
         vPC += 2;
@@ -2069,18 +2048,18 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            in register dst.
         */
         int dst = (++vPC)->u.operand;
-        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
-        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
         int32_t left;
         int32_t right;
         if (JSImmediate::areBothImmediateNumbers(src1, src2))
-            r[dst] = JSImmediate::xorImmediateNumbers(src1, src2);
+            callFrame[dst] = JSImmediate::xorImmediateNumbers(src1, src2);
         else if (fastToInt32(src1, left) && fastToInt32(src2, right))
-            r[dst] = jsNumber(exec, left ^ right);
+            callFrame[dst] = jsNumber(callFrame, left ^ right);
         else {
-            JSValue* result = jsNumber(exec, src1->toInt32(exec) ^ src2->toInt32(exec));
+            JSValue* result = jsNumber(callFrame, src1->toInt32(callFrame) ^ src2->toInt32(callFrame));
             VM_CHECK_EXCEPTION();
-            r[dst] = result;
+            callFrame[dst] = result;
         }
 
         vPC += 2;
@@ -2094,18 +2073,18 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            result in register dst.
         */
         int dst = (++vPC)->u.operand;
-        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
-        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
         int32_t left;
         int32_t right;
         if (JSImmediate::areBothImmediateNumbers(src1, src2))
-            r[dst] = JSImmediate::orImmediateNumbers(src1, src2);
+            callFrame[dst] = JSImmediate::orImmediateNumbers(src1, src2);
         else if (fastToInt32(src1, left) && fastToInt32(src2, right))
-            r[dst] = jsNumber(exec, left | right);
+            callFrame[dst] = jsNumber(callFrame, left | right);
         else {
-            JSValue* result = jsNumber(exec, src1->toInt32(exec) | src2->toInt32(exec));
+            JSValue* result = jsNumber(callFrame, src1->toInt32(callFrame) | src2->toInt32(callFrame));
             VM_CHECK_EXCEPTION();
-            r[dst] = result;
+            callFrame[dst] = result;
         }
 
         vPC += 2;
@@ -2118,14 +2097,14 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            and puts the result in register dst.
         */
         int dst = (++vPC)->u.operand;
-        JSValue* src = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* src = callFrame[(++vPC)->u.operand].jsValue(callFrame);
         int32_t value;
         if (fastToInt32(src, value))
-            r[dst] = jsNumber(exec, ~value);
+            callFrame[dst] = jsNumber(callFrame, ~value);
         else {
-            JSValue* result = jsNumber(exec, ~src->toInt32(exec));
+            JSValue* result = jsNumber(callFrame, ~src->toInt32(callFrame));
             VM_CHECK_EXCEPTION();
-            r[dst] = result;
+            callFrame[dst] = result;
         }
         ++vPC;
         NEXT_OPCODE;
@@ -2138,9 +2117,9 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
         int dst = (++vPC)->u.operand;
         int src = (++vPC)->u.operand;
-        JSValue* result = jsBoolean(!r[src].jsValue(exec)->toBoolean(exec));
+        JSValue* result = jsBoolean(!callFrame[src].jsValue(callFrame)->toBoolean(callFrame));
         VM_CHECK_EXCEPTION();
-        r[dst] = result;
+        callFrame[dst] = result;
 
         ++vPC;
         NEXT_OPCODE;
@@ -2163,13 +2142,13 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int base = (++vPC)->u.operand;
         int baseProto = (++vPC)->u.operand;
 
-        JSValue* baseVal = r[base].jsValue(exec);
+        JSValue* baseVal = callFrame[base].jsValue(callFrame);
 
-        if (isNotObject(exec, true, codeBlock(r), vPC, baseVal, exceptionValue))
+        if (isNotObject(callFrame, true, callFrame->codeBlock(), vPC, baseVal, exceptionValue))
             goto vm_throw;
 
         JSObject* baseObj = static_cast<JSObject*>(baseVal);
-        r[dst] = jsBoolean(baseObj->structureID()->typeInfo().implementsHasInstance() ? baseObj->hasInstance(exec, r[value].jsValue(exec), r[baseProto].jsValue(exec)) : false);
+        callFrame[dst] = jsBoolean(baseObj->structureID()->typeInfo().implementsHasInstance() ? baseObj->hasInstance(callFrame, callFrame[value].jsValue(callFrame), callFrame[baseProto].jsValue(callFrame)) : false);
 
         ++vPC;
         NEXT_OPCODE;
@@ -2182,7 +2161,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
         int dst = (++vPC)->u.operand;
         int src = (++vPC)->u.operand;
-        r[dst] = jsTypeStringForValue(exec, r[src].jsValue(exec));
+        callFrame[dst] = jsTypeStringForValue(callFrame, callFrame[src].jsValue(callFrame));
 
         ++vPC;
         NEXT_OPCODE;
@@ -2196,8 +2175,8 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
         int dst = (++vPC)->u.operand;
         int src = (++vPC)->u.operand;
-        JSValue* v = r[src].jsValue(exec);
-        r[dst] = jsBoolean(JSImmediate::isImmediate(v) ? v->isUndefined() : v->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
+        JSValue* v = callFrame[src].jsValue(callFrame);
+        callFrame[dst] = jsBoolean(JSImmediate::isImmediate(v) ? v->isUndefined() : v->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
 
         ++vPC;
         NEXT_OPCODE;
@@ -2211,7 +2190,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
         int dst = (++vPC)->u.operand;
         int src = (++vPC)->u.operand;
-        r[dst] = jsBoolean(r[src].jsValue(exec)->isBoolean());
+        callFrame[dst] = jsBoolean(callFrame[src].jsValue(callFrame)->isBoolean());
 
         ++vPC;
         NEXT_OPCODE;
@@ -2225,7 +2204,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
         int dst = (++vPC)->u.operand;
         int src = (++vPC)->u.operand;
-        r[dst] = jsBoolean(r[src].jsValue(exec)->isNumber());
+        callFrame[dst] = jsBoolean(callFrame[src].jsValue(callFrame)->isNumber());
 
         ++vPC;
         NEXT_OPCODE;
@@ -2239,7 +2218,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
         int dst = (++vPC)->u.operand;
         int src = (++vPC)->u.operand;
-        r[dst] = jsBoolean(r[src].jsValue(exec)->isString());
+        callFrame[dst] = jsBoolean(callFrame[src].jsValue(callFrame)->isString());
 
         ++vPC;
         NEXT_OPCODE;
@@ -2253,7 +2232,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
         int dst = (++vPC)->u.operand;
         int src = (++vPC)->u.operand;
-        r[dst] = jsBoolean(jsIsObjectType(r[src].jsValue(exec)));
+        callFrame[dst] = jsBoolean(jsIsObjectType(callFrame[src].jsValue(callFrame)));
 
         ++vPC;
         NEXT_OPCODE;
@@ -2267,7 +2246,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
         int dst = (++vPC)->u.operand;
         int src = (++vPC)->u.operand;
-        r[dst] = jsBoolean(jsIsFunctionType(r[src].jsValue(exec)));
+        callFrame[dst] = jsBoolean(jsIsFunctionType(callFrame[src].jsValue(callFrame)));
 
         ++vPC;
         NEXT_OPCODE;
@@ -2285,21 +2264,21 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int property = (++vPC)->u.operand;
         int base = (++vPC)->u.operand;
 
-        JSValue* baseVal = r[base].jsValue(exec);
-        if (isNotObject(exec, false, codeBlock(r), vPC, baseVal, exceptionValue))
+        JSValue* baseVal = callFrame[base].jsValue(callFrame);
+        if (isNotObject(callFrame, false, callFrame->codeBlock(), vPC, baseVal, exceptionValue))
             goto vm_throw;
 
         JSObject* baseObj = static_cast<JSObject*>(baseVal);
 
-        JSValue* propName = r[property].jsValue(exec);
+        JSValue* propName = callFrame[property].jsValue(callFrame);
 
         uint32_t i;
         if (propName->getUInt32(i))
-            r[dst] = jsBoolean(baseObj->hasProperty(exec, i));
+            callFrame[dst] = jsBoolean(baseObj->hasProperty(callFrame, i));
         else {
-            Identifier property(exec, propName->toString(exec));
+            Identifier property(callFrame, propName->toString(callFrame));
             VM_CHECK_EXCEPTION();
-            r[dst] = jsBoolean(baseObj->hasProperty(exec, property));
+            callFrame[dst] = jsBoolean(baseObj->hasProperty(callFrame, property));
         }
 
         ++vPC;
@@ -2312,7 +2291,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            scope chain, and writes the resulting value to register
            dst. If the property is not found, raises an exception.
         */
-        if (UNLIKELY(!resolve(exec, vPC, r, exceptionValue)))
+        if (UNLIKELY(!resolve(callFrame, vPC, exceptionValue)))
             goto vm_throw;
 
         vPC += 3;
@@ -2325,7 +2304,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
          scope chain skipping the top 'skip' levels, and writes the resulting
          value to register dst. If the property is not found, raises an exception.
          */
-        if (UNLIKELY(!resolveSkip(exec, vPC, r, exceptionValue)))
+        if (UNLIKELY(!resolveSkip(callFrame, vPC, exceptionValue)))
             goto vm_throw;
 
         vPC += 4;
@@ -2340,7 +2319,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            a fast lookup using the case offset, otherwise fall back to a full resolve and
            cache the new structureID and offset
          */
-        if (UNLIKELY(!resolveGlobal(exec, vPC, r,  exceptionValue)))
+        if (UNLIKELY(!resolveGlobal(callFrame, vPC, exceptionValue)))
             goto vm_throw;
         
         vPC += 6;
@@ -2357,7 +2336,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         ASSERT(scope->isGlobalObject());
         int index = (++vPC)->u.operand;
 
-        r[dst] = scope->registerAt(index);
+        callFrame[dst] = scope->registerAt(index);
         ++vPC;
         NEXT_OPCODE;
     }
@@ -2371,7 +2350,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int index = (++vPC)->u.operand;
         int value = (++vPC)->u.operand;
         
-        scope->registerAt(index) = r[value].jsValue(exec);
+        scope->registerAt(index) = callFrame[value].jsValue(callFrame);
         ++vPC;
         NEXT_OPCODE;
     }            
@@ -2383,9 +2362,9 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
          */
         int dst = (++vPC)->u.operand;
         int index = (++vPC)->u.operand;
-        int skip = (++vPC)->u.operand + codeBlock(r)->needsFullScopeChain;
+        int skip = (++vPC)->u.operand + callFrame->codeBlock()->needsFullScopeChain;
 
-        ScopeChainNode* scopeChain = this->scopeChain(r);
+        ScopeChainNode* scopeChain = callFrame->scopeChain();
         ScopeChainIterator iter = scopeChain->begin();
         ScopeChainIterator end = scopeChain->end();
         ASSERT(iter != end);
@@ -2396,7 +2375,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
 
         ASSERT((*iter)->isVariableObject());
         JSVariableObject* scope = static_cast<JSVariableObject*>(*iter);
-        r[dst] = scope->registerAt(index);
+        callFrame[dst] = scope->registerAt(index);
         ++vPC;
         NEXT_OPCODE;
     }
@@ -2405,10 +2384,10 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
 
          */
         int index = (++vPC)->u.operand;
-        int skip = (++vPC)->u.operand + codeBlock(r)->needsFullScopeChain;
+        int skip = (++vPC)->u.operand + callFrame->codeBlock()->needsFullScopeChain;
         int value = (++vPC)->u.operand;
 
-        ScopeChainNode* scopeChain = this->scopeChain(r);
+        ScopeChainNode* scopeChain = callFrame->scopeChain();
         ScopeChainIterator iter = scopeChain->begin();
         ScopeChainIterator end = scopeChain->end();
         ASSERT(iter != end);
@@ -2419,7 +2398,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
 
         ASSERT((*iter)->isVariableObject());
         JSVariableObject* scope = static_cast<JSVariableObject*>(*iter);
-        scope->registerAt(index) = r[value].jsValue(exec);
+        scope->registerAt(index) = callFrame[value].jsValue(callFrame);
         ++vPC;
         NEXT_OPCODE;
     }
@@ -2431,7 +2410,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            register dst. If none is found, the outermost scope (which
            will be the global object) is stored in register dst.
         */
-        resolveBase(exec, vPC, r);
+        resolveBase(callFrame, vPC);
 
         vPC += 3;
         NEXT_OPCODE;
@@ -2448,7 +2427,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            resolve, or resolve_base followed by get_by_id, as it
            avoids duplicate hash lookups.
         */
-        if (UNLIKELY(!resolveBaseAndProperty(exec, vPC, r, exceptionValue)))
+        if (UNLIKELY(!resolveBaseAndProperty(callFrame, vPC, exceptionValue)))
             goto vm_throw;
 
         vPC += 4;
@@ -2469,7 +2448,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            the global object, which is the right behavior for function
            calls but not for other property lookup.
         */
-        if (UNLIKELY(!resolveBaseAndFunc(exec, vPC, r, exceptionValue)))
+        if (UNLIKELY(!resolveBaseAndFunc(callFrame, vPC, exceptionValue)))
             goto vm_throw;
 
         vPC += 4;
@@ -2485,16 +2464,16 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int base = vPC[2].u.operand;
         int property = vPC[3].u.operand;
 
-        CodeBlock* codeBlock = this->codeBlock(r);
+        CodeBlock* codeBlock = callFrame->codeBlock();
         Identifier& ident = codeBlock->identifiers[property];
-        JSValue* baseValue = r[base].jsValue(exec);
+        JSValue* baseValue = callFrame[base].jsValue(callFrame);
         PropertySlot slot(baseValue);
-        JSValue* result = baseValue->get(exec, ident, slot);
+        JSValue* result = baseValue->get(callFrame, ident, slot);
         VM_CHECK_EXCEPTION();
 
-        tryCacheGetByID(exec, codeBlock, vPC, baseValue, ident, slot);
+        tryCacheGetByID(callFrame, codeBlock, vPC, baseValue, ident, slot);
 
-        r[dst] = result;
+        callFrame[dst] = result;
         vPC += 8;
         NEXT_OPCODE;
     }
@@ -2506,7 +2485,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            op_get_by_id.
         */
         int base = vPC[2].u.operand;
-        JSValue* baseValue = r[base].jsValue(exec);
+        JSValue* baseValue = callFrame[base].jsValue(callFrame);
 
         if (LIKELY(!JSImmediate::isImmediate(baseValue))) {
             JSCell* baseCell = static_cast<JSCell*>(baseValue);
@@ -2518,15 +2497,15 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
                 int dst = vPC[1].u.operand;
                 int offset = vPC[5].u.operand;
 
-                ASSERT(baseObject->get(exec, codeBlock(r)->identifiers[vPC[3].u.operand]) == baseObject->getDirectOffset(offset));
-                r[dst] = baseObject->getDirectOffset(offset);
+                ASSERT(baseObject->get(callFrame, callFrame->codeBlock()->identifiers[vPC[3].u.operand]) == baseObject->getDirectOffset(offset));
+                callFrame[dst] = baseObject->getDirectOffset(offset);
 
                 vPC += 8;
                 NEXT_OPCODE;
             }
         }
 
-        uncacheGetByID(codeBlock(r), vPC);
+        uncacheGetByID(callFrame->codeBlock(), vPC);
         NEXT_OPCODE;
     }
     BEGIN_OPCODE(op_get_by_id_proto) {
@@ -2537,23 +2516,23 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            reverts to op_get_by_id.
         */
         int base = vPC[2].u.operand;
-        JSValue* baseValue = r[base].jsValue(exec);
+        JSValue* baseValue = callFrame[base].jsValue(callFrame);
 
         if (LIKELY(!JSImmediate::isImmediate(baseValue))) {
             JSCell* baseCell = static_cast<JSCell*>(baseValue);
             StructureID* structureID = vPC[4].u.structureID;
 
             if (LIKELY(baseCell->structureID() == structureID)) {
-                ASSERT(structureID->prototypeForLookup(exec)->isObject());
-                JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(exec));
+                ASSERT(structureID->prototypeForLookup(callFrame)->isObject());
+                JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(callFrame));
                 StructureID* protoStructureID = vPC[5].u.structureID;
 
                 if (LIKELY(protoObject->structureID() == protoStructureID)) {
                     int dst = vPC[1].u.operand;
                     int offset = vPC[6].u.operand;
 
-                    ASSERT(protoObject->get(exec, codeBlock(r)->identifiers[vPC[3].u.operand]) == protoObject->getDirectOffset(offset));
-                    r[dst] = protoObject->getDirectOffset(offset);
+                    ASSERT(protoObject->get(callFrame, callFrame->codeBlock()->identifiers[vPC[3].u.operand]) == protoObject->getDirectOffset(offset));
+                    callFrame[dst] = protoObject->getDirectOffset(offset);
 
                     vPC += 8;
                     NEXT_OPCODE;
@@ -2561,7 +2540,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
             }
         }
 
-        uncacheGetByID(codeBlock(r), vPC);
+        uncacheGetByID(callFrame->codeBlock(), vPC);
         NEXT_OPCODE;
     }
     BEGIN_OPCODE(op_get_by_id_chain) {
@@ -2572,7 +2551,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            reverts to op_get_by_id.
         */
         int base = vPC[2].u.operand;
-        JSValue* baseValue = r[base].jsValue(exec);
+        JSValue* baseValue = callFrame[base].jsValue(callFrame);
 
         if (LIKELY(!JSImmediate::isImmediate(baseValue))) {
             JSCell* baseCell = static_cast<JSCell*>(baseValue);
@@ -2585,7 +2564,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
 
                 JSObject* baseObject = static_cast<JSObject*>(baseCell);
                 while (1) {
-                    baseObject = static_cast<JSObject*>(baseObject->structureID()->prototypeForLookup(exec));
+                    baseObject = static_cast<JSObject*>(baseObject->structureID()->prototypeForLookup(callFrame));
                     if (UNLIKELY(baseObject->structureID() != (*it).get()))
                         break;
 
@@ -2593,8 +2572,8 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
                         int dst = vPC[1].u.operand;
                         int offset = vPC[7].u.operand;
 
-                        ASSERT(baseObject->get(exec, codeBlock(r)->identifiers[vPC[3].u.operand]) == baseObject->getDirectOffset(offset));
-                        r[dst] = baseObject->getDirectOffset(offset);
+                        ASSERT(baseObject->get(callFrame, callFrame->codeBlock()->identifiers[vPC[3].u.operand]) == baseObject->getDirectOffset(offset));
+                        callFrame[dst] = baseObject->getDirectOffset(offset);
 
                         vPC += 8;
                         NEXT_OPCODE;
@@ -2603,7 +2582,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
             }
         }
 
-        uncacheGetByID(codeBlock(r), vPC);
+        uncacheGetByID(callFrame->codeBlock(), vPC);
         NEXT_OPCODE;
     }
     BEGIN_OPCODE(op_get_by_id_generic) {
@@ -2616,13 +2595,13 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int base = vPC[2].u.operand;
         int property = vPC[3].u.operand;
 
-        Identifier& ident = codeBlock(r)->identifiers[property];
-        JSValue* baseValue = r[base].jsValue(exec);
+        Identifier& ident = callFrame->codeBlock()->identifiers[property];
+        JSValue* baseValue = callFrame[base].jsValue(callFrame);
         PropertySlot slot(baseValue);
-        JSValue* result = baseValue->get(exec, ident, slot);
+        JSValue* result = baseValue->get(callFrame, ident, slot);
         VM_CHECK_EXCEPTION();
 
-        r[dst] = result;
+        callFrame[dst] = result;
         vPC += 8;
         NEXT_OPCODE;
     }
@@ -2635,15 +2614,15 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
 
         int base = vPC[2].u.operand;
-        JSValue* baseValue = r[base].jsValue(exec);
+        JSValue* baseValue = callFrame[base].jsValue(callFrame);
         if (LIKELY(isJSArray(baseValue))) {
             int dst = vPC[1].u.operand;
-            r[dst] = jsNumber(exec, static_cast<JSArray*>(baseValue)->length());
+            callFrame[dst] = jsNumber(callFrame, static_cast<JSArray*>(baseValue)->length());
             vPC += 8;
             NEXT_OPCODE;
         }
 
-        uncacheGetByID(codeBlock(r), vPC);
+        uncacheGetByID(callFrame->codeBlock(), vPC);
         NEXT_OPCODE;
     }
     BEGIN_OPCODE(op_get_string_length) {
@@ -2655,15 +2634,15 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
 
         int base = vPC[2].u.operand;
-        JSValue* baseValue = r[base].jsValue(exec);
+        JSValue* baseValue = callFrame[base].jsValue(callFrame);
         if (LIKELY(isJSString(baseValue))) {
             int dst = vPC[1].u.operand;
-            r[dst] = jsNumber(exec, static_cast<JSString*>(baseValue)->value().size());
+            callFrame[dst] = jsNumber(callFrame, static_cast<JSString*>(baseValue)->value().size());
             vPC += 8;
             NEXT_OPCODE;
         }
 
-        uncacheGetByID(codeBlock(r), vPC);
+        uncacheGetByID(callFrame->codeBlock(), vPC);
         NEXT_OPCODE;
     }
     BEGIN_OPCODE(op_put_by_id) {
@@ -2680,14 +2659,14 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int property = vPC[2].u.operand;
         int value = vPC[3].u.operand;
 
-        CodeBlock* codeBlock = this->codeBlock(r);
-        JSValue* baseValue = r[base].jsValue(exec);
+        CodeBlock* codeBlock = callFrame->codeBlock();
+        JSValue* baseValue = callFrame[base].jsValue(callFrame);
         Identifier& ident = codeBlock->identifiers[property];
         PutPropertySlot slot;
-        baseValue->put(exec, ident, r[value].jsValue(exec), slot);
+        baseValue->put(callFrame, ident, callFrame[value].jsValue(callFrame), slot);
         VM_CHECK_EXCEPTION();
 
-        tryCachePutByID(exec, codeBlock, vPC, baseValue, slot);
+        tryCachePutByID(callFrame, codeBlock, vPC, baseValue, slot);
 
         vPC += 8;
         NEXT_OPCODE;
@@ -2704,7 +2683,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            the register file.
          */
         int base = vPC[1].u.operand;
-        JSValue* baseValue = r[base].jsValue(exec);
+        JSValue* baseValue = callFrame[base].jsValue(callFrame);
         
         if (LIKELY(!JSImmediate::isImmediate(baseValue))) {
             JSCell* baseCell = static_cast<JSCell*>(baseValue);
@@ -2717,29 +2696,29 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
 
                 RefPtr<StructureID>* it = vPC[6].u.structureIDChain->head();
 
-                JSObject* proto = static_cast<JSObject*>(baseObject->structureID()->prototypeForLookup(exec));
+                JSObject* proto = static_cast<JSObject*>(baseObject->structureID()->prototypeForLookup(callFrame));
                 while (!proto->isNull()) {
                     if (UNLIKELY(proto->structureID() != (*it).get())) {
-                        uncachePutByID(codeBlock(r), vPC);
+                        uncachePutByID(callFrame->codeBlock(), vPC);
                         NEXT_OPCODE;
                     }
                     ++it;
-                    proto = static_cast<JSObject*>(proto->structureID()->prototypeForLookup(exec));
+                    proto = static_cast<JSObject*>(proto->structureID()->prototypeForLookup(callFrame));
                 }
 
                 baseObject->transitionTo(newStructureID);
 
                 int value = vPC[3].u.operand;
                 unsigned offset = vPC[7].u.operand;
-                ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(codeBlock(r)->identifiers[vPC[2].u.operand])) == offset);
-                baseObject->putDirectOffset(offset, r[value].jsValue(exec));
+                ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(callFrame->codeBlock()->identifiers[vPC[2].u.operand])) == offset);
+                baseObject->putDirectOffset(offset, callFrame[value].jsValue(callFrame));
 
                 vPC += 8;
                 NEXT_OPCODE;
             }
         }
         
-        uncachePutByID(codeBlock(r), vPC);
+        uncachePutByID(callFrame->codeBlock(), vPC);
         NEXT_OPCODE;
     }
     BEGIN_OPCODE(op_put_by_id_replace) {
@@ -2754,7 +2733,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            the register file.
         */
         int base = vPC[1].u.operand;
-        JSValue* baseValue = r[base].jsValue(exec);
+        JSValue* baseValue = callFrame[base].jsValue(callFrame);
 
         if (LIKELY(!JSImmediate::isImmediate(baseValue))) {
             JSCell* baseCell = static_cast<JSCell*>(baseValue);
@@ -2766,15 +2745,15 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
                 int value = vPC[3].u.operand;
                 unsigned offset = vPC[5].u.operand;
                 
-                ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(codeBlock(r)->identifiers[vPC[2].u.operand])) == offset);
-                baseObject->putDirectOffset(offset, r[value].jsValue(exec));
+                ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(callFrame->codeBlock()->identifiers[vPC[2].u.operand])) == offset);
+                baseObject->putDirectOffset(offset, callFrame[value].jsValue(callFrame));
 
                 vPC += 8;
                 NEXT_OPCODE;
             }
         }
 
-        uncachePutByID(codeBlock(r), vPC);
+        uncachePutByID(callFrame->codeBlock(), vPC);
         NEXT_OPCODE;
     }
     BEGIN_OPCODE(op_put_by_id_generic) {
@@ -2790,10 +2769,10 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int property = vPC[2].u.operand;
         int value = vPC[3].u.operand;
 
-        JSValue* baseValue = r[base].jsValue(exec);
-        Identifier& ident = codeBlock(r)->identifiers[property];
+        JSValue* baseValue = callFrame[base].jsValue(callFrame);
+        Identifier& ident = callFrame->codeBlock()->identifiers[property];
         PutPropertySlot slot;
-        baseValue->put(exec, ident, r[value].jsValue(exec), slot);
+        baseValue->put(callFrame, ident, callFrame[value].jsValue(callFrame), slot);
         VM_CHECK_EXCEPTION();
 
         vPC += 8;
@@ -2811,11 +2790,11 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int base = (++vPC)->u.operand;
         int property = (++vPC)->u.operand;
 
-        JSObject* baseObj = r[base].jsValue(exec)->toObject(exec);
-        Identifier& ident = codeBlock(r)->identifiers[property];
-        JSValue* result = jsBoolean(baseObj->deleteProperty(exec, ident));
+        JSObject* baseObj = callFrame[base].jsValue(callFrame)->toObject(callFrame);
+        Identifier& ident = callFrame->codeBlock()->identifiers[property];
+        JSValue* result = jsBoolean(baseObj->deleteProperty(callFrame, ident));
         VM_CHECK_EXCEPTION();
-        r[dst] = result;
+        callFrame[dst] = result;
         ++vPC;
         NEXT_OPCODE;
     }
@@ -2831,8 +2810,8 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int base = (++vPC)->u.operand;
         int property = (++vPC)->u.operand;
         
-        JSValue* baseValue = r[base].jsValue(exec);
-        JSValue* subscript = r[property].jsValue(exec);
+        JSValue* baseValue = callFrame[base].jsValue(callFrame);
+        JSValue* subscript = callFrame[property].jsValue(callFrame);
 
         JSValue* result;
         unsigned i;
@@ -2844,18 +2823,18 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
                 if (jsArray->canGetIndex(i))
                     result = jsArray->getIndex(i);
                 else
-                    result = jsArray->JSArray::get(exec, i);
+                    result = jsArray->JSArray::get(callFrame, i);
             } else if (isJSString(baseValue) && static_cast<JSString*>(baseValue)->canGetIndex(i))
-                result = static_cast<JSString*>(baseValue)->getIndex(&exec->globalData(), i);
+                result = static_cast<JSString*>(baseValue)->getIndex(&callFrame->globalData(), i);
             else
-                result = baseValue->get(exec, i);
+                result = baseValue->get(callFrame, i);
         } else {
-            Identifier property(exec, subscript->toString(exec));
-            result = baseValue->get(exec, property);
+            Identifier property(callFrame, subscript->toString(callFrame));
+            result = baseValue->get(callFrame, property);
         }
 
         VM_CHECK_EXCEPTION();
-        r[dst] = result;
+        callFrame[dst] = result;
         ++vPC;
         NEXT_OPCODE;
     }
@@ -2874,8 +2853,8 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int property = (++vPC)->u.operand;
         int value = (++vPC)->u.operand;
 
-        JSValue* baseValue = r[base].jsValue(exec);
-        JSValue* subscript = r[property].jsValue(exec);
+        JSValue* baseValue = callFrame[base].jsValue(callFrame);
+        JSValue* subscript = callFrame[property].jsValue(callFrame);
 
         unsigned i;
 
@@ -2884,16 +2863,16 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
             if (isJSArray(baseValue)) {
                 JSArray* jsArray = static_cast<JSArray*>(baseValue);
                 if (jsArray->canSetIndex(i))
-                    jsArray->setIndex(i, r[value].jsValue(exec));
+                    jsArray->setIndex(i, callFrame[value].jsValue(callFrame));
                 else
-                    jsArray->JSArray::put(exec, i, r[value].jsValue(exec));
+                    jsArray->JSArray::put(callFrame, i, callFrame[value].jsValue(callFrame));
             } else
-                baseValue->put(exec, i, r[value].jsValue(exec));
+                baseValue->put(callFrame, i, callFrame[value].jsValue(callFrame));
         } else {
-            Identifier property(exec, subscript->toString(exec));
-            if (!exec->hadException()) { // Don't put to an object if toString threw an exception.
+            Identifier property(callFrame, subscript->toString(callFrame));
+            if (!globalData->exception) { // Don't put to an object if toString threw an exception.
                 PutPropertySlot slot;
-                baseValue->put(exec, property, r[value].jsValue(exec), slot);
+                baseValue->put(callFrame, property, callFrame[value].jsValue(callFrame), slot);
             }
         }
 
@@ -2913,22 +2892,22 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int base = (++vPC)->u.operand;
         int property = (++vPC)->u.operand;
 
-        JSObject* baseObj = r[base].jsValue(exec)->toObject(exec); // may throw
+        JSObject* baseObj = callFrame[base].jsValue(callFrame)->toObject(callFrame); // may throw
 
-        JSValue* subscript = r[property].jsValue(exec);
+        JSValue* subscript = callFrame[property].jsValue(callFrame);
         JSValue* result;
         uint32_t i;
         if (subscript->getUInt32(i))
-            result = jsBoolean(baseObj->deleteProperty(exec, i));
+            result = jsBoolean(baseObj->deleteProperty(callFrame, i));
         else {
             VM_CHECK_EXCEPTION();
-            Identifier property(exec, subscript->toString(exec));
+            Identifier property(callFrame, subscript->toString(callFrame));
             VM_CHECK_EXCEPTION();
-            result = jsBoolean(baseObj->deleteProperty(exec, property));
+            result = jsBoolean(baseObj->deleteProperty(callFrame, property));
         }
 
         VM_CHECK_EXCEPTION();
-        r[dst] = result;
+        callFrame[dst] = result;
         ++vPC;
         NEXT_OPCODE;
     }
@@ -2948,7 +2927,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         unsigned property = (++vPC)->u.operand;
         int value = (++vPC)->u.operand;
 
-        r[base].jsValue(exec)->put(exec, property, r[value].jsValue(exec));
+        callFrame[base].jsValue(callFrame)->put(callFrame, property, callFrame[value].jsValue(callFrame));
 
         ++vPC;
         NEXT_OPCODE;
@@ -2995,7 +2974,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
          */
         int cond = (++vPC)->u.operand;
         int target = (++vPC)->u.operand;
-        if (r[cond].jsValue(exec)->toBoolean(exec)) {
+        if (callFrame[cond].jsValue(callFrame)->toBoolean(callFrame)) {
             vPC += target;
             CHECK_FOR_TIMEOUT();
             NEXT_OPCODE;
@@ -3012,7 +2991,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
         int cond = (++vPC)->u.operand;
         int target = (++vPC)->u.operand;
-        if (r[cond].jsValue(exec)->toBoolean(exec)) {
+        if (callFrame[cond].jsValue(callFrame)->toBoolean(callFrame)) {
             vPC += target;
             NEXT_OPCODE;
         }
@@ -3028,7 +3007,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
         int cond = (++vPC)->u.operand;
         int target = (++vPC)->u.operand;
-        if (!r[cond].jsValue(exec)->toBoolean(exec)) {
+        if (!callFrame[cond].jsValue(callFrame)->toBoolean(callFrame)) {
             vPC += target;
             NEXT_OPCODE;
         }
@@ -3047,11 +3026,11 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            Additionally this loop instruction may terminate JS execution is
            the JS timeout is reached.
          */
-        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
-        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
         int target = (++vPC)->u.operand;
         
-        bool result = jsLess(exec, src1, src2);
+        bool result = jsLess(callFrame, src1, src2);
         VM_CHECK_EXCEPTION();
         
         if (result) {
@@ -3074,11 +3053,11 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            Additionally this loop instruction may terminate JS execution is
            the JS timeout is reached.
         */
-        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
-        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
         int target = (++vPC)->u.operand;
         
-        bool result = jsLessEq(exec, src1, src2);
+        bool result = jsLessEq(callFrame, src1, src2);
         VM_CHECK_EXCEPTION();
         
         if (result) {
@@ -3098,11 +3077,11 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            target from the current instruction, if and only if the 
            result of the comparison is false.
         */
-        JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);
-        JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+        JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
         int target = (++vPC)->u.operand;
 
-        bool result = jsLess(exec, src1, src2);
+        bool result = jsLess(callFrame, src1, src2);
         VM_CHECK_EXCEPTION();
         
         if (!result) {
@@ -3124,12 +3103,12 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
          */
         int tableIndex = (++vPC)->u.operand;
         int defaultOffset = (++vPC)->u.operand;
-        JSValue* scrutinee = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* scrutinee = callFrame[(++vPC)->u.operand].jsValue(callFrame);
         if (!JSImmediate::isNumber(scrutinee))
             vPC += defaultOffset;
         else {
             int32_t value = JSImmediate::getTruncatedInt32(scrutinee);
-            vPC += codeBlock(r)->immediateSwitchJumpTables[tableIndex].offsetForValue(value, defaultOffset);
+            vPC += callFrame->codeBlock()->immediateSwitchJumpTables[tableIndex].offsetForValue(value, defaultOffset);
         }
         NEXT_OPCODE;
     }
@@ -3144,7 +3123,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
          */
         int tableIndex = (++vPC)->u.operand;
         int defaultOffset = (++vPC)->u.operand;
-        JSValue* scrutinee = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* scrutinee = callFrame[(++vPC)->u.operand].jsValue(callFrame);
         if (!scrutinee->isString())
             vPC += defaultOffset;
         else {
@@ -3152,7 +3131,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
             if (value->size() != 1)
                 vPC += defaultOffset;
             else
-                vPC += codeBlock(r)->characterSwitchJumpTables[tableIndex].offsetForValue(value->data()[0], defaultOffset);
+                vPC += callFrame->codeBlock()->characterSwitchJumpTables[tableIndex].offsetForValue(value->data()[0], defaultOffset);
         }
         NEXT_OPCODE;
     }
@@ -3167,11 +3146,11 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
          */
         int tableIndex = (++vPC)->u.operand;
         int defaultOffset = (++vPC)->u.operand;
-        JSValue* scrutinee = r[(++vPC)->u.operand].jsValue(exec);
+        JSValue* scrutinee = callFrame[(++vPC)->u.operand].jsValue(callFrame);
         if (!scrutinee->isString())
             vPC += defaultOffset;
         else 
-            vPC += codeBlock(r)->stringSwitchJumpTables[tableIndex].offsetForValue(static_cast<JSString*>(scrutinee)->value().rep(), defaultOffset);
+            vPC += callFrame->codeBlock()->stringSwitchJumpTables[tableIndex].offsetForValue(static_cast<JSString*>(scrutinee)->value().rep(), defaultOffset);
         NEXT_OPCODE;
     }
     BEGIN_OPCODE(op_new_func) {
@@ -3185,7 +3164,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int dst = (++vPC)->u.operand;
         int func = (++vPC)->u.operand;
 
-        r[dst] = codeBlock(r)->functions[func]->makeFunction(exec, scopeChain(r));
+        callFrame[dst] = callFrame->codeBlock()->functions[func]->makeFunction(callFrame, callFrame->scopeChain());
 
         ++vPC;
         NEXT_OPCODE;
@@ -3201,7 +3180,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int dst = (++vPC)->u.operand;
         int func = (++vPC)->u.operand;
 
-        r[dst] = codeBlock(r)->functionExpressions[func]->makeFunction(exec, scopeChain(r));
+        callFrame[dst] = callFrame->codeBlock()->functionExpressions[func]->makeFunction(callFrame, callFrame->scopeChain());
 
         ++vPC;
         NEXT_OPCODE;
@@ -3225,17 +3204,17 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int argCount = (++vPC)->u.operand;
         ++vPC; // registerOffset
 
-        JSValue* funcVal = r[func].jsValue(exec);
-        JSValue* baseVal = r[thisVal].jsValue(exec);
+        JSValue* funcVal = callFrame[func].jsValue(callFrame);
+        JSValue* baseVal = callFrame[thisVal].jsValue(callFrame);
 
-        ScopeChainNode* scopeChain = this->scopeChain(r);
+        ScopeChainNode* scopeChain = callFrame->scopeChain();
         if (baseVal == scopeChain->globalObject() && funcVal == scopeChain->globalObject()->evalFunction()) {
-            JSObject* thisObject = static_cast<JSObject*>(r[codeBlock(r)->thisRegister].jsValue(exec));
-            JSValue* result = callEval(exec, thisObject, scopeChain, registerFile, r, firstArg, argCount, exceptionValue);
+            JSObject* thisObject = static_cast<JSObject*>(callFrame[callFrame->codeBlock()->thisRegister].jsValue(callFrame));
+            JSValue* result = callEval(callFrame, thisObject, scopeChain, registerFile, firstArg, argCount, exceptionValue);
             if (exceptionValue)
                 goto vm_throw;
 
-            r[dst] = result;
+            callFrame[dst] = result;
 
             ++vPC;
             NEXT_OPCODE;
@@ -3245,7 +3224,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         // this instruction as a normal function call, supplying the proper 'this'
         // value.
         vPC -= 6;
-        r[thisVal] = baseVal->toThisObject(exec);
+        callFrame[thisVal] = baseVal->toThisObject(callFrame);
 
 #if HAVE(COMPUTED_GOTO)
         // Hack around gcc performance quirk by performing an indirect goto
@@ -3299,7 +3278,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int argCount = (++vPC)->u.operand;
         int registerOffset = (++vPC)->u.operand;
 
-        JSValue* v = r[func].jsValue(exec);
+        JSValue* v = callFrame[func].jsValue(callFrame);
 
         CallData callData;
         CallType callType = v->getCallData(callData);
@@ -3309,21 +3288,21 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
             FunctionBodyNode* functionBodyNode = callData.js.functionBody;
             CodeBlock* newCodeBlock = &functionBodyNode->byteCode(callDataScopeChain);
 
-            r[firstArg] = thisVal == missingThisObjectMarker() ? exec->globalThisValue() : r[thisVal].jsValue(exec);
+            callFrame[firstArg] = thisVal == missingThisObjectMarker() ? callFrame->globalThisValue() : callFrame[thisVal].jsValue(callFrame);
             
-            Register* savedR = r;
+            CallFrame* previousCallFrame = callFrame;
 
-            r = slideRegisterWindowForCall(newCodeBlock, registerFile, r, registerOffset, argCount);
-            if (UNLIKELY(!r)) {
-                r = savedR;
-                exceptionValue = createStackOverflowError(CallFrame::create(r));
+            callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount);
+            if (UNLIKELY(!callFrame)) {
+                callFrame = previousCallFrame;
+                exceptionValue = createStackOverflowError(callFrame);
                 goto vm_throw;
             }
 
-            initializeCallFrame(r, newCodeBlock, vPC + 1, callDataScopeChain, savedR, dst, argCount, v);
+            callFrame->init(newCodeBlock, vPC + 1, callDataScopeChain, previousCallFrame, dst, argCount, static_cast<JSFunction*>(v));
     
             if (*enabledProfilerReference)
-                (*enabledProfilerReference)->willExecute(exec, static_cast<JSObject*>(v));
+                (*enabledProfilerReference)->willExecute(callFrame, static_cast<JSObject*>(v));
 
             vPC = newCodeBlock->instructions.begin();
 
@@ -3335,25 +3314,25 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         }
 
         if (callType == CallTypeHost) {
-            JSValue* thisValue = thisVal == missingThisObjectMarker() ? exec->globalThisValue() : r[thisVal].jsValue(exec);
-            ArgList args(r + firstArg + 1, argCount - 1);
+            JSValue* thisValue = thisVal == missingThisObjectMarker() ? callFrame->globalThisValue() : callFrame[thisVal].jsValue(callFrame);
+            ArgList args(callFrame->registers() + firstArg + 1, argCount - 1);
 
-            ScopeChainNode* scopeChain = this->scopeChain(r);
-            initializeCallFrame(r + registerOffset, 0, vPC + 1, scopeChain, r, dst, argCount, v);
-            ExecState* callFrame = CallFrame::create(r + registerOffset);
+            ScopeChainNode* scopeChain = callFrame->scopeChain();
+            CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset);
+            newCallFrame->init(0, vPC + 1, scopeChain, callFrame, dst, argCount, static_cast<JSFunction*>(v));
 
             if (*enabledProfilerReference)
-                (*enabledProfilerReference)->willExecute(callFrame, static_cast<JSObject*>(v));
+                (*enabledProfilerReference)->willExecute(newCallFrame, static_cast<JSFunction*>(v));
 
             MACHINE_SAMPLING_callingHostFunction();
 
-            JSValue* returnValue = callData.native.function(callFrame, static_cast<JSObject*>(v), thisValue, args);
+            JSValue* returnValue = callData.native.function(newCallFrame, static_cast<JSFunction*>(v), thisValue, args);
             VM_CHECK_EXCEPTION();
 
-            r[dst] = returnValue;
+            newCallFrame[dst] = returnValue;
 
             if (*enabledProfilerReference)
-                (*enabledProfilerReference)->didExecute(CallFrame::create(r), static_cast<JSObject*>(v));
+                (*enabledProfilerReference)->didExecute(callFrame, static_cast<JSFunction*>(v));
 
             ++vPC;
             NEXT_OPCODE;
@@ -3361,28 +3340,24 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
 
         ASSERT(callType == CallTypeNone);
 
-        exceptionValue = createNotAFunctionError(exec, v, vPC, codeBlock(r));
+        exceptionValue = createNotAFunctionError(callFrame, v, vPC, callFrame->codeBlock());
         goto vm_throw;
     }
     BEGIN_OPCODE(op_tear_off_activation) {
         int src = (++vPC)->u.operand;
-        JSActivation* activation = static_cast<JSActivation*>(r[src].getJSValue());
-        ASSERT(codeBlock(r)->needsFullScopeChain);
+        ASSERT(callFrame->codeBlock()->needsFullScopeChain);
+        JSActivation* activation = static_cast<JSActivation*>(callFrame[src].getJSValue());
         ASSERT(activation->isObject(&JSActivation::info));
 
-        Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue());
-        ASSERT(!arguments || arguments->isObject(&Arguments::info));
-        activation->copyRegisters(arguments);
+        activation->copyRegisters(callFrame->optionalCalleeArguments());
 
         ++vPC;
         NEXT_OPCODE;
     }
     BEGIN_OPCODE(op_tear_off_arguments) {
-        Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue());
-        ASSERT(codeBlock(r)->usesArguments && !codeBlock(r)->needsFullScopeChain);
-        ASSERT(arguments->isObject(&Arguments::info));
+        ASSERT(callFrame->codeBlock()->usesArguments && !callFrame->codeBlock()->needsFullScopeChain);
 
-        arguments->copyRegisters();
+        callFrame->optionalCalleeArguments()->copyRegisters();
 
         ++vPC;
         NEXT_OPCODE;
@@ -3400,21 +3375,21 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int result = (++vPC)->u.operand;
 
         if (*enabledProfilerReference)
-            (*enabledProfilerReference)->didExecute(exec, static_cast<JSObject*>(r[RegisterFile::Callee].jsValue(exec)));
+            (*enabledProfilerReference)->didExecute(callFrame, callFrame->callee());
 
-        if (codeBlock(r)->needsFullScopeChain)
-            scopeChain(r)->deref();
+        if (callFrame->codeBlock()->needsFullScopeChain)
+            callFrame->scopeChain()->deref();
 
-        JSValue* returnValue = r[result].jsValue(exec);
+        JSValue* returnValue = callFrame[result].jsValue(callFrame);
 
-        vPC = r[RegisterFile::ReturnPC].vPC();
-        int dst = r[RegisterFile::ReturnValueRegister].i();
-        r = r[RegisterFile::CallerRegisters].r();
+        vPC = callFrame->returnPC();
+        int dst = callFrame->returnValueRegister();
+        callFrame = callFrame->callerFrame();
         
-        if (isHostCallFrame(r))
+        if (callFrame->hasHostCallFrameFlag())
             return returnValue;
 
-        r[dst] = returnValue;
+        callFrame[dst] = returnValue;
 
         NEXT_OPCODE;
     }
@@ -3430,13 +3405,13 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
 
         size_t i = 0;
-        CodeBlock* codeBlock = this->codeBlock(r);
+        CodeBlock* codeBlock = callFrame->codeBlock();
         
         for (size_t count = codeBlock->numVars; i < count; ++i)
-            r[i] = jsUndefined();
+            callFrame[i] = jsUndefined();
 
         for (size_t count = codeBlock->constantRegisters.size(), j = 0; j < count; ++i, ++j)
-            r[i] = codeBlock->constantRegisters[j];
+            callFrame[i] = codeBlock->constantRegisters[j];
 
         ++vPC;
         NEXT_OPCODE;
@@ -3455,27 +3430,27 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
 
         size_t i = 0;
-        CodeBlock* codeBlock = this->codeBlock(r);
+        CodeBlock* codeBlock = callFrame->codeBlock();
 
         for (size_t count = codeBlock->numVars; i < count; ++i)
-            r[i] = jsUndefined();
+            callFrame[i] = jsUndefined();
 
         for (size_t count = codeBlock->constantRegisters.size(), j = 0; j < count; ++i, ++j)
-            r[i] = codeBlock->constantRegisters[j];
+            callFrame[i] = codeBlock->constantRegisters[j];
 
         int dst = (++vPC)->u.operand;
-        JSActivation* activation = new (globalData) JSActivation(exec, static_cast<FunctionBodyNode*>(codeBlock->ownerNode), r);
-        r[dst] = activation;
-        r[RegisterFile::ScopeChain] = scopeChain(r)->copy()->push(activation);
+        JSActivation* activation = new (globalData) JSActivation(callFrame, static_cast<FunctionBodyNode*>(codeBlock->ownerNode));
+        callFrame[dst] = activation;
+        callFrame->setScopeChain(callFrame->scopeChain()->copy()->push(activation));
 
         ++vPC;
         NEXT_OPCODE;
     }
     BEGIN_OPCODE(op_convert_this) {
         int thisRegister = (++vPC)->u.operand;
-        JSValue* thisVal = r[thisRegister].getJSValue();
+        JSValue* thisVal = callFrame[thisRegister].getJSValue();
         if (thisVal->needsThisConversion())
-            r[thisRegister] = thisVal->toThisObject(exec);
+            callFrame[thisRegister] = thisVal->toThisObject(callFrame);
 
         ++vPC;
         NEXT_OPCODE;
@@ -3491,9 +3466,9 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            block.
         */
 
-        Arguments* arguments = new (globalData) Arguments(exec, r);
-        r[RegisterFile::OptionalCalleeArguments] = arguments;
-        r[RegisterFile::ArgumentsRegister] = arguments;
+        Arguments* arguments = new (globalData) Arguments(callFrame);
+        callFrame->setCalleeArguments(arguments);
+        callFrame[RegisterFile::ArgumentsRegister] = arguments;
         
         ++vPC;
         NEXT_OPCODE;
@@ -3520,42 +3495,42 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int argCount = (++vPC)->u.operand;
         int registerOffset = (++vPC)->u.operand;
 
-        JSValue* v = r[constr].jsValue(exec);
+        JSValue* v = callFrame[constr].jsValue(callFrame);
 
         ConstructData constructData;
         ConstructType constructType = v->getConstructData(constructData);
 
         if (constructType == ConstructTypeJS) {
             if (*enabledProfilerReference)
-                (*enabledProfilerReference)->willExecute(exec, static_cast<JSObject*>(v));
+                (*enabledProfilerReference)->willExecute(callFrame, static_cast<JSObject*>(v));
 
             ScopeChainNode* callDataScopeChain = constructData.js.scopeChain;
             FunctionBodyNode* functionBodyNode = constructData.js.functionBody;
             CodeBlock* newCodeBlock = &functionBodyNode->byteCode(callDataScopeChain);
 
             StructureID* structure;
-            JSValue* prototype = r[constrProto].jsValue(exec);
+            JSValue* prototype = callFrame[constrProto].jsValue(callFrame);
             if (prototype->isObject())
                 structure = static_cast<JSObject*>(prototype)->inheritorID();
             else
                 structure = callDataScopeChain->globalObject()->emptyObjectStructure();
             JSObject* newObject = new (globalData) JSObject(structure);
 
-            r[firstArg] = newObject; // "this" value
+            callFrame[firstArg] = newObject; // "this" value
 
-            Register* savedR = r;
+            CallFrame* previousCallFrame = callFrame;
 
-            r = slideRegisterWindowForCall(newCodeBlock, registerFile, r, registerOffset, argCount);
-            if (UNLIKELY(!r)) {
-                r = savedR;
-                exceptionValue = createStackOverflowError(CallFrame::create(r));
+            callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount);
+            if (UNLIKELY(!callFrame)) {
+                callFrame = previousCallFrame;
+                exceptionValue = createStackOverflowError(callFrame);
                 goto vm_throw;
             }
 
-            initializeCallFrame(r, newCodeBlock, vPC + 1, callDataScopeChain, savedR, dst, argCount, v);
+            callFrame->init(newCodeBlock, vPC + 1, callDataScopeChain, previousCallFrame, dst, argCount, static_cast<JSFunction*>(v));
     
             if (*enabledProfilerReference)
-                (*enabledProfilerReference)->didExecute(exec, static_cast<JSObject*>(v));
+                (*enabledProfilerReference)->didExecute(callFrame, static_cast<JSObject*>(v));
 
             vPC = newCodeBlock->instructions.begin();
 
@@ -3567,25 +3542,25 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         }
 
         if (constructType == ConstructTypeHost) {
-            ArgList args(r + firstArg + 1, argCount - 1);
+            ArgList args(callFrame->registers() + firstArg + 1, argCount - 1);
 
-            ScopeChainNode* scopeChain = this->scopeChain(r);
-            initializeCallFrame(r + registerOffset, 0, vPC + 1, scopeChain, r, dst, argCount, v);
-            r += registerOffset;
+            ScopeChainNode* scopeChain = callFrame->scopeChain();
+            CallFrame::create(callFrame->registers() + registerOffset)->init(0, vPC + 1, scopeChain, callFrame, dst, argCount, static_cast<JSFunction*>(v));
+            callFrame = CallFrame::create(callFrame->registers() + registerOffset);
 
             if (*enabledProfilerReference)
-                (*enabledProfilerReference)->willExecute(exec, static_cast<JSObject*>(v));
+                (*enabledProfilerReference)->willExecute(callFrame, static_cast<JSObject*>(v));
 
             MACHINE_SAMPLING_callingHostFunction();
 
-            JSValue* returnValue = constructData.native.function(exec, static_cast<JSObject*>(v), args);
-            r -= registerOffset;
+            JSValue* returnValue = constructData.native.function(callFrame, static_cast<JSObject*>(v), args);
+            callFrame = CallFrame::create(callFrame->registers() - registerOffset);
 
             VM_CHECK_EXCEPTION();
-            r[dst] = returnValue;
+            callFrame[dst] = returnValue;
 
             if (*enabledProfilerReference)
-                (*enabledProfilerReference)->didExecute(exec, static_cast<JSObject*>(v));
+                (*enabledProfilerReference)->didExecute(callFrame, static_cast<JSObject*>(v));
 
             ++vPC;
             NEXT_OPCODE;
@@ -3593,7 +3568,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
 
         ASSERT(constructType == ConstructTypeNone);
 
-        exceptionValue = createNotAConstructorError(exec, v, vPC, codeBlock(r));
+        exceptionValue = createNotAConstructorError(callFrame, v, vPC, callFrame->codeBlock());
         goto vm_throw;
     }
     BEGIN_OPCODE(op_construct_verify) {
@@ -3604,13 +3579,13 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
 
         int dst = vPC[1].u.operand;;
-        if (LIKELY(r[dst].jsValue(exec)->isObject())) {
+        if (LIKELY(callFrame[dst].jsValue(callFrame)->isObject())) {
             vPC += 3;
             NEXT_OPCODE;
         }
 
         int override = vPC[2].u.operand;
-        r[dst] = r[override];
+        callFrame[dst] = callFrame[override];
 
         vPC += 3;
         NEXT_OPCODE;
@@ -3622,11 +3597,11 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            of the current scope chain.
         */
         int scope = (++vPC)->u.operand;
-        JSValue* v = r[scope].jsValue(exec);
-        JSObject* o = v->toObject(exec);
+        JSValue* v = callFrame[scope].jsValue(callFrame);
+        JSObject* o = v->toObject(callFrame);
         VM_CHECK_EXCEPTION();
 
-        r[RegisterFile::ScopeChain] = scopeChain(r)->push(o);
+        callFrame->setScopeChain(callFrame->scopeChain()->push(o));
 
         ++vPC;
         NEXT_OPCODE;
@@ -3636,7 +3611,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
 
            Removes the top item from the current scope chain.
         */
-        r[RegisterFile::ScopeChain] = scopeChain(r)->pop();
+        callFrame->setScopeChain(callFrame->scopeChain()->pop());
 
         ++vPC;
         NEXT_OPCODE;
@@ -3652,7 +3627,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int dst = (++vPC)->u.operand;
         int base = (++vPC)->u.operand;
 
-        r[dst] = JSPropertyNameIterator::create(exec, r[base].jsValue(exec));
+        callFrame[dst] = JSPropertyNameIterator::create(callFrame, callFrame[base].jsValue(callFrame));
         ++vPC;
         NEXT_OPCODE;
     }
@@ -3669,10 +3644,10 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int iter = (++vPC)->u.operand;
         int target = (++vPC)->u.operand;
 
-        JSPropertyNameIterator* it = r[iter].jsPropertyNameIterator();
-        if (JSValue* temp = it->next(exec)) {
+        JSPropertyNameIterator* it = callFrame[iter].propertyNameIterator();
+        if (JSValue* temp = it->next(callFrame)) {
             CHECK_FOR_TIMEOUT();
-            r[dst] = temp;
+            callFrame[dst] = temp;
             vPC += target;
             NEXT_OPCODE;
         }
@@ -3691,10 +3666,10 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int count = (++vPC)->u.operand;
         int target = (++vPC)->u.operand;
 
-        ScopeChainNode* tmp = scopeChain(r);
+        ScopeChainNode* tmp = callFrame->scopeChain();
         while (count--)
             tmp = tmp->pop();
-        r[RegisterFile::ScopeChain] = tmp;
+        callFrame->setScopeChain(tmp);
 
         vPC += target;
         NEXT_OPCODE;
@@ -3710,7 +3685,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            object is then pushed onto the ScopeChain.  The scope object is then stored
            in dst for GC.
          */
-        r[RegisterFile::ScopeChain] = createExceptionScope(exec, vPC, r);
+        callFrame->setScopeChain(createExceptionScope(callFrame, vPC));
 
         vPC += 4;
         NEXT_OPCODE;
@@ -3726,9 +3701,9 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            and usually forms the beginning of an exception handler.
         */
         ASSERT(exceptionValue);
-        ASSERT(!exec->hadException());
+        ASSERT(!globalData->exception);
         int ex = (++vPC)->u.operand;
-        r[ex] = exceptionValue;
+        callFrame[ex] = exceptionValue;
         exceptionValue = 0;
 
         ++vPC;
@@ -3746,9 +3721,9 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
 
         int ex = (++vPC)->u.operand;
-        exceptionValue = r[ex].jsValue(exec);
+        exceptionValue = callFrame[ex].jsValue(callFrame);
 
-        handlerVPC = throwException(exec, exceptionValue, vPC, r, true);
+        handlerVPC = throwException(callFrame, exceptionValue, vPC, true);
         if (!handlerVPC) {
             *exception = exceptionValue;
             return jsNull();
@@ -3773,7 +3748,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
         int dst = (++vPC)->u.operand;
         int src = (++vPC)->u.operand;
-        r[dst] = codeBlock(r)->unexpectedConstants[src];
+        callFrame[dst] = callFrame->codeBlock()->unexpectedConstants[src];
 
         ++vPC;
         NEXT_OPCODE;
@@ -3790,8 +3765,8 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int type = (++vPC)->u.operand;
         int message = (++vPC)->u.operand;
 
-        CodeBlock* codeBlock = this->codeBlock(r);
-        r[dst] = Error::create(exec, (ErrorType)type, codeBlock->unexpectedConstants[message]->toString(exec), codeBlock->lineNumberForVPC(vPC), codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL());
+        CodeBlock* codeBlock = callFrame->codeBlock();
+        callFrame[dst] = Error::create(callFrame, (ErrorType)type, codeBlock->unexpectedConstants[message]->toString(callFrame), codeBlock->lineNumberForVPC(vPC), codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL());
 
         ++vPC;
         NEXT_OPCODE;
@@ -3803,13 +3778,13 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
            program. Return control to the calling native code.
         */
 
-        if (codeBlock(r)->needsFullScopeChain) {
-            ScopeChainNode* scopeChain = this->scopeChain(r);
+        if (callFrame->codeBlock()->needsFullScopeChain) {
+            ScopeChainNode* scopeChain = callFrame->scopeChain();
             ASSERT(scopeChain->refCount > 1);
             scopeChain->deref();
         }
         int result = (++vPC)->u.operand;
-        return r[result].jsValue(exec);
+        return callFrame[result].jsValue(callFrame);
     }
     BEGIN_OPCODE(op_put_getter) {
         /* put_getter base(r) property(id) function(r)
@@ -3826,11 +3801,11 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int property = (++vPC)->u.operand;
         int function = (++vPC)->u.operand;
 
-        ASSERT(r[base].jsValue(exec)->isObject());
-        JSObject* baseObj = static_cast<JSObject*>(r[base].jsValue(exec));
-        Identifier& ident = codeBlock(r)->identifiers[property];
-        ASSERT(r[function].jsValue(exec)->isObject());
-        baseObj->defineGetter(exec, ident, static_cast<JSObject*>(r[function].jsValue(exec)));
+        ASSERT(callFrame[base].jsValue(callFrame)->isObject());
+        JSObject* baseObj = static_cast<JSObject*>(callFrame[base].jsValue(callFrame));
+        Identifier& ident = callFrame->codeBlock()->identifiers[property];
+        ASSERT(callFrame[function].jsValue(callFrame)->isObject());
+        baseObj->defineGetter(callFrame, ident, static_cast<JSObject*>(callFrame[function].jsValue(callFrame)));
 
         ++vPC;
         NEXT_OPCODE;
@@ -3850,11 +3825,11 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int property = (++vPC)->u.operand;
         int function = (++vPC)->u.operand;
 
-        ASSERT(r[base].jsValue(exec)->isObject());
-        JSObject* baseObj = static_cast<JSObject*>(r[base].jsValue(exec));
-        Identifier& ident = codeBlock(r)->identifiers[property];
-        ASSERT(r[function].jsValue(exec)->isObject());
-        baseObj->defineSetter(exec, ident, static_cast<JSObject*>(r[function].jsValue(exec)));
+        ASSERT(callFrame[base].jsValue(callFrame)->isObject());
+        JSObject* baseObj = static_cast<JSObject*>(callFrame[base].jsValue(callFrame));
+        Identifier& ident = callFrame->codeBlock()->identifiers[property];
+        ASSERT(callFrame[function].jsValue(callFrame)->isObject());
+        baseObj->defineSetter(callFrame, ident, static_cast<JSObject*>(callFrame[function].jsValue(callFrame)));
 
         ++vPC;
         NEXT_OPCODE;
@@ -3867,7 +3842,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         */
         int retAddrDst = (++vPC)->u.operand;
         int target = (++vPC)->u.operand;
-        r[retAddrDst] = vPC + 1;
+        callFrame[retAddrDst] = vPC + 1;
 
         vPC += target;
         NEXT_OPCODE;
@@ -3880,7 +3855,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
          register, not as an immediate.
         */
         int retAddrSrc = (++vPC)->u.operand;
-        vPC = r[retAddrSrc].vPC();
+        vPC = callFrame[retAddrSrc].vPC();
         NEXT_OPCODE;
     }
     BEGIN_OPCODE(op_debug) {
@@ -3893,7 +3868,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
         int firstLine = (++vPC)->u.operand;
         int lastLine = (++vPC)->u.operand;
 
-        debug(exec, r, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
+        debug(callFrame, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
 
         ++vPC;
         NEXT_OPCODE;
@@ -3905,7 +3880,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
             // cannot fathom if we don't assign to the exceptionValue before branching)
             exceptionValue = createInterruptedExecutionException(globalData);
         }
-        handlerVPC = throwException(exec, exceptionValue, vPC, r, false);
+        handlerVPC = throwException(callFrame, exceptionValue, vPC, false);
         if (!handlerVPC) {
             *exception = exceptionValue;
             return jsNull();
@@ -3921,99 +3896,91 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
     #undef BEGIN_OPCODE
     #undef VM_CHECK_EXCEPTION
     #undef CHECK_FOR_TIMEOUT
-    #undef exec
 }
 
-JSValue* Machine::retrieveArguments(ExecState* exec, JSFunction* function) const
+JSValue* Machine::retrieveArguments(CallFrame* callFrame, JSFunction* function) const
 {
-    Register* r = this->callFrame(exec, function);
-    if (!r)
+    CallFrame* functionCallFrame = findFunctionCallFrame(callFrame, function);
+    if (!functionCallFrame)
         return jsNull();
 
-    CodeBlock* codeBlock = Machine::codeBlock(r);
+    CodeBlock* codeBlock = functionCallFrame->codeBlock();
     if (codeBlock->usesArguments) {
         ASSERT(codeBlock->codeType == FunctionCode);
         SymbolTable& symbolTable = static_cast<FunctionBodyNode*>(codeBlock->ownerNode)->symbolTable();
-        int argumentsIndex = symbolTable.get(exec->propertyNames().arguments.ustring().rep()).getIndex();
-        return r[argumentsIndex].jsValue(exec);
+        int argumentsIndex = symbolTable.get(functionCallFrame->propertyNames().arguments.ustring().rep()).getIndex();
+        return functionCallFrame[argumentsIndex].jsValue(callFrame);
     }
 
-    Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue());
+    Arguments* arguments = functionCallFrame->optionalCalleeArguments();
     if (!arguments) {
-        arguments = new (exec) Arguments(exec, r);
+        arguments = new (functionCallFrame) Arguments(functionCallFrame);
         arguments->copyRegisters();
-        r[RegisterFile::OptionalCalleeArguments] = arguments;
+        callFrame->setCalleeArguments(arguments);
     }
-    ASSERT(arguments->isObject(&Arguments::info));
 
     return arguments;
 }
 
-JSValue* Machine::retrieveCaller(ExecState* exec, InternalFunction* function) const
+JSValue* Machine::retrieveCaller(CallFrame* callFrame, InternalFunction* function) const
 {
-    Register* r = this->callFrame(exec, function);
-    if (!r)
+    CallFrame* functionCallFrame = findFunctionCallFrame(callFrame, function);
+    if (!functionCallFrame)
         return jsNull();
 
-    Register* callerR = r[RegisterFile::CallerRegisters].r();
-    if (isHostCallFrame(callerR))
+    CallFrame* callerFrame = functionCallFrame->callerFrame();
+    if (callerFrame->hasHostCallFrameFlag())
         return jsNull();
 
-    JSValue* caller = callerR[RegisterFile::Callee].jsValue(exec);
+    JSValue* caller = callerFrame->callee();
     if (!caller)
         return jsNull();
 
     return caller;
 }
 
-void Machine::retrieveLastCaller(ExecState* exec, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const
+void Machine::retrieveLastCaller(CallFrame* callFrame, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const
 {
     function = 0;
     lineNumber = -1;
     sourceURL = UString();
 
-    Register* r = exec->registers();
-    Register* callerR = r[RegisterFile::CallerRegisters].r();
-    if (isHostCallFrame(callerR))
+    CallFrame* callerFrame = callFrame->callerFrame();
+    if (callerFrame->hasHostCallFrameFlag())
         return;
 
-    CodeBlock* callerCodeBlock = codeBlock(callerR);
+    CodeBlock* callerCodeBlock = callerFrame->codeBlock();
     if (!callerCodeBlock)
         return;
 
-    Instruction* vPC = vPCForPC(callerCodeBlock, r[RegisterFile::ReturnPC].v());
+    Instruction* vPC = vPCForPC(callerCodeBlock, callFrame->returnPC());
     lineNumber = callerCodeBlock->lineNumberForVPC(vPC - 1);
     sourceID = callerCodeBlock->ownerNode->sourceID();
     sourceURL = callerCodeBlock->ownerNode->sourceURL();
-
-    JSValue* caller = callerR[RegisterFile::Callee].getJSValue();
-    if (!caller)
-        return;
-
-    function = caller;
+    function = callerFrame->callee();
 }
 
-Register* Machine::callFrame(ExecState* exec, InternalFunction* function) const
+CallFrame* Machine::findFunctionCallFrame(CallFrame* callFrame, InternalFunction* function)
 {
-    for (Register* r = exec->registers(); r; r = stripHostCallFrameBit(r[RegisterFile::CallerRegisters].r()))
-        if (r[RegisterFile::Callee].getJSValue() == function)
-            return r;
+    for (CallFrame* candidate = callFrame; candidate; candidate = candidate->callerFrame()->removeHostCallFrameFlag()) {
+        if (candidate->callee() == function)
+            return candidate;
+    }
     return 0;
 }
 
-void Machine::getArgumentsData(Register* callFrame, JSFunction*& function, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc)
+void Machine::getArgumentsData(CallFrame* callFrame, JSFunction*& function, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc)
 {
-    function = static_cast<JSFunction*>(callFrame[RegisterFile::Callee].getJSValue());
-    ASSERT(function->inherits(&JSFunction::info));
+    function = callFrame->callee();
     
     CodeBlock* codeBlock = &function->m_body->generatedByteCode();
     int numParameters = codeBlock->numParameters;
-    argc = callFrame[RegisterFile::ArgumentCount].i();
+    argc = callFrame->argumentCount();
 
     if (argc <= numParameters)
-        argv = callFrame - RegisterFile::CallFrameHeaderSize - numParameters + 1; // + 1 to skip "this"
+        argv = callFrame->registers() - RegisterFile::CallFrameHeaderSize - numParameters + 1; // + 1 to skip "this"
     else
-        argv = callFrame - RegisterFile::CallFrameHeaderSize - numParameters - argc + 1; // + 1 to skip "this"
+        argv = callFrame->registers() - RegisterFile::CallFrameHeaderSize - numParameters - argc + 1; // + 1 to skip "this"
 
     argc -= 1; // - 1 to skip "this"
     firstParameterIndex = -RegisterFile::CallFrameHeaderSize - numParameters + 1; // + 1 to skip "this"
@@ -4026,7 +3993,7 @@ NEVER_INLINE static void doSetReturnAddressVMThrowTrampoline(void** returnAddres
     ctiSetReturnAddress(returnAddress, reinterpret_cast<void*>(ctiVMThrowTrampoline));
 }
 
-NEVER_INLINE void Machine::tryCTICachePutByID(ExecState* exec, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const PutPropertySlot& slot)
+NEVER_INLINE void Machine::tryCTICachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const PutPropertySlot& slot)
 {
     // The interpreter checks for recursion here; I do not believe this can occur in CTI.
 
@@ -4068,7 +4035,7 @@ NEVER_INLINE void Machine::tryCTICachePutByID(ExecState* exec, CodeBlock* codeBl
         vPC[5] = structureID;
         StructureIDChain* chain = structureID->cachedPrototypeChain();
         if (!chain) {
-            chain = cachePrototypeChain(exec, structureID);
+            chain = cachePrototypeChain(callFrame, structureID);
             if (!chain) {
                 // This happens if someone has manually inserted null into the prototype chain
                 vPC[0] = getOpcode(op_put_by_id_generic);
@@ -4078,7 +4045,7 @@ NEVER_INLINE void Machine::tryCTICachePutByID(ExecState* exec, CodeBlock* codeBl
         vPC[6] = chain;
         vPC[7] = slot.cachedOffset();
         codeBlock->refStructureIDs(vPC);
-        CTI::compilePutByIdTransition(this, exec, codeBlock, structureID->previousID(), structureID, slot.cachedOffset(), chain, returnAddress);
+        CTI::compilePutByIdTransition(this, callFrame, codeBlock, structureID->previousID(), structureID, slot.cachedOffset(), chain, returnAddress);
         return;
     }
     
@@ -4088,30 +4055,30 @@ NEVER_INLINE void Machine::tryCTICachePutByID(ExecState* exec, CodeBlock* codeBl
     codeBlock->refStructureIDs(vPC);
 
 #if USE(CTI_REPATCH_PIC)
-    UNUSED_PARAM(exec);
+    UNUSED_PARAM(callFrame);
     CTI::patchPutByIdReplace(codeBlock, structureID, slot.cachedOffset(), returnAddress);
 #else
-    CTI::compilePutByIdReplace(this, exec, codeBlock, structureID, slot.cachedOffset(), returnAddress);
+    CTI::compilePutByIdReplace(this, callFrame, codeBlock, structureID, slot.cachedOffset(), returnAddress);
 #endif
 }
 
-void* Machine::getCTIArrayLengthTrampoline(ExecState* exec, CodeBlock* codeBlock)
+void* Machine::getCTIArrayLengthTrampoline(CallFrame* callFrame, CodeBlock* codeBlock)
 {
     if (!m_ctiArrayLengthTrampoline)
-        m_ctiArrayLengthTrampoline = CTI::compileArrayLengthTrampoline(this, exec, codeBlock);
+        m_ctiArrayLengthTrampoline = CTI::compileArrayLengthTrampoline(this, callFrame, codeBlock);
         
     return m_ctiArrayLengthTrampoline;
 }
 
-void* Machine::getCTIStringLengthTrampoline(ExecState* exec, CodeBlock* codeBlock)
+void* Machine::getCTIStringLengthTrampoline(CallFrame* callFrame, CodeBlock* codeBlock)
 {
     if (!m_ctiStringLengthTrampoline)
-        m_ctiStringLengthTrampoline = CTI::compileStringLengthTrampoline(this, exec, codeBlock);
+        m_ctiStringLengthTrampoline = CTI::compileStringLengthTrampoline(this, callFrame, codeBlock);
         
     return m_ctiStringLengthTrampoline;
 }
 
-NEVER_INLINE void Machine::tryCTICacheGetByID(ExecState* exec, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot)
+NEVER_INLINE void Machine::tryCTICacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot)
 {
     // FIXME: Write a test that proves we need to check for recursion here just
     // like the interpreter does, then add a check for recursion.
@@ -4122,18 +4089,18 @@ NEVER_INLINE void Machine::tryCTICacheGetByID(ExecState* exec, CodeBlock* codeBl
         return;
     }
 
-    if (isJSArray(baseValue) && propertyName == exec->propertyNames().length) {
+    if (isJSArray(baseValue) && propertyName == callFrame->propertyNames().length) {
 #if USE(CTI_REPATCH_PIC)
-        CTI::compilePatchGetArrayLength(this, exec, codeBlock, returnAddress);
+        CTI::compilePatchGetArrayLength(this, callFrame, codeBlock, returnAddress);
 #else
-        ctiRepatchCallByReturnAddress(returnAddress, getCTIArrayLengthTrampoline(exec, codeBlock));
+        ctiRepatchCallByReturnAddress(returnAddress, getCTIArrayLengthTrampoline(callFrame, codeBlock));
 #endif
         return;
     }
-    if (isJSString(baseValue) && propertyName == exec->propertyNames().length) {
+    if (isJSString(baseValue) && propertyName == callFrame->propertyNames().length) {
         // The tradeoff of compiling an repatched inline string length access routine does not seem
         // to pay off, so we currently only do this for arrays.
-        ctiRepatchCallByReturnAddress(returnAddress, getCTIStringLengthTrampoline(exec, codeBlock));
+        ctiRepatchCallByReturnAddress(returnAddress, getCTIStringLengthTrampoline(callFrame, codeBlock));
         return;
     }
 
@@ -4169,12 +4136,12 @@ NEVER_INLINE void Machine::tryCTICacheGetByID(ExecState* exec, CodeBlock* codeBl
 #if USE(CTI_REPATCH_PIC)
         CTI::patchGetByIdSelf(codeBlock, structureID, slot.cachedOffset(), returnAddress);
 #else
-        CTI::compileGetByIdSelf(this, exec, codeBlock, structureID, slot.cachedOffset(), returnAddress);
+        CTI::compileGetByIdSelf(this, callFrame, codeBlock, structureID, slot.cachedOffset(), returnAddress);
 #endif
         return;
     }
 
-    if (slot.slotBase() == structureID->prototypeForLookup(exec)) {
+    if (slot.slotBase() == structureID->prototypeForLookup(callFrame)) {
         ASSERT(slot.slotBase()->isObject());
 
         JSObject* slotBaseObject = static_cast<JSObject*>(slot.slotBase());
@@ -4193,14 +4160,14 @@ NEVER_INLINE void Machine::tryCTICacheGetByID(ExecState* exec, CodeBlock* codeBl
         vPC[6] = slot.cachedOffset();
         codeBlock->refStructureIDs(vPC);
 
-        CTI::compileGetByIdProto(this, exec, codeBlock, structureID, slotBaseObject->structureID(), slot.cachedOffset(), returnAddress);
+        CTI::compileGetByIdProto(this, callFrame, codeBlock, structureID, slotBaseObject->structureID(), slot.cachedOffset(), returnAddress);
         return;
     }
 
     size_t count = 0;
     JSObject* o = static_cast<JSObject*>(baseValue);
     while (slot.slotBase() != o) {
-        JSValue* v = o->structureID()->prototypeForLookup(exec);
+        JSValue* v = o->structureID()->prototypeForLookup(callFrame);
 
         // If we didn't find slotBase in baseValue's prototype chain, then baseValue
         // must be a proxy for another object.
@@ -4225,7 +4192,7 @@ NEVER_INLINE void Machine::tryCTICacheGetByID(ExecState* exec, CodeBlock* codeBl
 
     StructureIDChain* chain = structureID->cachedPrototypeChain();
     if (!chain)
-        chain = cachePrototypeChain(exec, structureID);
+        chain = cachePrototypeChain(callFrame, structureID);
 
     ASSERT(chain);
     vPC[0] = getOpcode(op_get_by_id_chain);
@@ -4235,7 +4202,7 @@ NEVER_INLINE void Machine::tryCTICacheGetByID(ExecState* exec, CodeBlock* codeBl
     vPC[7] = slot.cachedOffset();
     codeBlock->refStructureIDs(vPC);
 
-    CTI::compileGetByIdChain(this, exec, codeBlock, structureID, chain, count, slot.cachedOffset(), returnAddress);
+    CTI::compileGetByIdChain(this, callFrame, codeBlock, structureID, chain, count, slot.cachedOffset(), returnAddress);
 }
 
 #define VM_THROW_EXCEPTION() \
@@ -4290,17 +4257,16 @@ NEVER_INLINE void Machine::tryCTICacheGetByID(ExecState* exec, CodeBlock* codeBl
 JSValue* Machine::cti_op_convert_this(CTI_ARGS)
 {
     JSValue* v1 = ARG_src1;
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
 
-    JSObject* result = v1->toThisObject(exec);
+    JSObject* result = v1->toThisObject(callFrame);
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
 
 void Machine::cti_op_end(CTI_ARGS)
 {
-    Register* r = ARG_r;
-    ScopeChainNode* scopeChain = Machine::scopeChain(r);
+    ScopeChainNode* scopeChain = ARG_callFrame->scopeChain();
     ASSERT(scopeChain->refCount > 1);
     scopeChain->deref();
 }
@@ -4317,13 +4283,13 @@ JSValue* Machine::cti_op_add(CTI_ARGS)
     if (rightIsNumber && fastIsNumber(v1, left))
         return jsNumber(ARG_globalData, left + right);
     
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
 
     bool leftIsString = v1->isString();
     if (leftIsString && v2->isString()) {
         RefPtr<UString::Rep> value = concatenate(static_cast<JSString*>(v1)->value().rep(), static_cast<JSString*>(v2)->value().rep());
         if (UNLIKELY(!value)) {
-            throwOutOfMemoryError(exec);
+            throwOutOfMemoryError(callFrame);
             VM_THROW_EXCEPTION();
         }
 
@@ -4336,14 +4302,14 @@ JSValue* Machine::cti_op_add(CTI_ARGS)
             concatenate(static_cast<JSString*>(v1)->value().rep(), right);
 
         if (UNLIKELY(!value)) {
-            throwOutOfMemoryError(exec);
+            throwOutOfMemoryError(callFrame);
             VM_THROW_EXCEPTION();
         }
         return jsString(ARG_globalData, value.release());
     }
 
     // All other cases are pretty uncommon
-    JSValue* result = jsAddSlowCase(exec, v1, v2);
+    JSValue* result = jsAddSlowCase(callFrame, v1, v2);
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
@@ -4352,15 +4318,15 @@ JSValue* Machine::cti_op_pre_inc(CTI_ARGS)
 {
     JSValue* v = ARG_src1;
 
-    ExecState* exec = ARG_exec;
-    JSValue* result = jsNumber(ARG_globalData, v->toNumber(exec) + 1);
+    CallFrame* callFrame = ARG_callFrame;
+    JSValue* result = jsNumber(ARG_globalData, v->toNumber(callFrame) + 1);
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
 
 void Machine::cti_timeout_check(CTI_ARGS)
 {
-    if (ARG_globalData->machine->checkTimeout(ARG_exec->dynamicGlobalObject())) {
+    if (ARG_globalData->machine->checkTimeout(ARG_callFrame->dynamicGlobalObject())) {
         ARG_globalData->exception = createInterruptedExecutionException(ARG_globalData);
         VM_THROW_EXCEPTION_AT_END();
     }
@@ -4370,9 +4336,9 @@ int Machine::cti_op_loop_if_less(CTI_ARGS)
 {
     JSValue* src1 = ARG_src1;
     JSValue* src2 = ARG_src2;
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
 
-    bool result = jsLess(exec, src1, src2);
+    bool result = jsLess(callFrame, src1, src2);
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
@@ -4381,25 +4347,25 @@ int Machine::cti_op_loop_if_lesseq(CTI_ARGS)
 {
     JSValue* src1 = ARG_src1;
     JSValue* src2 = ARG_src2;
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
 
-    bool result = jsLessEq(exec, src1, src2);
+    bool result = jsLessEq(callFrame, src1, src2);
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
 
 JSValue* Machine::cti_op_new_object(CTI_ARGS)
 {
-    return constructEmptyObject(ARG_exec);;
+    return constructEmptyObject(ARG_callFrame);;
 }
 
 void Machine::cti_op_put_by_id(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
     Identifier& ident = *ARG_id2;
 
     PutPropertySlot slot;
-    ARG_src1->put(exec, ident, ARG_src3, slot);
+    ARG_src1->put(callFrame, ident, ARG_src3, slot);
 
     ctiRepatchCallByReturnAddress(CTI_RETURN_ADDRESS, (void*)cti_op_put_by_id_second);
 
@@ -4408,37 +4374,26 @@ void Machine::cti_op_put_by_id(CTI_ARGS)
 
 void Machine::cti_op_put_by_id_second(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
-    Identifier& ident = *ARG_id2;
-
-    JSValue* baseValue = ARG_src1;
     PutPropertySlot slot;
-    baseValue->put(exec, ident, ARG_src3, slot);
-
-    Register* r = ARG_r;
-    ARG_globalData->machine->tryCTICachePutByID(exec, codeBlock(r), CTI_RETURN_ADDRESS, baseValue, slot);
-
+    ARG_src1->put(ARG_callFrame, *ARG_id2, ARG_src3, slot);
+    ARG_globalData->machine->tryCTICachePutByID(ARG_callFrame, ARG_callFrame->codeBlock(), CTI_RETURN_ADDRESS, ARG_src1, slot);
     VM_CHECK_EXCEPTION_AT_END();
 }
 
 void Machine::cti_op_put_by_id_generic(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
-    Identifier& ident = *ARG_id2;
-
     PutPropertySlot slot;
-    ARG_src1->put(exec, ident, ARG_src3, slot);
-
+    ARG_src1->put(ARG_callFrame, *ARG_id2, ARG_src3, slot);
     VM_CHECK_EXCEPTION_AT_END();
 }
 
 void Machine::cti_op_put_by_id_fail(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
     Identifier& ident = *ARG_id2;
 
     PutPropertySlot slot;
-    ARG_src1->put(exec, ident, ARG_src3, slot);
+    ARG_src1->put(callFrame, ident, ARG_src3, slot);
 
     // should probably uncachePutByID() ... this would mean doing a vPC lookup - might be worth just bleeding this until the end.
     ctiRepatchCallByReturnAddress(CTI_RETURN_ADDRESS, (void*)cti_op_put_by_id_generic);
@@ -4448,12 +4403,12 @@ void Machine::cti_op_put_by_id_fail(CTI_ARGS)
 
 JSValue* Machine::cti_op_get_by_id(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
     Identifier& ident = *ARG_id2;
 
     JSValue* baseValue = ARG_src1;
     PropertySlot slot(baseValue);
-    JSValue* result = baseValue->get(exec, ident, slot);
+    JSValue* result = baseValue->get(callFrame, ident, slot);
 
     ctiRepatchCallByReturnAddress(CTI_RETURN_ADDRESS, (void*)cti_op_get_by_id_second);
 
@@ -4463,15 +4418,14 @@ JSValue* Machine::cti_op_get_by_id(CTI_ARGS)
 
 JSValue* Machine::cti_op_get_by_id_second(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
     Identifier& ident = *ARG_id2;
 
     JSValue* baseValue = ARG_src1;
     PropertySlot slot(baseValue);
-    JSValue* result = baseValue->get(exec, ident, slot);
+    JSValue* result = baseValue->get(callFrame, ident, slot);
 
-    Register* r = ARG_r;
-    ARG_globalData->machine->tryCTICacheGetByID(exec, codeBlock(r), CTI_RETURN_ADDRESS, baseValue, ident, slot);
+    ARG_globalData->machine->tryCTICacheGetByID(callFrame, callFrame->codeBlock(), CTI_RETURN_ADDRESS, baseValue, ident, slot);
 
     VM_CHECK_EXCEPTION_AT_END();
     return result;
@@ -4479,12 +4433,12 @@ JSValue* Machine::cti_op_get_by_id_second(CTI_ARGS)
 
 JSValue* Machine::cti_op_get_by_id_generic(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
     Identifier& ident = *ARG_id2;
 
     JSValue* baseValue = ARG_src1;
     PropertySlot slot(baseValue);
-    JSValue* result = baseValue->get(exec, ident, slot);
+    JSValue* result = baseValue->get(callFrame, ident, slot);
 
     VM_CHECK_EXCEPTION_AT_END();
     return result;
@@ -4492,12 +4446,12 @@ JSValue* Machine::cti_op_get_by_id_generic(CTI_ARGS)
 
 JSValue* Machine::cti_op_get_by_id_fail(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
     Identifier& ident = *ARG_id2;
 
     JSValue* baseValue = ARG_src1;
     PropertySlot slot(baseValue);
-    JSValue* result = baseValue->get(exec, ident, slot);
+    JSValue* result = baseValue->get(callFrame, ident, slot);
 
     // should probably uncacheGetByID() ... this would mean doing a vPC lookup - might be worth just bleeding this until the end.
     ctiRepatchCallByReturnAddress(CTI_RETURN_ADDRESS, (void*)cti_op_get_by_id_generic);
@@ -4508,7 +4462,7 @@ JSValue* Machine::cti_op_get_by_id_fail(CTI_ARGS)
 
 JSValue* Machine::cti_op_instanceof(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
     JSValue* value = ARG_src1;
     JSValue* baseVal = ARG_src2;
     JSValue* proto = ARG_src3;
@@ -4522,11 +4476,11 @@ JSValue* Machine::cti_op_instanceof(CTI_ARGS)
            || (baseCell->structureID()->typeInfo().flags() & (ImplementsHasInstance | OverridesHasInstance)) != ImplementsHasInstance);
 
     if (!baseVal->isObject()) {
-        Register* r = ARG_r;
-        CodeBlock* codeBlock = Machine::codeBlock(r);
+        CallFrame* callFrame = ARG_callFrame;
+        CodeBlock* codeBlock = callFrame->codeBlock();
         ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
         unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
-        ARG_globalData->exception = createInvalidParamError(exec, "instanceof", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock);
+        ARG_globalData->exception = createInvalidParamError(callFrame, "instanceof", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock);
         VM_THROW_EXCEPTION();
     }
 
@@ -4534,14 +4488,14 @@ JSValue* Machine::cti_op_instanceof(CTI_ARGS)
         return jsBoolean(false);
 
     if (!proto->isObject()) {
-        throwError(exec, TypeError, "instanceof called on an object with an invalid prototype property.");
+        throwError(callFrame, TypeError, "instanceof called on an object with an invalid prototype property.");
         VM_THROW_EXCEPTION();
     }
         
     if (!value->isObject())
         return jsBoolean(false);
 
-    JSValue* result = jsBoolean(static_cast<JSObject*>(baseCell)->hasInstance(exec, valueCell, protoCell));
+    JSValue* result = jsBoolean(static_cast<JSObject*>(baseCell)->hasInstance(callFrame, valueCell, protoCell));
     VM_CHECK_EXCEPTION_AT_END();
 
     return result;
@@ -4549,12 +4503,12 @@ JSValue* Machine::cti_op_instanceof(CTI_ARGS)
 
 JSValue* Machine::cti_op_del_by_id(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
     Identifier& ident = *ARG_id2;
     
-    JSObject* baseObj = ARG_src1->toObject(exec);
+    JSObject* baseObj = ARG_src1->toObject(callFrame);
 
-    JSValue* result = jsBoolean(baseObj->deleteProperty(exec, ident));
+    JSValue* result = jsBoolean(baseObj->deleteProperty(callFrame, ident));
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
@@ -4569,15 +4523,15 @@ JSValue* Machine::cti_op_mul(CTI_ARGS)
     if (fastIsNumber(src1, left) && fastIsNumber(src2, right))
         return jsNumber(ARG_globalData, left * right);
 
-    ExecState* exec = ARG_exec;
-    JSValue* result = jsNumber(ARG_globalData, src1->toNumber(exec) * src2->toNumber(exec));
+    CallFrame* callFrame = ARG_callFrame;
+    JSValue* result = jsNumber(ARG_globalData, src1->toNumber(callFrame) * src2->toNumber(callFrame));
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
 
 JSValue* Machine::cti_op_new_func(CTI_ARGS)
 {
-    return ARG_func1->makeFunction(ARG_exec, Machine::scopeChain(ARG_r));
+    return ARG_func1->makeFunction(ARG_callFrame, ARG_callFrame->scopeChain());
 }
 
 VoidPtrPair Machine::cti_op_call_JSFunction(CTI_ARGS)
@@ -4588,41 +4542,33 @@ VoidPtrPair Machine::cti_op_call_JSFunction(CTI_ARGS)
 #endif
 
     if (UNLIKELY(*ARG_profilerReference != 0))
-        (*ARG_profilerReference)->willExecute(CallFrame::create(ARG_r), static_cast<JSObject*>(ARG_src1));
+        (*ARG_profilerReference)->willExecute(ARG_callFrame, static_cast<JSFunction*>(ARG_src1));
 
     ScopeChainNode* callDataScopeChain = static_cast<JSFunction*>(ARG_src1)->m_scopeChain.node();
     CodeBlock* newCodeBlock = &static_cast<JSFunction*>(ARG_src1)->m_body->byteCode(callDataScopeChain);
 
-    Register* r = slideRegisterWindowForCall(newCodeBlock, ARG_registerFile, ARG_r, ARG_int2, ARG_int3);
-    if (UNLIKELY(!r)) {
-        ARG_globalData->exception = createStackOverflowError(CallFrame::create(ARG_r));
+    CallFrame* callFrame = slideRegisterWindowForCall(newCodeBlock, ARG_registerFile, ARG_callFrame, ARG_int2, ARG_int3);
+    if (UNLIKELY(!callFrame)) {
+        ARG_globalData->exception = createStackOverflowError(ARG_callFrame);
         VM_THROW_EXCEPTION_2();
     }
 
-    VoidPtrPair pair = { newCodeBlock, r };
+    VoidPtrPair pair = { newCodeBlock, callFrame };
     return pair;
 }
 
 void* Machine::cti_vm_compile(CTI_ARGS)
 {
-    Register* r = ARG_r;
-    CodeBlock* codeBlock = Machine::codeBlock(r);
-
+    CodeBlock* codeBlock = ARG_callFrame->codeBlock();
     if (!codeBlock->ctiCode)
-        CTI::compile(ARG_globalData->machine, CallFrame::create(r), codeBlock);
-
+        CTI::compile(ARG_globalData->machine, ARG_callFrame, codeBlock);
     return codeBlock->ctiCode;
 }
 
 JSValue* Machine::cti_op_push_activation(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
-    Register* r = ARG_r;
-    CodeBlock* codeBlock = Machine::codeBlock(r);
-    ScopeChainNode* scopeChain = Machine::scopeChain(r);
-
-    JSActivation* activation = new (ARG_globalData) JSActivation(exec, static_cast<FunctionBodyNode*>(codeBlock->ownerNode), r);
-    r[RegisterFile::ScopeChain] = scopeChain->copy()->push(activation);
+    JSActivation* activation = new (ARG_globalData) JSActivation(ARG_callFrame, static_cast<FunctionBodyNode*>(ARG_callFrame->codeBlock()->ownerNode));
+    ARG_callFrame->setScopeChain(ARG_callFrame->scopeChain()->copy()->push(activation));
     return activation;
 }
 
@@ -4638,97 +4584,78 @@ JSValue* Machine::cti_op_call_NotJSFunction(CTI_ARGS)
     if (callType == CallTypeHost) {
         int registerOffset = ARG_int2;
         int argCount = ARG_int3;
-        Register* savedR = ARG_r;
-        Register* r = savedR + registerOffset;
+        CallFrame* previousCallFrame = ARG_callFrame;
+        CallFrame* callFrame = CallFrame::create(previousCallFrame->registers() + registerOffset);
 
-        initializeCallFrame(r, 0, ARG_instr4 + 1, scopeChain(savedR), savedR, 0, argCount, funcVal);
-        ARG_setR(r);
+        callFrame->init(0, ARG_instr4 + 1, previousCallFrame->scopeChain(), previousCallFrame, 0, argCount, static_cast<JSFunction*>(funcVal));
+        ARG_setCallFrame(callFrame);
 
         if (*ARG_profilerReference)
-            (*ARG_profilerReference)->willExecute(CallFrame::create(r), static_cast<JSObject*>(funcVal));
+            (*ARG_profilerReference)->willExecute(callFrame, static_cast<JSFunction*>(funcVal));
 
-        Register* argv = r - RegisterFile::CallFrameHeaderSize - argCount;
+        Register* argv = ARG_callFrame->registers() - RegisterFile::CallFrameHeaderSize - argCount;
         ArgList argList(argv + 1, argCount - 1);
 
         CTI_MACHINE_SAMPLING_callingHostFunction();
 
-        JSValue* returnValue = callData.native.function(CallFrame::create(r), static_cast<JSObject*>(funcVal), argv[0].jsValue(CallFrame::create(r)), argList);
-        ARG_setR(savedR);
+        JSValue* returnValue = callData.native.function(callFrame, static_cast<JSFunction*>(funcVal), argv[0].jsValue(callFrame), argList);
+        ARG_setCallFrame(previousCallFrame);
         VM_CHECK_EXCEPTION();
 
         if (*ARG_profilerReference)
-            (*ARG_profilerReference)->didExecute(CallFrame::create(savedR), static_cast<JSObject*>(funcVal));
+            (*ARG_profilerReference)->didExecute(previousCallFrame, static_cast<JSFunction*>(funcVal));
 
         return returnValue;
     }
 
     ASSERT(callType == CallTypeNone);
 
-    ARG_globalData->exception = createNotAFunctionError(CallFrame::create(ARG_r), funcVal, ARG_instr4, codeBlock(ARG_r));
+    ARG_globalData->exception = createNotAFunctionError(ARG_callFrame, funcVal, ARG_instr4, ARG_callFrame->codeBlock());
     VM_THROW_EXCEPTION();
 }
 
 void Machine::cti_op_create_arguments(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
-    Register* r = ARG_r;
-
-    Arguments* arguments = new (ARG_globalData) Arguments(exec, r);
-    r[RegisterFile::OptionalCalleeArguments] = arguments;
-    r[RegisterFile::ArgumentsRegister] = arguments;
+    Arguments* arguments = new (ARG_globalData) Arguments(ARG_callFrame);
+    ARG_callFrame->setCalleeArguments(arguments);
+    ARG_callFrame[RegisterFile::ArgumentsRegister] = arguments;
 }
 
 void Machine::cti_op_tear_off_activation(CTI_ARGS)
 {
-    Register* r = ARG_r;
-
-    JSActivation* activation = static_cast<JSActivation*>(ARG_src1);
-    ASSERT(codeBlock(r)->needsFullScopeChain);
-    ASSERT(activation->isObject(&JSActivation::info));
-
-    Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue());
-    ASSERT(!arguments || arguments->isObject(&Arguments::info));
-    activation->copyRegisters(arguments);
+    ASSERT(ARG_callFrame->codeBlock()->needsFullScopeChain);
+    ASSERT(ARG_src1->isObject(&JSActivation::info));
+    static_cast<JSActivation*>(ARG_src1)->copyRegisters(ARG_callFrame->optionalCalleeArguments());
 }
 
 void Machine::cti_op_tear_off_arguments(CTI_ARGS)
 {
-    Register* r = ARG_r;
-
-    Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue());
-    ASSERT(codeBlock(r)->usesArguments && !codeBlock(r)->needsFullScopeChain);
-    ASSERT(arguments->isObject(&Arguments::info));
-
-    arguments->copyRegisters();
+    ASSERT(ARG_callFrame->codeBlock()->usesArguments && !ARG_callFrame->codeBlock()->needsFullScopeChain);
+    ARG_callFrame->optionalCalleeArguments()->copyRegisters();
 }
 
 void Machine::cti_op_ret_profiler(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
-
-    Register* r = ARG_r;
     ASSERT(*ARG_profilerReference);
-    (*ARG_profilerReference)->didExecute(exec, static_cast<JSObject*>(r[RegisterFile::Callee].jsValue(exec)));
+    (*ARG_profilerReference)->didExecute(ARG_callFrame, ARG_callFrame->callee());
 }
 
 void Machine::cti_op_ret_scopeChain(CTI_ARGS)
 {
-    Register* r = ARG_r;
-    ASSERT(codeBlock(r)->needsFullScopeChain);
-    scopeChain(r)->deref();
+    ASSERT(ARG_callFrame->codeBlock()->needsFullScopeChain);
+    ARG_callFrame->scopeChain()->deref();
 }
 
 JSValue* Machine::cti_op_new_array(CTI_ARGS)
 {
-    ArgList argsList(ARG_registers1, ARG_int2);
-    return constructArray(ARG_exec, argsList);
+    ArgList argList(ARG_registers1, ARG_int2);
+    return constructArray(ARG_callFrame, argList);
 }
 
 JSValue* Machine::cti_op_resolve(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
-    Register* r = ARG_r;
-    ScopeChainNode* scopeChain = Machine::scopeChain(r);
+    CallFrame* callFrame = ARG_callFrame;
+    ScopeChainNode* scopeChain = callFrame->scopeChain();
 
     ScopeChainIterator iter = scopeChain->begin();
     ScopeChainIterator end = scopeChain->end();
@@ -4738,24 +4665,24 @@ JSValue* Machine::cti_op_resolve(CTI_ARGS)
     do {
         JSObject* o = *iter;
         PropertySlot slot(o);
-        if (o->getPropertySlot(exec, ident, slot)) {
-            JSValue* result = slot.getValue(exec, ident);
+        if (o->getPropertySlot(callFrame, ident, slot)) {
+            JSValue* result = slot.getValue(callFrame, ident);
             VM_CHECK_EXCEPTION_AT_END();
             return result;
         }
     } while (++iter != end);
 
-    CodeBlock* codeBlock = Machine::codeBlock(r);
+    CodeBlock* codeBlock = callFrame->codeBlock();
     ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
     unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
-    exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));
+    ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock);
     VM_THROW_EXCEPTION();
 }
 
 VoidPtrPair Machine::cti_op_construct_JSConstruct(CTI_ARGS)
 {
     RegisterFile* registerFile = ARG_registerFile;
-    Register* r = ARG_r;
+    CallFrame* callFrame = ARG_callFrame;
 
     JSFunction* constructor = static_cast<JSFunction*>(ARG_src1);
     JSValue* constrProtoVal = ARG_src2;
@@ -4769,7 +4696,7 @@ VoidPtrPair Machine::cti_op_construct_JSConstruct(CTI_ARGS)
 #endif
 
     if (*ARG_profilerReference)
-        (*ARG_profilerReference)->willExecute(CallFrame::create(r), constructor);
+        (*ARG_profilerReference)->willExecute(callFrame, constructor);
 
     ScopeChainNode* callDataScopeChain = constructor->m_scopeChain.node();
     FunctionBodyNode* functionBodyNode = constructor->m_body.get();
@@ -4782,22 +4709,21 @@ VoidPtrPair Machine::cti_op_construct_JSConstruct(CTI_ARGS)
         structure = callDataScopeChain->globalObject()->emptyObjectStructure();
     JSObject* newObject = new (ARG_globalData) JSObject(structure);
 
-    r[firstArg] = newObject; // "this" value
+    callFrame[firstArg] = newObject; // "this" value
 
-    r = slideRegisterWindowForCall(newCodeBlock, registerFile, r, registerOffset, argCount);
-    if (UNLIKELY(!r)) {
-        ARG_globalData->exception = createStackOverflowError(CallFrame::create(ARG_r));
+    callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount);
+    if (UNLIKELY(!callFrame)) {
+        ARG_globalData->exception = createStackOverflowError(ARG_callFrame);
         VM_THROW_EXCEPTION_2();
     }
 
-    VoidPtrPair pair = { newCodeBlock, r };
+    VoidPtrPair pair = { newCodeBlock, callFrame };
     return pair;
 }
 
 JSValue* Machine::cti_op_construct_NotJSConstruct(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
-    Register* r = ARG_r;
+    CallFrame* callFrame = ARG_callFrame;
 
     JSValue* constrVal = ARG_src1;
     int firstArg = ARG_int3;
@@ -4810,30 +4736,30 @@ JSValue* Machine::cti_op_construct_NotJSConstruct(CTI_ARGS)
 
     if (constructType == ConstructTypeHost) {
         if (*ARG_profilerReference)
-            (*ARG_profilerReference)->willExecute(exec, constructor);
+            (*ARG_profilerReference)->willExecute(callFrame, constructor);
 
-        ArgList argList(r + firstArg + 1, argCount - 1);
+        ArgList argList(callFrame->registers() + firstArg + 1, argCount - 1);
 
         CTI_MACHINE_SAMPLING_callingHostFunction();
 
-        JSValue* returnValue = constructData.native.function(exec, constructor, argList);
+        JSValue* returnValue = constructData.native.function(callFrame, constructor, argList);
         VM_CHECK_EXCEPTION();
 
         if (*ARG_profilerReference)
-            (*ARG_profilerReference)->didExecute(exec, constructor);
+            (*ARG_profilerReference)->didExecute(callFrame, constructor);
 
         return returnValue;
     }
 
     ASSERT(constructType == ConstructTypeNone);
 
-    exec->setException(createNotAConstructorError(exec, constrVal, ARG_instr6, codeBlock(r)));
+    ARG_globalData->exception = createNotAConstructorError(callFrame, constrVal, ARG_instr6, callFrame->codeBlock());
     VM_THROW_EXCEPTION();
 }
 
 JSValue* Machine::cti_op_get_by_val(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
     Machine* machine = ARG_globalData->machine;
 
     JSValue* baseValue = ARG_src1;
@@ -4849,14 +4775,14 @@ JSValue* Machine::cti_op_get_by_val(CTI_ARGS)
             if (jsArray->canGetIndex(i))
                 result = jsArray->getIndex(i);
             else
-                result = jsArray->JSArray::get(exec, i);
+                result = jsArray->JSArray::get(callFrame, i);
         } else if (machine->isJSString(baseValue) && static_cast<JSString*>(baseValue)->canGetIndex(i))
             result = static_cast<JSString*>(baseValue)->getIndex(ARG_globalData, i);
         else
-            result = baseValue->get(exec, i);
+            result = baseValue->get(callFrame, i);
     } else {
-        Identifier property(exec, subscript->toString(exec));
-        result = baseValue->get(exec, property);
+        Identifier property(callFrame, subscript->toString(callFrame));
+        result = baseValue->get(callFrame, property);
     }
 
     VM_CHECK_EXCEPTION_AT_END();
@@ -4865,9 +4791,8 @@ JSValue* Machine::cti_op_get_by_val(CTI_ARGS)
 
 VoidPtrPair Machine::cti_op_resolve_func(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
-    Register* r = ARG_r;
-    ScopeChainNode* scopeChain = Machine::scopeChain(r);
+    CallFrame* callFrame = ARG_callFrame;
+    ScopeChainNode* scopeChain = callFrame->scopeChain();
 
     ScopeChainIterator iter = scopeChain->begin();
     ScopeChainIterator end = scopeChain->end();
@@ -4881,7 +4806,7 @@ VoidPtrPair Machine::cti_op_resolve_func(CTI_ARGS)
     do {
         base = *iter;
         PropertySlot slot(base);
-        if (base->getPropertySlot(exec, ident, slot)) {            
+        if (base->getPropertySlot(callFrame, ident, slot)) {            
             // ECMA 11.2.3 says that if we hit an activation the this value should be null.
             // However, section 10.2.3 says that in the case where the value provided
             // by the caller is null, the global object should be used. It also says
@@ -4889,8 +4814,8 @@ VoidPtrPair Machine::cti_op_resolve_func(CTI_ARGS)
             // of implementation we use the global object anyway here. This guarantees
             // that in host objects you always get a valid object for this.
             // We also handle wrapper substitution for the global object at the same time.
-            JSObject* thisObj = base->toThisObject(exec);
-            JSValue* result = slot.getValue(exec, ident);
+            JSObject* thisObj = base->toThisObject(callFrame);
+            JSValue* result = slot.getValue(callFrame, ident);
             VM_CHECK_EXCEPTION_AT_END();
 
             VoidPtrPair pair = { thisObj, result };
@@ -4899,10 +4824,10 @@ VoidPtrPair Machine::cti_op_resolve_func(CTI_ARGS)
         ++iter;
     } while (iter != end);
 
-    CodeBlock* codeBlock = Machine::codeBlock(r);
+    CodeBlock* codeBlock = callFrame->codeBlock();
     ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
     unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
-    exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));
+    ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock);
     VM_THROW_EXCEPTION_2();
 }
 
@@ -4916,15 +4841,15 @@ JSValue* Machine::cti_op_sub(CTI_ARGS)
     if (fastIsNumber(src1, left) && fastIsNumber(src2, right))
         return jsNumber(ARG_globalData, left - right);
 
-    ExecState* exec = ARG_exec;
-    JSValue* result = jsNumber(ARG_globalData, src1->toNumber(exec) - src2->toNumber(exec));
+    CallFrame* callFrame = ARG_callFrame;
+    JSValue* result = jsNumber(ARG_globalData, src1->toNumber(callFrame) - src2->toNumber(callFrame));
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
 
 void Machine::cti_op_put_by_val(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
     Machine* machine = ARG_globalData->machine;
 
     JSValue* baseValue = ARG_src1;
@@ -4940,14 +4865,14 @@ void Machine::cti_op_put_by_val(CTI_ARGS)
             if (jsArray->canSetIndex(i))
                 jsArray->setIndex(i, value);
             else
-                jsArray->JSArray::put(exec, i, value);
+                jsArray->JSArray::put(callFrame, i, value);
         } else
-            baseValue->put(exec, i, value);
+            baseValue->put(callFrame, i, value);
     } else {
-        Identifier property(exec, subscript->toString(exec));
+        Identifier property(callFrame, subscript->toString(callFrame));
         if (!ARG_globalData->exception) { // Don't put to an object if toString threw an exception.
             PutPropertySlot slot;
-            baseValue->put(exec, property, value, slot);
+            baseValue->put(callFrame, property, value, slot);
         }
     }
 
@@ -4956,7 +4881,7 @@ void Machine::cti_op_put_by_val(CTI_ARGS)
 
 void Machine::cti_op_put_by_val_array(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
 
     JSValue* baseValue = ARG_src1;
     int i = ARG_int2;
@@ -4965,13 +4890,13 @@ void Machine::cti_op_put_by_val_array(CTI_ARGS)
     ASSERT(ARG_globalData->machine->isJSArray(baseValue));
 
     if (LIKELY(i >= 0))
-        static_cast<JSArray*>(baseValue)->JSArray::put(exec, i, value);
+        static_cast<JSArray*>(baseValue)->JSArray::put(callFrame, i, value);
     else {
-        Identifier property(exec, JSImmediate::from(i)->toString(exec));
+        Identifier property(callFrame, JSImmediate::from(i)->toString(callFrame));
         // FIXME: can toString throw an exception here?
         if (!ARG_globalData->exception) { // Don't put to an object if toString threw an exception.
             PutPropertySlot slot;
-            baseValue->put(exec, property, value, slot);
+            baseValue->put(callFrame, property, value, slot);
         }
     }
 
@@ -4980,8 +4905,8 @@ void Machine::cti_op_put_by_val_array(CTI_ARGS)
 
 JSValue* Machine::cti_op_lesseq(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
-    JSValue* result = jsBoolean(jsLessEq(exec, ARG_src1, ARG_src2));
+    CallFrame* callFrame = ARG_callFrame;
+    JSValue* result = jsBoolean(jsLessEq(callFrame, ARG_src1, ARG_src2));
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
@@ -4990,9 +4915,9 @@ int Machine::cti_op_loop_if_true(CTI_ARGS)
 {
     JSValue* src1 = ARG_src1;
 
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
 
-    bool result = src1->toBoolean(exec);
+    bool result = src1->toBoolean(callFrame);
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
@@ -5005,22 +4930,21 @@ JSValue* Machine::cti_op_negate(CTI_ARGS)
     if (fastIsNumber(src, v))
         return jsNumber(ARG_globalData, -v);
 
-    ExecState* exec = ARG_exec;
-    JSValue* result = jsNumber(ARG_globalData, -src->toNumber(exec));
+    CallFrame* callFrame = ARG_callFrame;
+    JSValue* result = jsNumber(ARG_globalData, -src->toNumber(callFrame));
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
 
 JSValue* Machine::cti_op_resolve_base(CTI_ARGS)
 {
-    return inlineResolveBase(ARG_exec, *ARG_id1, scopeChain(ARG_r));
+    return inlineResolveBase(ARG_callFrame, *ARG_id1, ARG_callFrame->scopeChain());
 }
 
 JSValue* Machine::cti_op_resolve_skip(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
-    Register* r = ARG_r;
-    ScopeChainNode* scopeChain = Machine::scopeChain(r);
+    CallFrame* callFrame = ARG_callFrame;
+    ScopeChainNode* scopeChain = callFrame->scopeChain();
 
     int skip = ARG_int2;
 
@@ -5035,31 +4959,31 @@ JSValue* Machine::cti_op_resolve_skip(CTI_ARGS)
     do {
         JSObject* o = *iter;
         PropertySlot slot(o);
-        if (o->getPropertySlot(exec, ident, slot)) {
-            JSValue* result = slot.getValue(exec, ident);
+        if (o->getPropertySlot(callFrame, ident, slot)) {
+            JSValue* result = slot.getValue(callFrame, ident);
             VM_CHECK_EXCEPTION_AT_END();
             return result;
         }
     } while (++iter != end);
 
-    CodeBlock* codeBlock = Machine::codeBlock(r);
+    CodeBlock* codeBlock = callFrame->codeBlock();
     ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
     unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
-    exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));
+    ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock);
     VM_THROW_EXCEPTION();
 }
 
 JSValue* Machine::cti_op_resolve_global(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
     JSGlobalObject* globalObject = static_cast<JSGlobalObject*>(ARG_src1);
     Identifier& ident = *ARG_id2;
     Instruction* vPC = ARG_instr3;
     ASSERT(globalObject->isGlobalObject());
 
     PropertySlot slot(globalObject);
-    if (globalObject->getPropertySlot(exec, ident, slot)) {
-        JSValue* result = slot.getValue(exec, ident);
+    if (globalObject->getPropertySlot(callFrame, ident, slot)) {
+        JSValue* result = slot.getValue(callFrame, ident);
         if (slot.isCacheable()) {
             if (vPC[4].u.structureID)
                 vPC[4].u.structureID->deref();
@@ -5073,8 +4997,7 @@ JSValue* Machine::cti_op_resolve_global(CTI_ARGS)
         return result;
     }
     
-    Register* r = ARG_r;
-    exec->setException(createUndefinedVariableError(exec, ident, vPC, codeBlock(r)));    
+    ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, vPC, callFrame->codeBlock());
     VM_THROW_EXCEPTION();
 }
 
@@ -5088,8 +5011,8 @@ JSValue* Machine::cti_op_div(CTI_ARGS)
     if (fastIsNumber(src1, left) && fastIsNumber(src2, right))
         return jsNumber(ARG_globalData, left / right);
 
-    ExecState* exec = ARG_exec;
-    JSValue* result = jsNumber(ARG_globalData, src1->toNumber(exec) / src2->toNumber(exec));
+    CallFrame* callFrame = ARG_callFrame;
+    JSValue* result = jsNumber(ARG_globalData, src1->toNumber(callFrame) / src2->toNumber(callFrame));
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
@@ -5098,8 +5021,8 @@ JSValue* Machine::cti_op_pre_dec(CTI_ARGS)
 {
     JSValue* v = ARG_src1;
 
-    ExecState* exec = ARG_exec;
-    JSValue* result = jsNumber(ARG_globalData, v->toNumber(exec) - 1);
+    CallFrame* callFrame = ARG_callFrame;
+    JSValue* result = jsNumber(ARG_globalData, v->toNumber(callFrame) - 1);
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
@@ -5108,9 +5031,9 @@ int Machine::cti_op_jless(CTI_ARGS)
 {
     JSValue* src1 = ARG_src1;
     JSValue* src2 = ARG_src2;
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
 
-    bool result = jsLess(exec, src1, src2);
+    bool result = jsLess(callFrame, src1, src2);
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
@@ -5119,9 +5042,9 @@ JSValue* Machine::cti_op_not(CTI_ARGS)
 {
     JSValue* src = ARG_src1;
 
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
 
-    JSValue* result = jsBoolean(!src->toBoolean(exec));
+    JSValue* result = jsBoolean(!src->toBoolean(callFrame));
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
@@ -5130,9 +5053,9 @@ int SFX_CALL Machine::cti_op_jtrue(CTI_ARGS)
 {
     JSValue* src1 = ARG_src1;
 
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
 
-    bool result = src1->toBoolean(exec);
+    bool result = src1->toBoolean(callFrame);
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
@@ -5141,9 +5064,9 @@ VoidPtrPair Machine::cti_op_post_inc(CTI_ARGS)
 {
     JSValue* v = ARG_src1;
 
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
 
-    JSValue* number = v->toJSNumber(exec);
+    JSValue* number = v->toJSNumber(callFrame);
     VM_CHECK_EXCEPTION_2();
 
     VoidPtrPair pair = { number, jsNumber(ARG_globalData, number->uncheckedGetNumber() + 1) };
@@ -5155,10 +5078,10 @@ JSValue* Machine::cti_op_eq(CTI_ARGS)
     JSValue* src1 = ARG_src1;
     JSValue* src2 = ARG_src2;
 
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
 
     ASSERT(!JSImmediate::areBothImmediateNumbers(src1, src2));
-    JSValue* result = jsBoolean(equalSlowCaseInline(exec, src1, src2));
+    JSValue* result = jsBoolean(equalSlowCaseInline(callFrame, src1, src2));
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
@@ -5175,8 +5098,8 @@ JSValue* Machine::cti_op_lshift(CTI_ARGS)
     if (fastToInt32(val, left) && fastToUInt32(shift, right))
         return jsNumber(ARG_globalData, left << (right & 0x1f));
 
-    ExecState* exec = ARG_exec;
-    JSValue* result = jsNumber(ARG_globalData, (val->toInt32(exec)) << (shift->toUInt32(exec) & 0x1f));
+    CallFrame* callFrame = ARG_callFrame;
+    JSValue* result = jsNumber(ARG_globalData, (val->toInt32(callFrame)) << (shift->toUInt32(callFrame) & 0x1f));
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
@@ -5191,8 +5114,8 @@ JSValue* Machine::cti_op_bitand(CTI_ARGS)
     if (fastToInt32(src1, left) && fastToInt32(src2, right))
         return jsNumber(ARG_globalData, left & right);
 
-    ExecState* exec = ARG_exec;
-    JSValue* result = jsNumber(ARG_globalData, src1->toInt32(exec) & src2->toInt32(exec));
+    CallFrame* callFrame = ARG_callFrame;
+    JSValue* result = jsNumber(ARG_globalData, src1->toInt32(callFrame) & src2->toInt32(callFrame));
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
@@ -5209,8 +5132,8 @@ JSValue* Machine::cti_op_rshift(CTI_ARGS)
     if (fastToInt32(val, left) && fastToUInt32(shift, right))
         return jsNumber(ARG_globalData, left >> (right & 0x1f));
 
-    ExecState* exec = ARG_exec;
-    JSValue* result = jsNumber(ARG_globalData, (val->toInt32(exec)) >> (shift->toUInt32(exec) & 0x1f));
+    CallFrame* callFrame = ARG_callFrame;
+    JSValue* result = jsNumber(ARG_globalData, (val->toInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
@@ -5223,17 +5146,16 @@ JSValue* Machine::cti_op_bitnot(CTI_ARGS)
     if (fastToInt32(src, value))
         return jsNumber(ARG_globalData, ~value);
             
-    ExecState* exec = ARG_exec;
-    JSValue* result = jsNumber(ARG_globalData, ~src->toInt32(exec));
+    CallFrame* callFrame = ARG_callFrame;
+    JSValue* result = jsNumber(ARG_globalData, ~src->toInt32(callFrame));
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
 
 VoidPtrPair Machine::cti_op_resolve_with_base(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
-    Register* r = ARG_r;
-    ScopeChainNode* scopeChain = Machine::scopeChain(r);
+    CallFrame* callFrame = ARG_callFrame;
+    ScopeChainNode* scopeChain = callFrame->scopeChain();
 
     ScopeChainIterator iter = scopeChain->begin();
     ScopeChainIterator end = scopeChain->end();
@@ -5247,8 +5169,8 @@ VoidPtrPair Machine::cti_op_resolve_with_base(CTI_ARGS)
     do {
         base = *iter;
         PropertySlot slot(base);
-        if (base->getPropertySlot(exec, ident, slot)) {
-            JSValue* result = slot.getValue(exec, ident);
+        if (base->getPropertySlot(callFrame, ident, slot)) {
+            JSValue* result = slot.getValue(callFrame, ident);
             VM_CHECK_EXCEPTION_AT_END();
 
             VoidPtrPair pair = { base, result };
@@ -5257,16 +5179,16 @@ VoidPtrPair Machine::cti_op_resolve_with_base(CTI_ARGS)
         ++iter;
     } while (iter != end);
 
-    CodeBlock* codeBlock = Machine::codeBlock(r);
+    CodeBlock* codeBlock = callFrame->codeBlock();
     ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
     unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
-    exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));
+    ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock);
     VM_THROW_EXCEPTION_2();
 }
 
 JSValue* Machine::cti_op_new_func_exp(CTI_ARGS)
 {
-    return ARG_funcexp1->makeFunction(ARG_exec, scopeChain(ARG_r));
+    return ARG_funcexp1->makeFunction(ARG_callFrame, ARG_callFrame->scopeChain());
 }
 
 JSValue* Machine::cti_op_mod(CTI_ARGS)
@@ -5274,17 +5196,17 @@ JSValue* Machine::cti_op_mod(CTI_ARGS)
     JSValue* dividendValue = ARG_src1;
     JSValue* divisorValue = ARG_src2;
 
-    ExecState* exec = ARG_exec;
-    double d = dividendValue->toNumber(exec);
-    JSValue* result = jsNumber(ARG_globalData, fmod(d, divisorValue->toNumber(exec)));
+    CallFrame* callFrame = ARG_callFrame;
+    double d = dividendValue->toNumber(callFrame);
+    JSValue* result = jsNumber(ARG_globalData, fmod(d, divisorValue->toNumber(callFrame)));
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
 
 JSValue* Machine::cti_op_less(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
-    JSValue* result = jsBoolean(jsLess(exec, ARG_src1, ARG_src2));
+    CallFrame* callFrame = ARG_callFrame;
+    JSValue* result = jsBoolean(jsLess(callFrame, ARG_src1, ARG_src2));
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
@@ -5296,8 +5218,8 @@ JSValue* Machine::cti_op_neq(CTI_ARGS)
 
     ASSERT(!JSImmediate::areBothImmediateNumbers(src1, src2));
 
-    ExecState* exec = ARG_exec;
-    JSValue* result = jsBoolean(!equalSlowCaseInline(exec, src1, src2));
+    CallFrame* callFrame = ARG_callFrame;
+    JSValue* result = jsBoolean(!equalSlowCaseInline(callFrame, src1, src2));
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
@@ -5306,9 +5228,9 @@ VoidPtrPair Machine::cti_op_post_dec(CTI_ARGS)
 {
     JSValue* v = ARG_src1;
 
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
 
-    JSValue* number = v->toJSNumber(exec);
+    JSValue* number = v->toJSNumber(callFrame);
     VM_CHECK_EXCEPTION_2();
 
     VoidPtrPair pair = { number, jsNumber(ARG_globalData, number->uncheckedGetNumber() - 1) };
@@ -5320,12 +5242,12 @@ JSValue* Machine::cti_op_urshift(CTI_ARGS)
     JSValue* val = ARG_src1;
     JSValue* shift = ARG_src2;
 
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
 
     if (JSImmediate::areBothImmediateNumbers(val, shift) && !JSImmediate::isNegative(val))
         return JSImmediate::rightShiftImmediateNumbers(val, shift);
     else {
-        JSValue* result = jsNumber(ARG_globalData, (val->toUInt32(exec)) >> (shift->toUInt32(exec) & 0x1f));
+        JSValue* result = jsNumber(ARG_globalData, (val->toUInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
         VM_CHECK_EXCEPTION_AT_END();
         return result;
     }
@@ -5336,16 +5258,16 @@ JSValue* Machine::cti_op_bitxor(CTI_ARGS)
     JSValue* src1 = ARG_src1;
     JSValue* src2 = ARG_src2;
 
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
 
-    JSValue* result = jsNumber(ARG_globalData, src1->toInt32(exec) ^ src2->toInt32(exec));
+    JSValue* result = jsNumber(ARG_globalData, src1->toInt32(callFrame) ^ src2->toInt32(callFrame));
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
 
 JSValue* Machine::cti_op_new_regexp(CTI_ARGS)
 {
-    return new (ARG_globalData) RegExpObject(scopeChain(ARG_r)->globalObject()->regExpStructure(), ARG_regexp1);
+    return new (ARG_globalData) RegExpObject(ARG_callFrame->lexicalGlobalObject()->regExpStructure(), ARG_regexp1);
 }
 
 JSValue* Machine::cti_op_bitor(CTI_ARGS)
@@ -5353,20 +5275,19 @@ JSValue* Machine::cti_op_bitor(CTI_ARGS)
     JSValue* src1 = ARG_src1;
     JSValue* src2 = ARG_src2;
 
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
 
-    JSValue* result = jsNumber(ARG_globalData, src1->toInt32(exec) | src2->toInt32(exec));
+    JSValue* result = jsNumber(ARG_globalData, src1->toInt32(callFrame) | src2->toInt32(callFrame));
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
 
 JSValue* Machine::cti_op_call_eval(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
     RegisterFile* registerFile = ARG_registerFile;
-    Register* r = ARG_r;
-    CodeBlock* codeBlock = Machine::codeBlock(r);
-    ScopeChainNode* scopeChain = Machine::scopeChain(r);
+    CodeBlock* codeBlock = callFrame->codeBlock();
+    ScopeChainNode* scopeChain = callFrame->scopeChain();
 
     Machine* machine = ARG_globalData->machine;
     
@@ -5376,9 +5297,9 @@ JSValue* Machine::cti_op_call_eval(CTI_ARGS)
     JSValue* baseVal = ARG_src5;
 
     if (baseVal == scopeChain->globalObject() && funcVal == scopeChain->globalObject()->evalFunction()) {
-        JSObject* thisObject = static_cast<JSObject*>(r[codeBlock->thisRegister].jsValue(exec));
+        JSObject* thisObject = static_cast<JSObject*>(callFrame[codeBlock->thisRegister].jsValue(callFrame));
         JSValue* exceptionValue = 0;
-        JSValue* result = machine->callEval(exec, thisObject, scopeChain, registerFile,  r, registerOffset - RegisterFile::CallFrameHeaderSize - argCount, argCount, exceptionValue);
+        JSValue* result = machine->callEval(callFrame, thisObject, scopeChain, registerFile, registerOffset - RegisterFile::CallFrameHeaderSize - argCount, argCount, exceptionValue);
         VM_CHECK_EXCEPTION_ARG(exceptionValue);
         return result;
     }
@@ -5388,9 +5309,8 @@ JSValue* Machine::cti_op_call_eval(CTI_ARGS)
 
 void* Machine::cti_op_throw(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
-    Register* r = ARG_r;
-    CodeBlock* codeBlock = Machine::codeBlock(r);
+    CallFrame* callFrame = ARG_callFrame;
+    CodeBlock* codeBlock = callFrame->codeBlock();
 
     ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
     unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
@@ -5398,15 +5318,15 @@ void* Machine::cti_op_throw(CTI_ARGS)
     JSValue* exceptionValue = ARG_src1;
     ASSERT(exceptionValue);
 
-    Instruction* handlerVPC = ARG_globalData->machine->throwException(exec, exceptionValue, codeBlock->instructions.begin() + vPCIndex, r, true);
+    Instruction* handlerVPC = ARG_globalData->machine->throwException(callFrame, exceptionValue, codeBlock->instructions.begin() + vPCIndex, true);
 
     if (!handlerVPC) {
         *ARG_exception = exceptionValue;
         return JSImmediate::nullImmediate();
     }
 
-    ARG_setR(r);
-    void* catchRoutine = Machine::codeBlock(r)->nativeExceptionCodeForHandlerVPC(handlerVPC);
+    ARG_setCallFrame(callFrame);
+    void* catchRoutine = callFrame->codeBlock()->nativeExceptionCodeForHandlerVPC(handlerVPC);
     ASSERT(catchRoutine);
     ctiSetReturnAddress(&CTI_RETURN_ADDRESS, catchRoutine);
     return exceptionValue;
@@ -5414,13 +5334,13 @@ void* Machine::cti_op_throw(CTI_ARGS)
 
 JSPropertyNameIterator* Machine::cti_op_get_pnames(CTI_ARGS)
 {
-    return JSPropertyNameIterator::create(ARG_exec, ARG_src1);
+    return JSPropertyNameIterator::create(ARG_callFrame, ARG_src1);
 }
 
 JSValue* Machine::cti_op_next_pname(CTI_ARGS)
 {
     JSPropertyNameIterator* it = ARG_pni1;
-    JSValue* temp = it->next(ARG_exec);
+    JSValue* temp = it->next(ARG_callFrame);
     if (!temp)
         it->invalidate();
     return temp;
@@ -5428,25 +5348,19 @@ JSValue* Machine::cti_op_next_pname(CTI_ARGS)
 
 void Machine::cti_op_push_scope(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
-    JSValue* v = ARG_src1;
-
-    JSObject* o = v->toObject(exec);
+    JSObject* o = ARG_src1->toObject(ARG_callFrame);
     VM_CHECK_EXCEPTION_VOID();
-
-    Register* r = ARG_r;
-    r[RegisterFile::ScopeChain] = scopeChain(r)->push(o);
+    ARG_callFrame->setScopeChain(ARG_callFrame->scopeChain()->push(o));
 }
 
 void Machine::cti_op_pop_scope(CTI_ARGS)
 {
-    Register* r = ARG_r;
-    r[RegisterFile::ScopeChain] = scopeChain(r)->pop();
+    ARG_callFrame->setScopeChain(ARG_callFrame->scopeChain()->pop());
 }
 
 JSValue* Machine::cti_op_typeof(CTI_ARGS)
 {
-    return jsTypeStringForValue(ARG_exec, ARG_src1);
+    return jsTypeStringForValue(ARG_callFrame, ARG_src1);
 }
 
 JSValue* Machine::cti_op_is_undefined(CTI_ARGS)
@@ -5507,24 +5421,24 @@ JSValue* Machine::cti_op_nstricteq(CTI_ARGS)
 JSValue* Machine::cti_op_to_jsnumber(CTI_ARGS)
 {
     JSValue* src = ARG_src1;
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
 
-    JSValue* result = src->toJSNumber(exec);
+    JSValue* result = src->toJSNumber(callFrame);
     VM_CHECK_EXCEPTION_AT_END();
     return result;
 }
 
 JSValue* Machine::cti_op_in(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
     JSValue* baseVal = ARG_src2;
 
     if (!baseVal->isObject()) {
-        Register* r = ARG_r;
-        CodeBlock* codeBlock = Machine::codeBlock(r);
+        CallFrame* callFrame = ARG_callFrame;
+        CodeBlock* codeBlock = callFrame->codeBlock();
         ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
         unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
-        exec->setException(createInvalidParamError(exec, "in", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock));
+        ARG_globalData->exception = createInvalidParamError(callFrame, "in", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock);
         VM_THROW_EXCEPTION();
     }
 
@@ -5533,47 +5447,47 @@ JSValue* Machine::cti_op_in(CTI_ARGS)
 
     uint32_t i;
     if (propName->getUInt32(i))
-        return jsBoolean(baseObj->hasProperty(exec, i));
+        return jsBoolean(baseObj->hasProperty(callFrame, i));
 
-    Identifier property(exec, propName->toString(exec));
+    Identifier property(callFrame, propName->toString(callFrame));
     VM_CHECK_EXCEPTION();
-    return jsBoolean(baseObj->hasProperty(exec, property));
+    return jsBoolean(baseObj->hasProperty(callFrame, property));
 }
 
 JSValue* Machine::cti_op_push_new_scope(CTI_ARGS)
 {
-    JSObject* scope = new (ARG_globalData) JSStaticScopeObject(ARG_exec, *ARG_id1, ARG_src2, DontDelete);
+    JSObject* scope = new (ARG_globalData) JSStaticScopeObject(ARG_callFrame, *ARG_id1, ARG_src2, DontDelete);
 
-    Register* r = ARG_r;
-    r[RegisterFile::ScopeChain] = scopeChain(r)->push(scope);
+    CallFrame* callFrame = ARG_callFrame;
+    callFrame->setScopeChain(callFrame->scopeChain()->push(scope));
     return scope;
 }
 
 void Machine::cti_op_jmp_scopes(CTI_ARGS)
 {
     unsigned count = ARG_int1;
-    Register* r = ARG_r;
+    CallFrame* callFrame = ARG_callFrame;
 
-    ScopeChainNode* tmp = scopeChain(r);
+    ScopeChainNode* tmp = callFrame->scopeChain();
     while (count--)
         tmp = tmp->pop();
-    r[RegisterFile::ScopeChain] = tmp;
+    callFrame->setScopeChain(tmp);
 }
 
 void Machine::cti_op_put_by_index(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
     unsigned property = ARG_int2;
 
-    ARG_src1->put(exec, property, ARG_src3);
+    ARG_src1->put(callFrame, property, ARG_src3);
 }
 
 void* Machine::cti_op_switch_imm(CTI_ARGS)
 {
     JSValue* scrutinee = ARG_src1;
     unsigned tableIndex = ARG_int2;
-    Register* r = ARG_r;
-    CodeBlock* codeBlock = Machine::codeBlock(r);
+    CallFrame* callFrame = ARG_callFrame;
+    CodeBlock* codeBlock = callFrame->codeBlock();
 
     if (JSImmediate::isNumber(scrutinee)) {
         int32_t value = JSImmediate::getTruncatedInt32(scrutinee);
@@ -5587,8 +5501,8 @@ void* Machine::cti_op_switch_char(CTI_ARGS)
 {
     JSValue* scrutinee = ARG_src1;
     unsigned tableIndex = ARG_int2;
-    Register* r = ARG_r;
-    CodeBlock* codeBlock = Machine::codeBlock(r);
+    CallFrame* callFrame = ARG_callFrame;
+    CodeBlock* codeBlock = callFrame->codeBlock();
 
     void* result = codeBlock->characterSwitchJumpTables[tableIndex].ctiDefault;
 
@@ -5605,8 +5519,8 @@ void* Machine::cti_op_switch_string(CTI_ARGS)
 {
     JSValue* scrutinee = ARG_src1;
     unsigned tableIndex = ARG_int2;
-    Register* r = ARG_r;
-    CodeBlock* codeBlock = Machine::codeBlock(r);
+    CallFrame* callFrame = ARG_callFrame;
+    CodeBlock* codeBlock = callFrame->codeBlock();
 
     void* result = codeBlock->stringSwitchJumpTables[tableIndex].ctiDefault;
 
@@ -5620,21 +5534,21 @@ void* Machine::cti_op_switch_string(CTI_ARGS)
 
 JSValue* Machine::cti_op_del_by_val(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
 
     JSValue* baseValue = ARG_src1;
-    JSObject* baseObj = baseValue->toObject(exec); // may throw
+    JSObject* baseObj = baseValue->toObject(callFrame); // may throw
 
     JSValue* subscript = ARG_src2;
     JSValue* result;
     uint32_t i;
     if (subscript->getUInt32(i))
-        result = jsBoolean(baseObj->deleteProperty(exec, i));
+        result = jsBoolean(baseObj->deleteProperty(callFrame, i));
     else {
         VM_CHECK_EXCEPTION();
-        Identifier property(exec, subscript->toString(exec));
+        Identifier property(callFrame, subscript->toString(callFrame));
         VM_CHECK_EXCEPTION();
-        result = jsBoolean(baseObj->deleteProperty(exec, property));
+        result = jsBoolean(baseObj->deleteProperty(callFrame, property));
     }
 
     VM_CHECK_EXCEPTION_AT_END();
@@ -5643,55 +5557,52 @@ JSValue* Machine::cti_op_del_by_val(CTI_ARGS)
 
 void Machine::cti_op_put_getter(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
 
     ASSERT(ARG_src1->isObject());
     JSObject* baseObj = static_cast<JSObject*>(ARG_src1);
     Identifier& ident = *ARG_id2;
     ASSERT(ARG_src3->isObject());
-    baseObj->defineGetter(exec, ident, static_cast<JSObject*>(ARG_src3));
+    baseObj->defineGetter(callFrame, ident, static_cast<JSObject*>(ARG_src3));
 }
 
 void Machine::cti_op_put_setter(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
+    CallFrame* callFrame = ARG_callFrame;
 
     ASSERT(ARG_src1->isObject());
     JSObject* baseObj = static_cast<JSObject*>(ARG_src1);
     Identifier& ident = *ARG_id2;
     ASSERT(ARG_src3->isObject());
-    baseObj->defineSetter(exec, ident, static_cast<JSObject*>(ARG_src3));
+    baseObj->defineSetter(callFrame, ident, static_cast<JSObject*>(ARG_src3));
 }
 
 JSValue* Machine::cti_op_new_error(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
-    Register* r = ARG_r;
-    CodeBlock* codeBlock = Machine::codeBlock(r);
+    CallFrame* callFrame = ARG_callFrame;
+    CodeBlock* codeBlock = callFrame->codeBlock();
     unsigned type = ARG_int1;
     JSValue* message = ARG_src2;
     unsigned lineNumber = ARG_int3;
 
-    return Error::create(exec, static_cast<ErrorType>(type), message->toString(exec), lineNumber, codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL());
+    return Error::create(callFrame, static_cast<ErrorType>(type), message->toString(callFrame), lineNumber, codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL());
 }
 
 void Machine::cti_op_debug(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
-    Register* r = ARG_r;
+    CallFrame* callFrame = ARG_callFrame;
 
     int debugHookID = ARG_int1;
     int firstLine = ARG_int2;
     int lastLine = ARG_int3;
 
-    ARG_globalData->machine->debug(exec, r, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
+    ARG_globalData->machine->debug(callFrame, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
 }
 
 void* Machine::cti_vm_throw(CTI_ARGS)
 {
-    ExecState* exec = ARG_exec;
-    Register* r = ARG_r;
-    CodeBlock* codeBlock = Machine::codeBlock(r);
+    CallFrame* callFrame = ARG_callFrame;
+    CodeBlock* codeBlock = callFrame->codeBlock();
 
     ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(ARG_globalData->throwReturnAddress));
     unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(ARG_globalData->throwReturnAddress);
@@ -5700,15 +5611,15 @@ void* Machine::cti_vm_throw(CTI_ARGS)
     ASSERT(exceptionValue);
     ARG_globalData->exception = 0;
 
-    Instruction* handlerVPC = ARG_globalData->machine->throwException(exec, exceptionValue, codeBlock->instructions.begin() + vPCIndex, r, false);
+    Instruction* handlerVPC = ARG_globalData->machine->throwException(callFrame, exceptionValue, codeBlock->instructions.begin() + vPCIndex, false);
 
     if (!handlerVPC) {
         *ARG_exception = exceptionValue;
         return JSImmediate::nullImmediate();
     }
 
-    ARG_setR(r);
-    void* catchRoutine = Machine::codeBlock(r)->nativeExceptionCodeForHandlerVPC(handlerVPC);
+    ARG_setCallFrame(callFrame);
+    void* catchRoutine = callFrame->codeBlock()->nativeExceptionCodeForHandlerVPC(handlerVPC);
     ASSERT(catchRoutine);
     ctiSetReturnAddress(&CTI_RETURN_ADDRESS, catchRoutine);
     return exceptionValue;
index 9a10b13..d19b6c7 100644 (file)
@@ -44,7 +44,6 @@ namespace JSC {
 
     class CodeBlock;
     class EvalNode;
-    class ExecState;
     class FunctionBodyNode;
     class Instruction;
     class InternalFunction;
@@ -95,18 +94,15 @@ namespace JSC {
 
         bool isOpcode(Opcode opcode);
         
-        JSValue* execute(ProgramNode*, ExecState*, ScopeChainNode*, JSObject* thisObj, JSValue** exception);
-        JSValue* execute(FunctionBodyNode*, ExecState*, JSFunction*, JSObject* thisObj, const ArgList& args, ScopeChainNode*, JSValue** exception);
-        JSValue* execute(EvalNode* evalNode, ExecState* exec, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue** exception);
+        JSValue* execute(ProgramNode*, CallFrame*, ScopeChainNode*, JSObject* thisObj, JSValue** exception);
+        JSValue* execute(FunctionBodyNode*, CallFrame*, JSFunction*, JSObject* thisObj, const ArgList& args, ScopeChainNode*, JSValue** exception);
+        JSValue* execute(EvalNode* evalNode, CallFrame* exec, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue** exception);
 
-        JSValue* retrieveArguments(ExecState*, JSFunction*) const;
-        JSValue* retrieveCaller(ExecState*, InternalFunction*) const;
-        void retrieveLastCaller(ExecState* exec, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const;
+        JSValue* retrieveArguments(CallFrame*, JSFunction*) const;
+        JSValue* retrieveCaller(CallFrame*, InternalFunction*) const;
+        void retrieveLastCaller(CallFrame*, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const;
         
-        static ScopeChainNode* scopeChain(const Register* r) { return r[RegisterFile::ScopeChain].scopeChain(); }
-        static CodeBlock* codeBlock(const Register* r) { return r[RegisterFile::CodeBlock].codeBlock(); }
-
-        void getArgumentsData(Register* callFrame, JSFunction*&, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc);
+        void getArgumentsData(CallFrame*, JSFunction*&, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc);
         void setTimeoutTime(unsigned timeoutTime) { m_timeoutTime = timeoutTime; }
         
         void startTimeoutCheck()
@@ -239,49 +235,49 @@ namespace JSC {
 
         bool isJSArray(JSValue* v) { return !JSImmediate::isImmediate(v) && v->asCell()->vptr() == m_jsArrayVptr; }
         bool isJSString(JSValue* v) { return !JSImmediate::isImmediate(v) && v->asCell()->vptr() == m_jsStringVptr; }
-        
-        ALWAYS_INLINE static void initializeCallFrame(Register* callFrame, CodeBlock*, Instruction*, ScopeChainNode*, Register* r, int returnValueRegister, int argc, JSValue* function);
 
     private:
         enum ExecutionFlag { Normal, InitializeAndReturn };
 
-        NEVER_INLINE JSValue* callEval(ExecState* exec, JSObject* thisObj, ScopeChainNode* scopeChain, RegisterFile*, Register* r, int argv, int argc, JSValue*& exceptionValue);
-        JSValue* execute(EvalNode*, ExecState*, JSObject* thisObj, int registerOffset, ScopeChainNode*, JSValue** exception);
+        NEVER_INLINE JSValue* callEval(CallFrame*, JSObject* thisObject, ScopeChainNode*, RegisterFile*, int argv, int argc, JSValue*& exceptionValue);
+        JSValue* execute(EvalNode*, CallFrame*, JSObject* thisObject, int registerOffset, ScopeChainNode*, JSValue** exception);
 
-        NEVER_INLINE void debug(ExecState*, Register*, DebugHookID, int firstLine, int lastLine);
+        NEVER_INLINE void debug(CallFrame*, DebugHookID, int firstLine, int lastLine);
 
-        NEVER_INLINE bool resolve(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue);
-        NEVER_INLINE bool resolveSkip(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue);
-        NEVER_INLINE bool resolveGlobal(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue);
-        NEVER_INLINE void resolveBase(ExecState* exec, Instruction* vPC, Register* r);
-        NEVER_INLINE bool resolveBaseAndProperty(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue);
-        NEVER_INLINE ScopeChainNode* createExceptionScope(ExecState* exec, const Instruction* vPC, Register* r);
+        NEVER_INLINE bool resolve(CallFrame*, Instruction*, JSValue*& exceptionValue);
+        NEVER_INLINE bool resolveSkip(CallFrame*, Instruction*, JSValue*& exceptionValue);
+        NEVER_INLINE bool resolveGlobal(CallFrame*, Instruction*, JSValue*& exceptionValue);
+        NEVER_INLINE void resolveBase(CallFrame*, Instruction* vPC);
+        NEVER_INLINE bool resolveBaseAndProperty(CallFrame*, Instruction*, JSValue*& exceptionValue);
+        NEVER_INLINE ScopeChainNode* createExceptionScope(CallFrame*, const Instruction* vPC);
 
-        NEVER_INLINE bool unwindCallFrame(ExecState*&, JSValue*, const Instruction*&, CodeBlock*&, Register*&);
-        NEVER_INLINE Instruction* throwException(ExecState*, JSValue*&, const Instruction*, Register*&, bool);
-        NEVER_INLINE bool resolveBaseAndFunc(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue);
+        NEVER_INLINE bool unwindCallFrame(CallFrame*&, JSValue*, const Instruction*&, CodeBlock*&);
+        NEVER_INLINE Instruction* throwException(CallFrame*&, JSValue*&, const Instruction*, bool);
+        NEVER_INLINE bool resolveBaseAndFunc(CallFrame*, Instruction*, JSValue*& exceptionValue);
 
-        Register* callFrame(ExecState*, InternalFunction*) const;
+        static ALWAYS_INLINE CallFrame* slideRegisterWindowForCall(CodeBlock*, RegisterFile*, CallFrame*, size_t registerOffset, int argc);
 
-        JSValue* privateExecute(ExecutionFlag, RegisterFile*, Register*, JSValue** exception);
+        static CallFrame* findFunctionCallFrame(CallFrame*, InternalFunction*);
 
-        void dumpCallFrame(const RegisterFile*, const Register*);
-        void dumpRegisters(const RegisterFile*, const Register*);
+        JSValue* privateExecute(ExecutionFlag, RegisterFile*, CallFrame*, JSValue** exception);
+
+        void dumpCallFrame(const RegisterFile*, CallFrame*);
+        void dumpRegisters(const RegisterFile*, CallFrame*);
 
         JSValue* checkTimeout(JSGlobalObject*);
         void resetTimeoutCheck();
 
-        void tryCacheGetByID(ExecState*, CodeBlock*, Instruction* vPC, JSValue* baseValue, const Identifier& propertyName, const PropertySlot&);
+        void tryCacheGetByID(CallFrame*, CodeBlock*, Instruction*, JSValue* baseValue, const Identifier& propertyName, const PropertySlot&);
         void uncacheGetByID(CodeBlock*, Instruction* vPC);
-        void tryCachePutByID(ExecState* exec, CodeBlock*, Instruction* vPC, JSValue* baseValue, const PutPropertySlot&);
+        void tryCachePutByID(CallFrame*, CodeBlock*, Instruction*, JSValue* baseValue, const PutPropertySlot&);
         void uncachePutByID(CodeBlock*, Instruction* vPC);
 
 #if ENABLE(CTI)
-        void tryCTICacheGetByID(ExecState*, CodeBlock*, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot&);
-        void tryCTICachePutByID(ExecState*, CodeBlock*, void* returnAddress, JSValue* baseValue, const PutPropertySlot&);
+        void tryCTICacheGetByID(CallFrame*, CodeBlock*, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot&);
+        void tryCTICachePutByID(CallFrame*, CodeBlock*, void* returnAddress, JSValue* baseValue, const PutPropertySlot&);
 
-        void* getCTIArrayLengthTrampoline(ExecState*, CodeBlock*);
-        void* getCTIStringLengthTrampoline(ExecState*, CodeBlock*);
+        void* getCTIArrayLengthTrampoline(CallFrame*, CodeBlock*);
+        void* getCTIStringLengthTrampoline(CallFrame*, CodeBlock*);
 
         void* m_ctiArrayLengthTrampoline;
         void* m_ctiStringLengthTrampoline;
@@ -309,36 +305,6 @@ namespace JSC {
 #endif
     };
 
-    ALWAYS_INLINE void Machine::initializeCallFrame(Register* callFrame, CodeBlock* codeBlock, Instruction* vPC, ScopeChainNode* scopeChain, Register* r, int returnValueRegister, int argc, JSValue* function)
-    {
-        ASSERT(r); // use makeHostCallFramePointer(0) to create a host call frame sentinel.
-        callFrame[RegisterFile::CodeBlock] = codeBlock;
-        callFrame[RegisterFile::ScopeChain] = scopeChain;
-        callFrame[RegisterFile::CallerRegisters] = r;
-        callFrame[RegisterFile::ReturnPC] = vPC;
-        callFrame[RegisterFile::ReturnValueRegister] = returnValueRegister;
-        callFrame[RegisterFile::ArgumentCount] = argc; // original argument count (for the sake of the "arguments" object)
-        callFrame[RegisterFile::Callee] = function;
-        callFrame[RegisterFile::OptionalCalleeArguments] = nullJSValue;
-    }
-
-    const intptr_t HostCallFrameMask = 1;
-
-    inline Register* makeHostCallFramePointer(Register* callFrame)
-    {
-        return reinterpret_cast<Register*>(reinterpret_cast<intptr_t>(callFrame) | HostCallFrameMask);
-    }
-
-    inline bool isHostCallFrame(Register* callFrame)
-    {
-        return reinterpret_cast<intptr_t>(callFrame) & HostCallFrameMask;
-    }
-
-    inline Register* stripHostCallFrameBit(Register* callFrame)
-    {
-        return reinterpret_cast<Register*>(reinterpret_cast<intptr_t>(callFrame) & ~HostCallFrameMask);
-    }
-
 } // namespace JSC
 
 #endif // Machine_h
index 7e94c8f..7b5a3bd 100644 (file)
 
 namespace JSC {
 
+    class Arguments;
     class CodeBlock;
     class ExecState;
+    class JSActivation;
+    class JSFunction;
     class JSPropertyNameIterator;
     class JSValue;
     class ScopeChainNode;
+
     struct Instruction;
-    
+
+    typedef ExecState CallFrame;
+
     static JSValue* const nullJSValue = 0;
 
     class Register {
@@ -48,94 +54,113 @@ namespace JSC {
         Register();
         Register(JSValue*);
 
-        JSValue* jsValue(ExecState*) const;
+        JSValue* jsValue(CallFrame*) const;
         JSValue* getJSValue() const;
 
         bool marked() const;
         void mark();
         
     private:
+        friend class ExecState;
         friend class Machine;
 
-        // Only the Machine should use these functions.
+        // Only CallFrame and Machine should use these functions.
+
+        Register(intptr_t);
 
+        Register(JSActivation*);
+        Register(Arguments*);
+        Register(CallFrame*);
         Register(CodeBlock*);
+        Register(JSFunction*);
+        Register(JSPropertyNameIterator*);
         Register(ScopeChainNode*);
-        Register(intptr_t);
-        Register(Register*);
         Register(Instruction*);
-        Register(JSPropertyNameIterator*);
-        explicit Register(void*);
 
+        intptr_t i() const;
+        void* v() const;
+
+        JSActivation* activation() const;
+        Arguments* arguments() const;
+        CallFrame* callFrame() const;
         CodeBlock* codeBlock() const;
+        JSFunction* function() const;
+        JSPropertyNameIterator* propertyNameIterator() const;
         ScopeChainNode* scopeChain() const;
-        intptr_t i() const;
-        Register* r() const;
         Instruction* vPC() const;
-        JSPropertyNameIterator* jsPropertyNameIterator() const;
-        void* v() const;
 
         union {
-        private:
-            friend class Register;
+            intptr_t i;
+            void* v;
+            JSValue* value;
 
+            JSActivation* activation;
+            Arguments* arguments;
+            CallFrame* callFrame;
             CodeBlock* codeBlock;
-            Instruction* vPC;
-            JSValue* jsValue;
+            JSFunction* function;
+            JSPropertyNameIterator* propertyNameIterator;
             ScopeChainNode* scopeChain;
-            JSPropertyNameIterator* jsPropertyNameIterator;
-            Register* r;
-            void* v;
-            intptr_t i;
+            Instruction* vPC;
         } u;
 
 #ifndef NDEBUG
         enum {
-            CodeBlockType = 0, 
-            InstructionType, 
-            JSValueType, 
-            ScopeChainNodeType, 
-            JSPropertyNameIteratorType, 
-            RegisterType, 
-            IntType
+            EmptyType,
+
+            IntType,
+            ValueType,
+
+            ActivationType,
+            ArgumentsType,
+            CallFrameType,
+            CodeBlockType,
+            FunctionType,
+            InstructionType,
+            PropertyNameIteratorType,
+            RegisterType,
+            ScopeChainNodeType
         } m_type;
 #endif
-
-// FIXME: The commented out ASSERTs below are valid; NDEBUG CTI should set these when up to date.
-//        static inline ptrdiff_t offsetOf_type()
-//        {
-//            return OBJECT_OFFSET(Register, m_type);
-//        }
     };
 
+#ifndef NDEBUG
+    #define SET_TYPE(type) m_type = (type)
+    // FIXME: The CTI code to put value into registers doesn't set m_type.
+    // Once it does, we can turn this assertion back on.
+    #define ASSERT_TYPE(type)
+#else
+    #define SET_TYPE(type)
+    #define ASSERT_TYPE(type)
+#endif
+
     ALWAYS_INLINE Register::Register()
     {
 #ifndef NDEBUG
+        SET_TYPE(EmptyType);
         *this = nullJSValue;
 #endif
     }
 
     ALWAYS_INLINE Register::Register(JSValue* v)
     {
-#ifndef NDEBUG
-        m_type = JSValueType;
-#endif
-        u.jsValue = v;
+        SET_TYPE(ValueType);
+        u.value = v;
     }
     
     // This function is scaffolding for legacy clients. It will eventually go away.
-    ALWAYS_INLINE JSValue* Register::jsValue(ExecState*) const
+    ALWAYS_INLINE JSValue* Register::jsValue(CallFrame*) const
     {
         // Once registers hold doubles, this function will allocate a JSValue*
         // if the register doesn't hold one already. 
-//        ASSERT(m_type == JSValueType);
-        return u.jsValue;
+        ASSERT_TYPE(ValueType);
+        return u.value;
     }
     
     ALWAYS_INLINE JSValue* Register::getJSValue() const
     {
-//        ASSERT(m_type == JSValueType);
-        return u.jsValue;
+        ASSERT_TYPE(JSValueType);
+        return u.value;
     }
     
     ALWAYS_INLINE bool Register::marked() const
@@ -150,100 +175,122 @@ namespace JSC {
     
     // Machine functions
 
+    ALWAYS_INLINE Register::Register(Arguments* arguments)
+    {
+        SET_TYPE(ArgumentsType);
+        u.arguments = arguments;
+    }
+
+    ALWAYS_INLINE Register::Register(JSActivation* activation)
+    {
+        SET_TYPE(ActivationType);
+        u.activation = activation;
+    }
+
+    ALWAYS_INLINE Register::Register(CallFrame* callFrame)
+    {
+        SET_TYPE(CallFrameType);
+        u.callFrame = callFrame;
+    }
+
     ALWAYS_INLINE Register::Register(CodeBlock* codeBlock)
     {
-#ifndef NDEBUG
-        m_type = CodeBlockType;
-#endif
+        SET_TYPE(CodeBlockType);
         u.codeBlock = codeBlock;
     }
 
+    ALWAYS_INLINE Register::Register(JSFunction* function)
+    {
+        SET_TYPE(FunctionType);
+        u.function = function;
+    }
+
     ALWAYS_INLINE Register::Register(Instruction* vPC)
     {
-#ifndef NDEBUG
-        m_type = InstructionType;
-#endif
+        SET_TYPE(InstructionType);
         u.vPC = vPC;
     }
 
     ALWAYS_INLINE Register::Register(ScopeChainNode* scopeChain)
     {
-#ifndef NDEBUG
-        m_type = ScopeChainNodeType;
-#endif
+        SET_TYPE(ScopeChainNodeType);
         u.scopeChain = scopeChain;
     }
 
-    ALWAYS_INLINE Register::Register(JSPropertyNameIterator* jsPropertyNameIterator)
+    ALWAYS_INLINE Register::Register(JSPropertyNameIterator* propertyNameIterator)
     {
-#ifndef NDEBUG
-        m_type = JSPropertyNameIteratorType;
-#endif
-        u.jsPropertyNameIterator = jsPropertyNameIterator;
-    }
-
-    ALWAYS_INLINE Register::Register(Register* r)
-    {
-#ifndef NDEBUG
-        m_type = RegisterType;
-#endif
-        u.r = r;
+        SET_TYPE(PropertyNameIteratorType);
+        u.propertyNameIterator = propertyNameIterator;
     }
 
     ALWAYS_INLINE Register::Register(intptr_t i)
     {
-#ifndef NDEBUG
-        m_type = IntType;
-#endif
+        SET_TYPE(IntType);
         u.i = i;
     }
 
-    ALWAYS_INLINE Register::Register(void* v)
+    ALWAYS_INLINE intptr_t Register::i() const
+    {
+        ASSERT_TYPE(IntType);
+        return u.i;
+    }
+    
+    ALWAYS_INLINE void* Register::v() const
     {
-        u.v = v;
+        return u.v;
     }
 
-    ALWAYS_INLINE CodeBlock* Register::codeBlock() const
+    ALWAYS_INLINE JSActivation* Register::activation() const
     {
-//        ASSERT(m_type == CodeBlockType);
-        return u.codeBlock;
+        ASSERT_TYPE(ActivationType);
+        return u.activation;
     }
     
-    ALWAYS_INLINE ScopeChainNode* Register::scopeChain() const
+    ALWAYS_INLINE Arguments* Register::arguments() const
     {
-//        ASSERT(m_type == ScopeChainNodeType);
-        return u.scopeChain;
+        ASSERT_TYPE(ArgumentsType);
+        return u.arguments;
     }
     
-    ALWAYS_INLINE intptr_t Register::i() const
+    ALWAYS_INLINE CallFrame* Register::callFrame() const
     {
-//        ASSERT(m_type == IntType);
-        return u.i;
+        ASSERT_TYPE(CallFrameType);
+        return u.callFrame;
     }
     
-    ALWAYS_INLINE Register* Register::r() const
+    ALWAYS_INLINE CodeBlock* Register::codeBlock() const
     {
-//        ASSERT(m_type == RegisterType);
-        return u.r;
+        ASSERT_TYPE(CodeBlockType);
+        return u.codeBlock;
     }
     
-    ALWAYS_INLINE Instruction* Register::vPC() const
+    ALWAYS_INLINE JSFunction* Register::function() const
     {
-//        ASSERT(m_type == InstructionType);
-        return u.vPC;
+        ASSERT_TYPE(FunctionType);
+        return u.function;
     }
     
-    ALWAYS_INLINE JSPropertyNameIterator* Register::jsPropertyNameIterator() const
+    ALWAYS_INLINE JSPropertyNameIterator* Register::propertyNameIterator() const
     {
-//        ASSERT(m_type == JSPropertyNameIteratorType);
-        return u.jsPropertyNameIterator;
+        ASSERT_TYPE(PropertyNameIteratorType);
+        return u.propertyNameIterator;
     }
     
-    ALWAYS_INLINE void* Register::v() const
+    ALWAYS_INLINE ScopeChainNode* Register::scopeChain() const
     {
-        return u.v;
+        ASSERT_TYPE(ScopeChainNodeType);
+        return u.scopeChain;
+    }
+    
+    ALWAYS_INLINE Instruction* Register::vPC() const
+    {
+        ASSERT_TYPE(InstructionType);
+        return u.vPC;
     }
 
+    #undef SET_TYPE
+    #undef ASSERT_TYPE
+
 } // namespace JSC
 
 namespace WTF {
index 6cd0c1a..7be5063 100644 (file)
@@ -94,7 +94,7 @@ namespace JSC {
 
             CodeBlock = -8,
             ScopeChain = -7,
-            CallerRegisters = -6,
+            CallerFrame = -6,
             ReturnPC = -5,
             ReturnValueRegister = -4,
             ArgumentCount = -3,
index a7008c6..ab88097 100644 (file)
@@ -51,7 +51,7 @@ namespace JSC {
 
     class Arguments : public JSObject {
     public:
-        Arguments(ExecState*, Register* callFrame);
+        Arguments(CallFrame*);
         virtual ~Arguments();
 
         static const ClassInfo info;
@@ -74,26 +74,26 @@ namespace JSC {
 
         virtual const ClassInfo* classInfo() const { return &info; }
 
-        void init(ExecState*, Register* callFrame);
+        void init(CallFrame*);
 
         OwnPtr<ArgumentsData> d;
     };
 
-    inline Arguments::Arguments(ExecState* exec, Register* callFrame)
-        : JSObject(exec->lexicalGlobalObject()->argumentsStructure())
+    inline Arguments::Arguments(CallFrame* callFrame)
+        : JSObject(callFrame->lexicalGlobalObject()->argumentsStructure())
         , d(new ArgumentsData)
     {
         JSFunction* callee;
         ptrdiff_t firstParameterIndex;
         Register* argv;
         int numArguments;
-        exec->machine()->getArgumentsData(callFrame, callee, firstParameterIndex, argv, numArguments);
+        callFrame->machine()->getArgumentsData(callFrame, callee, firstParameterIndex, argv, numArguments);
 
         d->numParameters = callee->m_body->parameterCount();
         d->firstParameterIndex = firstParameterIndex;
         d->numArguments = numArguments;
 
-        d->registers = callFrame;
+        d->registers = callFrame->registers();
 
         Register* extraArguments;
         if (d->numArguments <= d->numParameters)
index e6d3402..5365ba7 100644 (file)
@@ -38,18 +38,18 @@ namespace JSC {
 
 const UString* DebuggerCallFrame::functionName() const
 {
-    if (!m_codeBlock)
+    if (!m_callFrame->codeBlock())
         return 0;
 
-    JSFunction* function = static_cast<JSFunction*>(m_registers[RegisterFile::Callee].getJSValue());
+    JSFunction* function = static_cast<JSFunction*>(m_callFrame->callee());
     if (!function)
         return 0;
-    return &function->name(m_scopeChain->globalData);
+    return &function->name(&m_callFrame->globalData());
 }
 
 DebuggerCallFrame::Type DebuggerCallFrame::type() const
 {
-    if (m_registers[RegisterFile::Callee].getJSValue())
+    if (m_callFrame->callee())
         return FunctionType;
 
     return ProgramType;
@@ -57,25 +57,26 @@ DebuggerCallFrame::Type DebuggerCallFrame::type() const
 
 JSObject* DebuggerCallFrame::thisObject() const
 {
-    if (!m_codeBlock)
+    if (!m_callFrame->codeBlock())
         return 0;
 
-    return static_cast<JSObject*>(m_registers[m_codeBlock->thisRegister].getJSValue());
+    // FIXME: Why is it safe to cast this to JSObject?
+    return static_cast<JSObject*>(m_callFrame->thisValue());
 }
 
 JSValue* DebuggerCallFrame::evaluate(const UString& script, JSValue*& exception) const
 {
-    if (!m_codeBlock)
+    if (!m_callFrame->codeBlock())
         return 0;
 
     int errLine;
     UString errMsg;
     SourceCode source = makeSource(script);
-    RefPtr<EvalNode> evalNode = m_scopeChain->globalData->parser->parse<EvalNode>(CallFrame::create(m_registers), source, &errLine, &errMsg);
+    RefPtr<EvalNode> evalNode = m_callFrame->scopeChain()->globalData->parser->parse<EvalNode>(m_callFrame, source, &errLine, &errMsg);
     if (!evalNode)
-        return Error::create(CallFrame::create(m_registers), SyntaxError, errMsg, errLine, source.provider()->asID(), source.provider()->url());
+        return Error::create(m_callFrame, SyntaxError, errMsg, errLine, source.provider()->asID(), source.provider()->url());
 
-    return m_scopeChain->globalData->machine->execute(evalNode.get(), CallFrame::create(m_registers), thisObject(), m_scopeChain, &exception);
+    return m_callFrame->scopeChain()->globalData->machine->execute(evalNode.get(), m_callFrame, thisObject(), m_callFrame->scopeChain(), &exception);
 }
 
 } // namespace JSC
index 1a39293..96eb63e 100644 (file)
 #ifndef DebuggerCallFrame_h
 #define DebuggerCallFrame_h
 
+#include "ExecState.h"
+
 namespace JSC {
     
-    class CodeBlock;
-    class ExecState;
-    class JSGlobalObject;
-    class JSObject;
-    class JSValue;
-    class Machine;
-    class UString;
-    class Register;
-    class ScopeChainNode;
-    
     class DebuggerCallFrame {
     public:
-        enum Type {
-            ProgramType,
-            FunctionType
-        };
+        enum Type { ProgramType, FunctionType };
 
-        DebuggerCallFrame(JSGlobalObject* dynamicGlobalObject, const CodeBlock* codeBlock, ScopeChainNode* scopeChain, Register* r, JSValue* exception)
-            : m_dynamicGlobalObject(dynamicGlobalObject)
-            , m_codeBlock(codeBlock)
-            , m_scopeChain(scopeChain)
-            , m_registers(r)
+        DebuggerCallFrame(CallFrame* callFrame, JSValue* exception)
+            : m_callFrame(callFrame)
             , m_exception(exception)
         {
         }
 
-        JSGlobalObject* dynamicGlobalObject() const { return m_dynamicGlobalObject; }
-        const ScopeChainNode* scopeChain() const { return m_scopeChain; }
+        JSGlobalObject* dynamicGlobalObject() const { return m_callFrame->dynamicGlobalObject(); }
+        const ScopeChainNode* scopeChain() const { return m_callFrame->scopeChain(); }
         const UString* functionName() const;
         Type type() const;
         JSObject* thisObject() const;
@@ -66,10 +52,7 @@ namespace JSC {
         JSValue* exception() const { return m_exception; }
 
     private:
-        JSGlobalObject* m_dynamicGlobalObject;
-        const CodeBlock* m_codeBlock;
-        ScopeChainNode* m_scopeChain;
-        Register* m_registers;
+        CallFrame* m_callFrame;
         JSValue* m_exception;
     };
 
index 0849363..0144c14 100644 (file)
@@ -1 +1,38 @@
-/* delete me */
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+#include "ExecState.h"
+
+#include "CodeBlock.h"
+
+namespace JSC {
+
+JSValue* CallFrame::thisValue()
+{
+    return this[codeBlock()->thisRegister].jsValue(this);
+}
+
+}
index 35f8ea6..50d2b95 100644 (file)
 #ifndef ExecState_h
 #define ExecState_h
 
+// FIXME: Rename this file to CallFrame.h.
+
 #include "JSGlobalData.h"
 #include "Machine.h"
 #include "ScopeChain.h"
 
 namespace JSC  {
 
-    class ExecState;
-    class JSValue;
-    class Register;
-
-    typedef ExecState CallFrame;
+    class Arguments;
+    class JSActivation;
 
     // Represents the current state of script execution.
     // Passed as the first argument to most functions.
-    class ExecState : private Register, Noncopyable {
+    class ExecState : private Register {
     public:
-        static CallFrame* create(Register* callFrameBase) { return static_cast<CallFrame*>(callFrameBase); }
-        Register* registers() { return this; }
+        JSFunction* callee() const { return this[RegisterFile::Callee].function(); }
+        CodeBlock* codeBlock() const { return this[RegisterFile::CodeBlock].Register::codeBlock(); }
+        ScopeChainNode* scopeChain() const { return this[RegisterFile::ScopeChain].Register::scopeChain(); }
+
+        JSValue* thisValue();
 
         // Global object in which execution began.
         JSGlobalObject* dynamicGlobalObject();
 
         // Global object in which the currently executing code was defined.
         // Differs from dynamicGlobalObject() during function calls across web browser frames.
-        JSGlobalObject* lexicalGlobalObject()
+        JSGlobalObject* lexicalGlobalObject() const
         {
-            return Machine::scopeChain(this)->globalObject();
+            return scopeChain()->globalObject();
         }
 
         // Differs from lexicalGlobalObject because this will have DOM window shell rather than
-        // the actual DOM window.
-        JSObject* globalThisValue()
+        // the actual DOM window, which can't be "this" for security reasons.
+        JSObject* globalThisValue() const
         {
-            return Machine::scopeChain(this)->globalThisObject();
+            return scopeChain()->globalThisObject();
         }
 
-        JSGlobalData& globalData()
+        // FIXME: Elsewhere, we use JSGlobalData* rather than JSGlobalData&.
+        // We should make this more uniform and either use a reference everywhere
+        // or a pointer everywhere.
+        JSGlobalData& globalData() const
         {
-            return *Machine::scopeChain(this)->globalData;
+            return *scopeChain()->globalData;
         }
 
         // Convenience functions for access to global data.
+        // It takes a few memory references to get from a call frame to the global data
+        // pointer, so these are inefficient, and should be used sparingly in new code.
+        // But they're used in many places in legacy code, so they're not going away any time soon.
 
         void setException(JSValue* exception) { globalData().exception = exception; }
         void clearException() { globalData().exception = 0; }
-        JSValue* exception() { return globalData().exception; }
+        JSValue* exception() const { return globalData().exception; }
         JSValue** exceptionSlot() { return &globalData().exception; }
-        bool hadException() { return !!globalData().exception; }
+        bool hadException() const { return !!globalData().exception; }
 
-        IdentifierTable* identifierTable() { return globalData().identifierTable; }
-        const CommonIdentifiers& propertyNames() { return *globalData().propertyNames; }
-        const ArgList& emptyList() { return *globalData().emptyList; }
-        Lexer* lexer() { return globalData().lexer; }
-        Parser* parser() { return globalData().parser; }
+        const CommonIdentifiers& propertyNames() const { return *globalData().propertyNames; }
+        const ArgList& emptyList() const { return *globalData().emptyList; }
         Machine* machine() { return globalData().machine; }
         Heap* heap() { return &globalData().heap; }
 
@@ -89,6 +94,51 @@ namespace JSC  {
         static const HashTable* stringTable(CallFrame* callFrame) { return callFrame->globalData().stringTable; }
 
     private:
+        friend class Arguments;
+        friend class JSActivation;
+        friend class JSGlobalObject;
+        friend class Machine;
+
+        static CallFrame* create(Register* callFrameBase) { return static_cast<CallFrame*>(callFrameBase); }
+        Register* registers() { return this; }
+
+        CallFrame& operator=(const Register& r) { *static_cast<Register*>(this) = r; return *this; }
+
+        int argumentCount() const { return this[RegisterFile::ArgumentCount].i(); }
+        CallFrame* callerFrame() const { return this[RegisterFile::CallerFrame].callFrame(); }
+        Arguments* optionalCalleeArguments() const { return this[RegisterFile::OptionalCalleeArguments].arguments(); }
+        Instruction* returnPC() const { return this[RegisterFile::ReturnPC].vPC(); }
+        int returnValueRegister() const { return this[RegisterFile::ReturnValueRegister].i(); }
+
+        void setArgumentCount(int count) { this[RegisterFile::ArgumentCount] = count; }
+        void setCallee(JSFunction* callee) { this[RegisterFile::Callee] = callee; }
+        void setCalleeArguments(Arguments* arguments) { this[RegisterFile::OptionalCalleeArguments] = arguments; }
+        void setCallerFrame(CallFrame* callerFrame) { this[RegisterFile::CallerFrame] = callerFrame; }
+        void setCodeBlock(CodeBlock* codeBlock) { this[RegisterFile::CodeBlock] = codeBlock; }
+        void setScopeChain(ScopeChainNode* scopeChain) { this[RegisterFile::ScopeChain] = scopeChain; }
+
+        ALWAYS_INLINE void init(CodeBlock* codeBlock, Instruction* vPC, ScopeChainNode* scopeChain,
+            CallFrame* callerFrame, int returnValueRegister, int argc, JSFunction* function)
+        {
+            ASSERT(callerFrame); // Use noCaller() rather than 0 for the outer host call frame caller.
+
+            setCodeBlock(codeBlock);
+            setScopeChain(scopeChain);
+            setCallerFrame(callerFrame);
+            this[RegisterFile::ReturnPC] = vPC;
+            this[RegisterFile::ReturnValueRegister] = returnValueRegister;
+            setArgumentCount(argc); // original argument count (for the sake of the "arguments" object)
+            setCallee(function);
+            setCalleeArguments(0);
+        }
+
+        static const intptr_t HostCallFrameFlag = 1;
+
+        static CallFrame* noCaller() { return reinterpret_cast<CallFrame*>(HostCallFrameFlag); }
+        bool hasHostCallFrameFlag() const { return reinterpret_cast<intptr_t>(this) & HostCallFrameFlag; }
+        CallFrame* addHostCallFrameFlag() const { return reinterpret_cast<CallFrame*>(reinterpret_cast<intptr_t>(this) | HostCallFrameFlag); }
+        CallFrame* removeHostCallFrameFlag() { return reinterpret_cast<CallFrame*>(reinterpret_cast<intptr_t>(this) & ~HostCallFrameFlag); }
+
         ExecState();
         ~ExecState();
     };
index a09f8a9..6ca0231 100644 (file)
@@ -87,7 +87,7 @@ JSObject* constructFunction(ExecState* exec, const ArgList& args, const Identifi
     int errLine;
     UString errMsg;
     SourceCode source = makeSource(body, sourceURL, lineNumber);
-    RefPtr<FunctionBodyNode> functionBody = exec->parser()->parse<FunctionBodyNode>(exec, source, &errLine, &errMsg);
+    RefPtr<FunctionBodyNode> functionBody = exec->globalData().parser->parse<FunctionBodyNode>(exec, source, &errLine, &errMsg);
 
     // No program node == syntax error - throw a syntax error
     if (!functionBody)
index a7c70eb..339bb0f 100644 (file)
@@ -39,8 +39,8 @@ ASSERT_CLASS_FITS_IN_CELL(JSActivation);
 
 const ClassInfo JSActivation::info = { "JSActivation", 0, 0, 0 };
 
-JSActivation::JSActivation(ExecState* exec, PassRefPtr<FunctionBodyNode> functionBody, Register* registers)
-    : Base(exec->globalData().activationStructureID, new JSActivationData(functionBody, registers))
+JSActivation::JSActivation(CallFrame* callFrame, PassRefPtr<FunctionBodyNode> functionBody)
+    : Base(callFrame->globalData().activationStructureID, new JSActivationData(functionBody, callFrame))
 {
 }
 
@@ -153,19 +153,20 @@ bool JSActivation::isDynamicScope() const
 
 JSValue* JSActivation::argumentsGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
 {
-    JSActivation* thisObj = static_cast<JSActivation*>(slot.slotBase());
+    JSActivation* activation = static_cast<JSActivation*>(slot.slotBase());
 
-    if (thisObj->d()->functionBody->usesArguments()) {
+    if (activation->d()->functionBody->usesArguments()) {
         PropertySlot slot;
-        thisObj->symbolTableGet(exec->propertyNames().arguments, slot);
+        activation->symbolTableGet(exec->propertyNames().arguments, slot);
         return slot.getValue(exec, exec->propertyNames().arguments);
     }
 
-    Arguments* arguments = static_cast<Arguments*>(thisObj->d()->registers[RegisterFile::OptionalCalleeArguments].getJSValue());
+    CallFrame* callFrame = CallFrame::create(activation->d()->registers);
+    Arguments* arguments = callFrame->optionalCalleeArguments();
     if (!arguments) {
-        arguments = new (exec) Arguments(exec, &thisObj->registerAt(0));
+        arguments = new (callFrame) Arguments(callFrame);
         arguments->copyRegisters();
-        thisObj->d()->registers[RegisterFile::OptionalCalleeArguments] = arguments;
+        callFrame->setCalleeArguments(arguments);
     }
     ASSERT(arguments->isObject(&Arguments::info));
 
index c39168b..d6f1a06 100644 (file)
@@ -43,7 +43,7 @@ namespace JSC {
     class JSActivation : public JSVariableObject {
         typedef JSVariableObject Base;
     public:
-        JSActivation(ExecState*, PassRefPtr<FunctionBodyNode>, Register*);
+        JSActivation(CallFrame*, PassRefPtr<FunctionBodyNode>);
         virtual ~JSActivation();
 
         virtual void mark();
index 7d26e02..c2f815a 100644 (file)
@@ -129,7 +129,7 @@ void JSGlobalObject::init(JSObject* thisValue)
     d()->globalData = Heap::heap(this)->globalData();
     d()->globalScopeChain = ScopeChain(this, d()->globalData.get(), thisValue);
 
-    Machine::initializeCallFrame(d()->globalCallFrame + RegisterFile::CallFrameHeaderSize, 0, 0, d()->globalScopeChain.node(), makeHostCallFramePointer(0), 0, 0, 0);
+    JSGlobalObject::globalExec()->init(0, 0, d()->globalScopeChain.node(), CallFrame::noCaller(), 0, 0, 0);
 
     if (JSGlobalObject*& headObject = head()) {
         d()->prev = headObject;
index dc25377..5f706ca 100644 (file)
@@ -286,7 +286,7 @@ JSValue* globalFuncEval(ExecState* exec, JSObject* function, JSValue* thisValue,
     UString errMsg;
 
     SourceCode source = makeSource(s);
-    RefPtr<EvalNode> evalNode = exec->parser()->parse<EvalNode>(exec, source, &errLine, &errMsg);
+    RefPtr<EvalNode> evalNode = exec->globalData().parser->parse<EvalNode>(exec, source, &errLine, &errMsg);
 
     if (!evalNode)
         return throwError(exec, SyntaxError, errMsg, errLine, source.provider()->asID(), NULL);
index adfa02d..1194517 100644 (file)
@@ -61,11 +61,11 @@ namespace JSC {
         // without increasing their own size (since there's a hard limit on the
         // size of a JSCell).
         struct JSVariableObjectData {
-            JSVariableObjectData(SymbolTable* symbolTable_, Register* registers_)
-                : symbolTable(symbolTable_)
-                , registers(registers_)
+            JSVariableObjectData(SymbolTable* symbolTable, Register* registers)
+                : symbolTable(symbolTable)
+                , registers(registers)
             {
-                ASSERT(symbolTable_);
+                ASSERT(symbolTable);
             }
 
             SymbolTable* symbolTable; // Maps name -> offset from "r" in register file.
index fd686c6..d6f2ed4 100644 (file)
@@ -47,7 +47,7 @@ void Parser::parse(ExecState* exec, int* errLine, UString* errMsg)
     *errLine = -1;
     *errMsg = 0;
 
-    Lexer& lexer = *exec->lexer();
+    Lexer& lexer = *exec->globalData().lexer;
     lexer.setCode(*m_source);
 
     int parseError = kjsyyparse(&exec->globalData());
index d13f836..68a309a 100644 (file)
@@ -331,7 +331,7 @@ JSObject* constructRegExp(ExecState* exec, const ArgList& args)
     UString pattern = arg0->isUndefined() ? UString("") : arg0->toString(exec);
     UString flags = arg1->isUndefined() ? UString("") : arg1->toString(exec);
 
-    RefPtr<RegExp> regExp = RegExp::create(exec, pattern, flags);
+    RefPtr<RegExp> regExp = RegExp::create(&exec->globalData(), pattern, flags);
     if (!regExp->isValid())
         return throwError(exec, SyntaxError, UString("Invalid regular expression: ").append(regExp->errorMessage()));
     return new (exec) RegExpObject(exec->lexicalGlobalObject()->regExpStructure(), regExp.release());
index 80d6dc7..ee2a2d2 100644 (file)
@@ -85,7 +85,7 @@ JSValue* regExpProtoFuncCompile(ExecState* exec, JSObject*, JSValue* thisValue,
     } else {
         UString pattern = args.isEmpty() ? UString("") : arg0->toString(exec);
         UString flags = arg1->isUndefined() ? UString("") : arg1->toString(exec);
-        regExp = RegExp::create(exec, pattern, flags);
+        regExp = RegExp::create(&exec->globalData(), pattern, flags);
     }
 
     if (!regExp->isValid())
index 3f074c1..4ddf9ed 100644 (file)
@@ -305,7 +305,7 @@ static bool prettyPrintScript(ExecState* exec, const UString& fileName, const Ve
 {
     int errLine = 0;
     UString errMsg;
-    RefPtr<ProgramNode> programNode = exec->parser()->parse<ProgramNode>(exec, makeSource(script.data(), fileName), &errLine, &errMsg);
+    RefPtr<ProgramNode> programNode = exec->globalData().parser->parse<ProgramNode>(exec, makeSource(script.data(), fileName), &errLine, &errMsg);
     if (!programNode) {
         fprintf(stderr, "%s:%d: %s.\n", fileName.UTF8String().c_str(), errLine, errMsg.UTF8String().c_str());
         return false;
index 58c0dfe..f34caa9 100644 (file)
@@ -412,7 +412,7 @@ JSValue* stringProtoFuncMatch(ExecState* exec, JSObject*, JSValue* thisValue, co
          *  If regexp is not an object whose [[Class]] property is "RegExp", it is
          *  replaced with the result of the expression new RegExp(regexp).
          */
-        reg = RegExp::create(exec, a0->toString(exec));
+        reg = RegExp::create(&exec->globalData(), a0->toString(exec));
     }
     RegExpConstructor* regExpObj = exec->lexicalGlobalObject()->regExpConstructor();
     int pos;
@@ -462,7 +462,7 @@ JSValue* stringProtoFuncSearch(ExecState* exec, JSObject*, JSValue* thisValue, c
          *  If regexp is not an object whose [[Class]] property is "RegExp", it is
          *  replaced with the result of the expression new RegExp(regexp).
          */
-        reg = RegExp::create(exec, a0->toString(exec));
+        reg = RegExp::create(&exec->globalData(), a0->toString(exec));
     }
     RegExpConstructor* regExpObj = exec->lexicalGlobalObject()->regExpConstructor();
     int pos;
index fc792a0..50a6cc3 100644 (file)
@@ -240,7 +240,7 @@ void Identifier::remove(UString::Rep* r)
 
 void Identifier::checkSameIdentifierTable(ExecState* exec, UString::Rep* rep)
 {
-    ASSERT(rep->identifierTable() == exec->identifierTable());
+    ASSERT(rep->identifierTable() == exec->globalData().identifierTable);
 }
 
 void Identifier::checkSameIdentifierTable(JSGlobalData* globalData, UString::Rep* rep)
index cd5c157..4966b52 100644 (file)
@@ -46,7 +46,7 @@ Completion Interpreter::checkSyntax(ExecState* exec, const SourceCode& source)
     int errLine;
     UString errMsg;
 
-    RefPtr<ProgramNode> progNode = exec->parser()->parse<ProgramNode>(exec, source, &errLine, &errMsg);
+    RefPtr<ProgramNode> progNode = exec->globalData().parser->parse<ProgramNode>(exec, source, &errLine, &errMsg);
     if (!progNode)
         return Completion(Throw, Error::create(exec, SyntaxError, errMsg, errLine, source.provider()->asID(), source.provider()->url()));
     return Completion(Normal);
@@ -58,7 +58,7 @@ Completion Interpreter::evaluate(ExecState* exec, ScopeChain& scopeChain, const
     
     int errLine;
     UString errMsg;
-    RefPtr<ProgramNode> programNode = exec->parser()->parse<ProgramNode>(exec, source, &errLine, &errMsg);
+    RefPtr<ProgramNode> programNode = exec->globalData().parser->parse<ProgramNode>(exec, source, &errLine, &errMsg);
 
     if (!programNode)
         return Completion(Throw, Error::create(exec, SyntaxError, errMsg, errLine, source.provider()->asID(), source.provider()->url()));
index f792092..8a5e773 100644 (file)
@@ -159,7 +159,7 @@ static void substitute(UString& string, const UString& substring)
 RegisterID* ThrowableExpressionData::emitThrowError(CodeGenerator& generator, ErrorType e, const char* msg)
 {
     generator.emitExpressionInfo(m_divot, m_startOffset, m_endOffset);
-    RegisterID* exception = generator.emitNewError(generator.newTemporary(), e, jsString(generator.globalExec(), msg));
+    RegisterID* exception = generator.emitNewError(generator.newTemporary(), e, jsString(generator.globalData(), msg));
     generator.emitThrow(exception);
     return exception;
 }
@@ -169,7 +169,7 @@ RegisterID* ThrowableExpressionData::emitThrowError(CodeGenerator& generator, Er
     UString message = msg;
     substitute(message, label.ustring());
     generator.emitExpressionInfo(m_divot, m_startOffset, m_endOffset);
-    RegisterID* exception = generator.emitNewError(generator.newTemporary(), e, jsString(generator.globalExec(), message));
+    RegisterID* exception = generator.emitNewError(generator.newTemporary(), e, jsString(generator.globalData(), message));
     generator.emitThrow(exception);
     return exception;
 }
@@ -238,7 +238,7 @@ RegisterID* StringNode::emitCode(CodeGenerator& generator, RegisterID* dst)
 
 RegisterID* RegExpNode::emitCode(CodeGenerator& generator, RegisterID* dst)
 {
-    RefPtr<RegExp> regExp = RegExp::create(generator.globalExec(), m_pattern, m_flags);
+    RefPtr<RegExp> regExp = RegExp::create(generator.globalData(), m_pattern, m_flags);
     if (!regExp->isValid())
         return emitThrowError(generator, SyntaxError, ("Invalid regular expression: " + UString(regExp->errorMessage())).UTF8String().c_str());
     if (dst == ignoredResult())
@@ -300,7 +300,7 @@ RegisterID* ArrayNode::emitCode(CodeGenerator& generator, RegisterID* dst)
     }
 
     if (m_elision) {
-        RegisterID* value = generator.emitLoad(0, jsNumber(generator.globalExec(), m_elision + length));
+        RegisterID* value = generator.emitLoad(0, jsNumber(generator.globalData(), m_elision + length));
         generator.emitPutById(array.get(), generator.propertyNames().length, value);
     }
 
@@ -775,7 +775,7 @@ RegisterID* InstanceOfNode::emitCode(CodeGenerator& generator, RegisterID* dst)
     RefPtr<RegisterID> src2 = generator.emitNode(m_expr2.get());
 
     generator.emitExpressionInfo(m_divot, m_startOffset, m_endOffset);
-    RegisterID* src2Prototype = generator.emitGetById(generator.newTemporary(), src2.get(), generator.globalExec()->propertyNames().prototype);
+    RegisterID* src2Prototype = generator.emitGetById(generator.newTemporary(), src2.get(), generator.globalData()->propertyNames->prototype);
 
     generator.emitExpressionInfo(m_divot, m_startOffset, m_endOffset);
     return generator.emitInstanceOf(generator.finalDestination(dst, src1.get()), src1.get(), src2.get(), src2Prototype);
index 181cc0a..6a6caca 100644 (file)
@@ -116,25 +116,12 @@ namespace JSC {
         PrecExpression
     };
 
-    struct DeclarationStacks {
+    namespace DeclarationStacks {
         typedef Vector<Node*, 16> NodeStack;
-        enum { IsConstant = 1, HasInitializer = 2 } VarAttrs;
+        enum VarAttrs { IsConstant = 1, HasInitializer = 2 };
         typedef Vector<std::pair<Identifier, unsigned>, 16> VarStack;
         typedef Vector<RefPtr<FuncDeclNode>, 16> FunctionStack;
-
-    &nbs