Changeset 37428 in webkit


Ignore:
Timestamp:
Oct 8, 2008 10:50:42 AM (16 years ago)
Author:
timothy@apple.com
Message:

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

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

Location:
trunk
Files:
41 edited

Legend:

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

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

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

    r37427 r37428  
    3030
    3131namespace JSC {
     32    class ExecState;
    3233    class Identifier;
    3334    class JSGlobalData;
    34 }
     35};
    3536
    3637struct OpaqueJSString : public ThreadSafeShared<OpaqueJSString> {
     
    5253
    5354    JSC::UString ustring() const;
     55
     56    JSC::Identifier identifier(JSC::ExecState*) const;
    5457    JSC::Identifier identifier(JSC::JSGlobalData*) const;
    5558
  • trunk/JavaScriptCore/ChangeLog

    r37427 r37428  
     12008-10-08  Timothy Hatcher  <timothy@apple.com>
     2
     3        Roll out r37427 because it causes an infinite recursion loading about:blank.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=21476
     6
    172008-10-08  Darin Adler  <darin@apple.com>
    28
  • trunk/JavaScriptCore/VM/CTI.cpp

    r37427 r37428  
    3535#include "wrec/WREC.h"
    3636#include "ResultType.h"
    37 
    3837#if PLATFORM(MAC)
    3938#include <sys/sysctl.h>
     
    4544
    4645#if PLATFORM(MAC)
    47 
    48 static inline bool isSSE2Present()
     46bool isSSE2Present()
    4947{
    5048    return true; // All X86 Macs are guaranteed to support at least SSE2
    5149}
    52 
    53 #else
    54 
    55 static bool isSSE2Present()
     50#else COMPILER(MSVC)
     51bool isSSE2Present()
    5652{
    5753    static const int SSE2FeatureBit = 1 << 26;
     
    7773    return check.present;
    7874}
    79 
    8075#endif
    81 
    82 COMPILE_ASSERT(CTI_ARGS_code == 0xC, CTI_ARGS_code_is_C);
    83 COMPILE_ASSERT(CTI_ARGS_callFrame == 0xE, CTI_ARGS_callFrame_is_E);
    8476
    8577#if COMPILER(GCC) && PLATFORM(X86)
     
    9284    "subl $0x24, %esp" "\n"
    9385    "movl $512, %esi" "\n"
    94     "movl 0x38(%esp), %edi" "\n" // Ox38 = 0x0E * 4, 0x0E = CTI_ARGS_callFrame (see assertion above)
    95     "call *0x30(%esp)" "\n" // Ox30 = 0x0C * 4, 0x0C = CTI_ARGS_code (see assertion above)
     86    "movl 0x38(%esp), %edi" "\n" // Ox38 = 0x0E * 4, 0x0E = CTI_ARGS_r
     87    "call *0x30(%esp)" "\n" // Ox30 = 0x0C * 4, 0x0C = CTI_ARGS_code
    9688    "addl $0x24, %esp" "\n"
    9789    "popl %edi" "\n"
     
    123115            mov ecx, esp;
    124116            mov edi, [esp + 0x38];
    125             call [esp + 0x30]; // Ox30 = 0x0C * 4, 0x0C = CTI_ARGS_code (see assertion above)
     117            call [esp + 0x30];
    126118            add esp, 0x24;
    127119            pop edi;
     
    147139#endif
    148140
     141
    149142ALWAYS_INLINE bool CTI::isConstant(int src)
    150143{
     
    152145}
    153146
    154 ALWAYS_INLINE JSValue* CTI::getConstant(CallFrame* callFrame, int src)
    155 {
    156     return m_codeBlock->constantRegisters[src - m_codeBlock->numVars].jsValue(callFrame);
     147ALWAYS_INLINE JSValue* CTI::getConstant(ExecState* exec, int src)
     148{
     149    return m_codeBlock->constantRegisters[src - m_codeBlock->numVars].jsValue(exec);
    157150}
    158151
     
    162155    // TODO: we want to reuse values that are already in registers if we can - add a register allocator!
    163156    if (isConstant(src)) {
    164         JSValue* js = getConstant(m_callFrame, src);
     157        JSValue* js = getConstant(m_exec, src);
    165158        m_jit.movl_i32r(reinterpret_cast<unsigned>(js), dst);
    166159    } else
     
    172165{
    173166    if (isConstant(src)) {
    174         JSValue* js = getConstant(m_callFrame, src);
     167        JSValue* js = getConstant(m_exec, src);
    175168        m_jit.movl_i32m(reinterpret_cast<unsigned>(js), offset + sizeof(void*), X86::esp);
    176169    } else {
     
    194187{
    195188    if (isConstant(src)) {
    196         JSValue* js = getConstant(m_callFrame, src);
     189        JSValue* js = getConstant(m_exec, src);
    197190        return JSImmediate::isNumber(js) ? js : 0;
    198191    }
     
    257250    char which1 = '*';
    258251    if (isConstant(src1)) {
    259         JSValue* js = getConstant(m_callFrame, src1);
     252        JSValue* js = getConstant(m_exec, src1);
    260253        which1 =
    261254            JSImmediate::isImmediate(js) ?
     
    271264    char which2 = '*';
    272265    if (isConstant(src2)) {
    273         JSValue* js = getConstant(m_callFrame, src2);
     266        JSValue* js = getConstant(m_exec, src2);
    274267        which2 =
    275268            JSImmediate::isImmediate(js) ?
     
    453446}
    454447
    455 CTI::CTI(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock)
     448CTI::CTI(Machine* machine, ExecState* exec, CodeBlock* codeBlock)
    456449    : m_jit(machine->jitCodeBuffer())
    457450    , m_machine(machine)
    458     , m_callFrame(callFrame)
     451    , m_exec(exec)
    459452    , m_codeBlock(codeBlock)
    460453    , m_labels(codeBlock ? codeBlock->instructions.size() : 0)
     
    495488    m_jit.movl_mr(OBJECT_OFFSET(JSFunction, m_scopeChain) + OBJECT_OFFSET(ScopeChain, m_node), X86::ecx, X86::ecx); // newScopeChain
    496489    m_jit.movl_i32m(argCount, RegisterFile::ArgumentCount * static_cast<int>(sizeof(Register)), X86::edx);
    497     m_jit.movl_rm(X86::edi, RegisterFile::CallerFrame * static_cast<int>(sizeof(Register)), X86::edx);
     490    m_jit.movl_rm(X86::edi, RegisterFile::CallerRegisters * static_cast<int>(sizeof(Register)), X86::edx);
    498491    m_jit.movl_rm(X86::ecx, RegisterFile::ScopeChain * static_cast<int>(sizeof(Register)), X86::edx);
    499492}
     
    523516        int thisVal = instruction[i + 3].u.operand;
    524517        if (thisVal == missingThisObjectMarker()) {
    525             // FIXME: should this be loaded dynamically off m_callFrame?
    526             m_jit.movl_i32m(reinterpret_cast<unsigned>(m_callFrame->globalThisValue()), firstArg * sizeof(Register), X86::edi);
     518            // FIXME: should this be loaded dynamically off m_exec?
     519            m_jit.movl_i32m(reinterpret_cast<unsigned>(m_exec->globalThisValue()), firstArg * sizeof(Register), X86::edi);
    527520        } else {
    528521            emitGetArg(thisVal, X86::ecx);
     
    567560    m_jit.movl_mr(OBJECT_OFFSET(CodeBlock, ctiCode), X86::eax, X86::eax);
    568561
    569     // Put the new value of 'callFrame' into edi and onto the stack, too.
    570     emitPutCTIParam(X86::edx, CTI_ARGS_callFrame);
     562    // Setup the new value of 'r' in edi, and on the stack, too.
     563    emitPutCTIParam(X86::edx, CTI_ARGS_r);
    571564    m_jit.movl_rr(X86::edx, X86::edi);
    572565
     
    693686void CTI::compileBinaryArithOp(OpcodeID opcodeID, unsigned dst, unsigned src1, unsigned src2, OperandTypes types, unsigned i)
    694687{
    695     StructureID* numberStructureID = m_callFrame->globalData().numberStructureID.get();
     688    StructureID* numberStructureID = m_exec->globalData().numberStructureID.get();
    696689    X86Assembler::JmpSrc wasJSNumberCell1, wasJSNumberCell1b, wasJSNumberCell2, wasJSNumberCell2b;
    697690
     
    886879            unsigned src = instruction[i + 2].u.operand;
    887880            if (isConstant(src))
    888                 m_jit.movl_i32r(reinterpret_cast<unsigned>(getConstant(m_callFrame, src)), X86::edx);
     881                m_jit.movl_i32r(reinterpret_cast<unsigned>(getConstant(m_exec, src)), X86::edx);
    889882            else
    890883                emitGetArg(src, X86::edx);
     
    12461239
    12471240            // Restore our caller's "r".
    1248             emitGetArg(RegisterFile::CallerFrame, X86::edi);
    1249             emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
     1241            emitGetArg(RegisterFile::CallerRegisters, X86::edi);
     1242            emitPutCTIParam(X86::edi, CTI_ARGS_r);
    12501243
    12511244            // Return.
     
    18111804        }
    18121805        case op_catch: {
    1813             emitGetCTIParam(CTI_ARGS_callFrame, X86::edi); // edi := r
     1806            emitGetCTIParam(CTI_ARGS_r, X86::edi); // edi := r
    18141807            emitPutResult(instruction[i + 1].u.operand);
    18151808            i += 2;
     
    26602653    // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a StructureID that is
    26612654    // referencing the prototype object - let's speculatively load it's table nice and early!)
    2662     JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(m_callFrame));
     2655    JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(m_exec));
    26632656    PropertyStorage* protoPropertyStorage = &protoObject->m_propertyStorage;
    26642657    m_jit.movl_mr(static_cast<void*>(protoPropertyStorage), X86::edx);
     
    27032696    // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a StructureID that is
    27042697    // referencing the prototype object - let's speculatively load it's table nice and early!)
    2705     JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(m_callFrame));
     2698    JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(m_exec));
    27062699    PropertyStorage* protoPropertyStorage = &protoObject->m_propertyStorage;
    27072700    m_jit.movl_mr(static_cast<void*>(protoPropertyStorage), X86::edx);
     
    27522745    JSObject* protoObject = 0;
    27532746    for (unsigned i = 0; i<count; ++i) {
    2754         protoObject = static_cast<JSObject*>(currStructureID->prototypeForLookup(m_callFrame));
     2747        protoObject = static_cast<JSObject*>(currStructureID->prototypeForLookup(m_exec));
    27552748        currStructureID = chainEntries[i].get();
    27562749
     
    30523045#if ENABLE(WREC)
    30533046
    3054 void* CTI::compileRegExp(Machine* machine, const UString& pattern, unsigned* numSubpatterns_ptr, const char** error_ptr, bool ignoreCase, bool multiline)
     3047void* CTI::compileRegExp(ExecState* exec, const UString& pattern, unsigned* numSubpatterns_ptr, const char** error_ptr, bool ignoreCase, bool multiline)
    30553048{
    30563049    // TODO: better error messages
     
    30603053    }
    30613054
    3062     X86Assembler jit(machine->jitCodeBuffer());
     3055    X86Assembler jit(exec->machine()->jitCodeBuffer());
    30633056    WRECParser parser(pattern, ignoreCase, multiline, jit);
    30643057   
  • trunk/JavaScriptCore/VM/CTI.h

    r37427 r37428  
    4848#define CTI_ARGS_code 0x0C
    4949#define CTI_ARGS_registerFile 0x0D
    50 #define CTI_ARGS_callFrame 0x0E
     50#define CTI_ARGS_r 0x0E
    5151#define CTI_ARGS_exception 0x0F
    5252#define CTI_ARGS_profilerReference 0x10
    5353#define CTI_ARGS_globalData 0x11
    5454#define ARG_registerFile ((RegisterFile*)(ARGS)[CTI_ARGS_registerFile])
    55 #define ARG_callFrame ((CallFrame*)(ARGS)[CTI_ARGS_callFrame])
     55#define ARG_r ((Register*)(ARGS)[CTI_ARGS_r])
    5656#define ARG_exception ((JSValue**)(ARGS)[CTI_ARGS_exception])
    5757#define ARG_profilerReference ((Profiler**)(ARGS)[CTI_ARGS_profilerReference])
    5858#define ARG_globalData ((JSGlobalData*)(ARGS)[CTI_ARGS_globalData])
    5959
    60 #define ARG_setCallFrame(newCallFrame) (*(CallFrame**)&(ARGS)[CTI_ARGS_callFrame] = (newCallFrame))
     60#define ARG_exec CallFrame::create(ARG_r)
     61
     62#define ARG_setR(newR) (*(Register**)&(ARGS)[CTI_ARGS_r] = newR)
    6163
    6264#define ARG_src1 ((JSValue*)((ARGS)[1]))
     
    9193
    9294    class CodeBlock;
     95    class ExecState;
    9396    class JSPropertyNameIterator;
    9497    class JSValue;
     
    247250
    248251    extern "C" {
    249         JSValue* ctiTrampoline(void* code, RegisterFile*, CallFrame*, JSValue** exception, Profiler**, JSGlobalData*);
     252        JSValue* ctiTrampoline(void* code, RegisterFile*, Register* callFrame, JSValue** exception, Profiler**, JSGlobalData*);
    250253        void ctiVMThrowTrampoline();
    251254    };
     
    281284
    282285    public:
    283         static void compile(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock)
    284         {
    285             CTI cti(machine, callFrame, codeBlock);
     286        static void compile(Machine* machine, ExecState* exec, CodeBlock* codeBlock)
     287        {
     288            CTI cti(machine, exec, codeBlock);
    286289            cti.privateCompile();
    287290        }
    288291
    289292#if ENABLE(WREC)
    290         static void* compileRegExp(Machine*, const UString& pattern, unsigned* numSubpatterns_ptr, const char** error_ptr, bool ignoreCase = false, bool multiline = false);
    291 #endif
    292 
    293         static void compileGetByIdSelf(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock, StructureID* structureID, size_t cachedOffset, void* returnAddress)
    294         {
    295             CTI cti(machine, callFrame, codeBlock);
     293        static void* compileRegExp(ExecState* exec, const UString& pattern, unsigned* numSubpatterns_ptr, const char** error_ptr, bool ignoreCase = false, bool multiline = false);
     294#endif
     295
     296        static void compileGetByIdSelf(Machine* machine, ExecState* exec, CodeBlock* codeBlock, StructureID* structureID, size_t cachedOffset, void* returnAddress)
     297        {
     298            CTI cti(machine, exec, codeBlock);
    296299            cti.privateCompileGetByIdSelf(structureID, cachedOffset, returnAddress);
    297300        }
    298301
    299         static void compileGetByIdProto(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock, StructureID* structureID, StructureID* prototypeStructureID, size_t cachedOffset, void* returnAddress)
    300         {
    301             CTI cti(machine, callFrame, codeBlock);
     302        static void compileGetByIdProto(Machine* machine, ExecState* exec, CodeBlock* codeBlock, StructureID* structureID, StructureID* prototypeStructureID, size_t cachedOffset, void* returnAddress)
     303        {
     304            CTI cti(machine, exec, codeBlock);
    302305            cti.privateCompileGetByIdProto(structureID, prototypeStructureID, cachedOffset, returnAddress);
    303306        }
    304307
    305         static void compileGetByIdChain(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock, StructureID* structureID, StructureIDChain* chain, size_t count, size_t cachedOffset, void* returnAddress)
    306         {
    307             CTI cti(machine, callFrame, codeBlock);
     308        static void compileGetByIdChain(Machine* machine, ExecState* exec, CodeBlock* codeBlock, StructureID* structureID, StructureIDChain* chain, size_t count, size_t cachedOffset, void* returnAddress)
     309        {
     310            CTI cti(machine, exec, codeBlock);
    308311            cti.privateCompileGetByIdChain(structureID, chain, count, cachedOffset, returnAddress);
    309312        }
    310313
    311         static void compilePutByIdReplace(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock, StructureID* structureID, size_t cachedOffset, void* returnAddress)
    312         {
    313             CTI cti(machine, callFrame, codeBlock);
     314        static void compilePutByIdReplace(Machine* machine, ExecState* exec, CodeBlock* codeBlock, StructureID* structureID, size_t cachedOffset, void* returnAddress)
     315        {
     316            CTI cti(machine, exec, codeBlock);
    314317            cti.privateCompilePutByIdReplace(structureID, cachedOffset, returnAddress);
    315318        }
    316319       
    317         static void compilePutByIdTransition(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock, StructureID* oldStructureID, StructureID* newStructureID, size_t cachedOffset, StructureIDChain* sIDC, void* returnAddress)
    318         {
    319             CTI cti(machine, callFrame, codeBlock);
     320        static void compilePutByIdTransition(Machine* machine, ExecState* exec, CodeBlock* codeBlock, StructureID* oldStructureID, StructureID* newStructureID, size_t cachedOffset, StructureIDChain* sIDC, void* returnAddress)
     321        {
     322            CTI cti(machine, exec, codeBlock);
    320323            cti.privateCompilePutByIdTransition(oldStructureID, newStructureID, cachedOffset, sIDC, returnAddress);
    321324        }
    322325
    323         static void* compileArrayLengthTrampoline(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock)
    324         {
    325             CTI cti(machine, callFrame, codeBlock);
     326        static void* compileArrayLengthTrampoline(Machine* machine, ExecState* exec, CodeBlock* codeBlock)
     327        {
     328            CTI cti(machine, exec, codeBlock);
    326329            return cti.privateCompileArrayLengthTrampoline();
    327330        }
    328331
    329         static void* compileStringLengthTrampoline(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock)
    330         {
    331             CTI cti(machine, callFrame, codeBlock);
     332        static void* compileStringLengthTrampoline(Machine* machine, ExecState* exec, CodeBlock* codeBlock)
     333        {
     334            CTI cti(machine, exec, codeBlock);
    332335            return cti.privateCompileStringLengthTrampoline();
    333336        }
     
    336339        static void patchPutByIdReplace(CodeBlock* codeBlock, StructureID* structureID, size_t cachedOffset, void* returnAddress);
    337340
    338         static void compilePatchGetArrayLength(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress)
    339         {
    340             CTI cti(machine, callFrame, codeBlock);
     341        static void compilePatchGetArrayLength(Machine* machine, ExecState* exec, CodeBlock* codeBlock, void* returnAddress)
     342        {
     343            CTI cti(machine, exec, codeBlock);
    341344            return cti.privateCompilePatchGetArrayLength(returnAddress);
    342345        }
    343346
    344         inline static JSValue* execute(void* code, RegisterFile* registerFile, CallFrame* callFrame, JSGlobalData* globalData, JSValue** exception)
    345         {
    346             return ctiTrampoline(code, registerFile, callFrame, exception, Profiler::enabledProfilerReference(), globalData);
     347        inline static JSValue* execute(void* code, RegisterFile* registerFile, Register* r, JSGlobalData* globalData, JSValue** exception)
     348        {
     349            return ctiTrampoline(code, registerFile, r, exception, Profiler::enabledProfilerReference(), globalData);
    347350        }
    348351
    349352    private:
    350         CTI(Machine*, CallFrame*, CodeBlock*);
     353        CTI(Machine*, ExecState*, CodeBlock*);
    351354       
    352355        bool isConstant(int src);
    353         JSValue* getConstant(CallFrame*, int src);
     356        JSValue* getConstant(ExecState*, int src);
    354357
    355358        void privateCompileMainPass();
     
    427430        X86Assembler m_jit;
    428431        Machine* m_machine;
    429         CallFrame* m_callFrame;
     432        ExecState* m_exec;
    430433        CodeBlock* m_codeBlock;
    431434
  • trunk/JavaScriptCore/VM/CodeBlock.h

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

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

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

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

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

    r37427 r37428  
    3535namespace JSC {
    3636
    37     class Arguments;
    3837    class CodeBlock;
    3938    class ExecState;
    40     class JSActivation;
    41     class JSFunction;
    4239    class JSPropertyNameIterator;
    4340    class JSValue;
    4441    class ScopeChainNode;
    45 
    4642    struct Instruction;
    47 
    48     typedef ExecState CallFrame;
    49 
     43   
    5044    static JSValue* const nullJSValue = 0;
    5145
     
    5549        Register(JSValue*);
    5650
    57         JSValue* jsValue(CallFrame*) const;
     51        JSValue* jsValue(ExecState*) const;
    5852        JSValue* getJSValue() const;
    5953
     
    6256       
    6357    private:
    64         friend class ExecState;
    6558        friend class Machine;
    6659
    67         // Only CallFrame and Machine should use these functions.
    68 
     60        // Only the Machine should use these functions.
     61
     62        Register(CodeBlock*);
     63        Register(ScopeChainNode*);
    6964        Register(intptr_t);
    70 
    71         Register(JSActivation*);
    72         Register(Arguments*);
    73         Register(CallFrame*);
    74         Register(CodeBlock*);
    75         Register(JSFunction*);
     65        Register(Register*);
     66        Register(Instruction*);
    7667        Register(JSPropertyNameIterator*);
    77         Register(ScopeChainNode*);
    78         Register(Instruction*);
    79 
     68        explicit Register(void*);
     69
     70        CodeBlock* codeBlock() const;
     71        ScopeChainNode* scopeChain() const;
    8072        intptr_t i() const;
     73        Register* r() const;
     74        Instruction* vPC() const;
     75        JSPropertyNameIterator* jsPropertyNameIterator() const;
    8176        void* v() const;
    8277
    83         JSActivation* activation() const;
    84         Arguments* arguments() const;
    85         CallFrame* callFrame() const;
    86         CodeBlock* codeBlock() const;
    87         JSFunction* function() const;
    88         JSPropertyNameIterator* propertyNameIterator() const;
    89         ScopeChainNode* scopeChain() const;
    90         Instruction* vPC() const;
    91 
    9278        union {
     79        private:
     80            friend class Register;
     81
     82            CodeBlock* codeBlock;
     83            Instruction* vPC;
     84            JSValue* jsValue;
     85            ScopeChainNode* scopeChain;
     86            JSPropertyNameIterator* jsPropertyNameIterator;
     87            Register* r;
     88            void* v;
    9389            intptr_t i;
    94             void* v;
    95             JSValue* value;
    96 
    97             JSActivation* activation;
    98             Arguments* arguments;
    99             CallFrame* callFrame;
    100             CodeBlock* codeBlock;
    101             JSFunction* function;
    102             JSPropertyNameIterator* propertyNameIterator;
    103             ScopeChainNode* scopeChain;
    104             Instruction* vPC;
    10590        } u;
    10691
    10792#ifndef NDEBUG
    10893        enum {
    109             EmptyType,
    110 
    111             IntType,
    112             ValueType,
    113 
    114             ActivationType,
    115             ArgumentsType,
    116             CallFrameType,
    117             CodeBlockType,
    118             FunctionType,
    119             InstructionType,
    120             PropertyNameIteratorType,
    121             RegisterType,
    122             ScopeChainNodeType
     94            CodeBlockType = 0,
     95            InstructionType,
     96            JSValueType,
     97            ScopeChainNodeType,
     98            JSPropertyNameIteratorType,
     99            RegisterType,
     100            IntType
    123101        } m_type;
    124102#endif
     103
     104// FIXME: The commented out ASSERTs below are valid; NDEBUG CTI should set these when up to date.
     105//        static inline ptrdiff_t offsetOf_type()
     106//        {
     107//            return OBJECT_OFFSET(Register, m_type);
     108//        }
    125109    };
    126110
    127 #ifndef NDEBUG
    128     #define SET_TYPE(type) m_type = (type)
    129     // FIXME: The CTI code to put value into registers doesn't set m_type.
    130     // Once it does, we can turn this assertion back on.
    131     #define ASSERT_TYPE(type)
    132 #else
    133     #define SET_TYPE(type)
    134     #define ASSERT_TYPE(type)
    135 #endif
    136 
    137111    ALWAYS_INLINE Register::Register()
    138112    {
    139113#ifndef NDEBUG
    140         SET_TYPE(EmptyType);
    141114        *this = nullJSValue;
    142115#endif
     
    145118    ALWAYS_INLINE Register::Register(JSValue* v)
    146119    {
    147         SET_TYPE(ValueType);
    148         u.value = v;
     120#ifndef NDEBUG
     121        m_type = JSValueType;
     122#endif
     123        u.jsValue = v;
    149124    }
    150125   
    151126    // This function is scaffolding for legacy clients. It will eventually go away.
    152     ALWAYS_INLINE JSValue* Register::jsValue(CallFrame*) const
     127    ALWAYS_INLINE JSValue* Register::jsValue(ExecState*) const
    153128    {
    154129        // Once registers hold doubles, this function will allocate a JSValue*
    155130        // if the register doesn't hold one already.
    156         ASSERT_TYPE(ValueType);
    157         return u.value;
     131//        ASSERT(m_type == JSValueType);
     132        return u.jsValue;
    158133    }
    159134   
    160135    ALWAYS_INLINE JSValue* Register::getJSValue() const
    161136    {
    162         ASSERT_TYPE(JSValueType);
    163         return u.value;
     137//        ASSERT(m_type == JSValueType);
     138        return u.jsValue;
    164139    }
    165140   
     
    176151    // Machine functions
    177152
    178     ALWAYS_INLINE Register::Register(Arguments* arguments)
    179     {
    180         SET_TYPE(ArgumentsType);
    181         u.arguments = arguments;
    182     }
    183 
    184     ALWAYS_INLINE Register::Register(JSActivation* activation)
    185     {
    186         SET_TYPE(ActivationType);
    187         u.activation = activation;
    188     }
    189 
    190     ALWAYS_INLINE Register::Register(CallFrame* callFrame)
    191     {
    192         SET_TYPE(CallFrameType);
    193         u.callFrame = callFrame;
    194     }
    195 
    196153    ALWAYS_INLINE Register::Register(CodeBlock* codeBlock)
    197154    {
    198         SET_TYPE(CodeBlockType);
     155#ifndef NDEBUG
     156        m_type = CodeBlockType;
     157#endif
    199158        u.codeBlock = codeBlock;
    200159    }
    201160
    202     ALWAYS_INLINE Register::Register(JSFunction* function)
    203     {
    204         SET_TYPE(FunctionType);
    205         u.function = function;
    206     }
    207 
    208161    ALWAYS_INLINE Register::Register(Instruction* vPC)
    209162    {
    210         SET_TYPE(InstructionType);
     163#ifndef NDEBUG
     164        m_type = InstructionType;
     165#endif
    211166        u.vPC = vPC;
    212167    }
     
    214169    ALWAYS_INLINE Register::Register(ScopeChainNode* scopeChain)
    215170    {
    216         SET_TYPE(ScopeChainNodeType);
     171#ifndef NDEBUG
     172        m_type = ScopeChainNodeType;
     173#endif
    217174        u.scopeChain = scopeChain;
    218175    }
    219176
    220     ALWAYS_INLINE Register::Register(JSPropertyNameIterator* propertyNameIterator)
    221     {
    222         SET_TYPE(PropertyNameIteratorType);
    223         u.propertyNameIterator = propertyNameIterator;
     177    ALWAYS_INLINE Register::Register(JSPropertyNameIterator* jsPropertyNameIterator)
     178    {
     179#ifndef NDEBUG
     180        m_type = JSPropertyNameIteratorType;
     181#endif
     182        u.jsPropertyNameIterator = jsPropertyNameIterator;
     183    }
     184
     185    ALWAYS_INLINE Register::Register(Register* r)
     186    {
     187#ifndef NDEBUG
     188        m_type = RegisterType;
     189#endif
     190        u.r = r;
    224191    }
    225192
    226193    ALWAYS_INLINE Register::Register(intptr_t i)
    227194    {
    228         SET_TYPE(IntType);
     195#ifndef NDEBUG
     196        m_type = IntType;
     197#endif
    229198        u.i = i;
    230199    }
    231200
     201    ALWAYS_INLINE Register::Register(void* v)
     202    {
     203        u.v = v;
     204    }
     205
     206    ALWAYS_INLINE CodeBlock* Register::codeBlock() const
     207    {
     208//        ASSERT(m_type == CodeBlockType);
     209        return u.codeBlock;
     210    }
     211   
     212    ALWAYS_INLINE ScopeChainNode* Register::scopeChain() const
     213    {
     214//        ASSERT(m_type == ScopeChainNodeType);
     215        return u.scopeChain;
     216    }
     217   
    232218    ALWAYS_INLINE intptr_t Register::i() const
    233219    {
    234         ASSERT_TYPE(IntType);
     220//        ASSERT(m_type == IntType);
    235221        return u.i;
    236222    }
    237223   
     224    ALWAYS_INLINE Register* Register::r() const
     225    {
     226//        ASSERT(m_type == RegisterType);
     227        return u.r;
     228    }
     229   
     230    ALWAYS_INLINE Instruction* Register::vPC() const
     231    {
     232//        ASSERT(m_type == InstructionType);
     233        return u.vPC;
     234    }
     235   
     236    ALWAYS_INLINE JSPropertyNameIterator* Register::jsPropertyNameIterator() const
     237    {
     238//        ASSERT(m_type == JSPropertyNameIteratorType);
     239        return u.jsPropertyNameIterator;
     240    }
     241   
    238242    ALWAYS_INLINE void* Register::v() const
    239243    {
     
    241245    }
    242246
    243     ALWAYS_INLINE JSActivation* Register::activation() const
    244     {
    245         ASSERT_TYPE(ActivationType);
    246         return u.activation;
    247     }
    248    
    249     ALWAYS_INLINE Arguments* Register::arguments() const
    250     {
    251         ASSERT_TYPE(ArgumentsType);
    252         return u.arguments;
    253     }
    254    
    255     ALWAYS_INLINE CallFrame* Register::callFrame() const
    256     {
    257         ASSERT_TYPE(CallFrameType);
    258         return u.callFrame;
    259     }
    260    
    261     ALWAYS_INLINE CodeBlock* Register::codeBlock() const
    262     {
    263         ASSERT_TYPE(CodeBlockType);
    264         return u.codeBlock;
    265     }
    266    
    267     ALWAYS_INLINE JSFunction* Register::function() const
    268     {
    269         ASSERT_TYPE(FunctionType);
    270         return u.function;
    271     }
    272    
    273     ALWAYS_INLINE JSPropertyNameIterator* Register::propertyNameIterator() const
    274     {
    275         ASSERT_TYPE(PropertyNameIteratorType);
    276         return u.propertyNameIterator;
    277     }
    278    
    279     ALWAYS_INLINE ScopeChainNode* Register::scopeChain() const
    280     {
    281         ASSERT_TYPE(ScopeChainNodeType);
    282         return u.scopeChain;
    283     }
    284    
    285     ALWAYS_INLINE Instruction* Register::vPC() const
    286     {
    287         ASSERT_TYPE(InstructionType);
    288         return u.vPC;
    289     }
    290 
    291     #undef SET_TYPE
    292     #undef ASSERT_TYPE
    293 
    294247} // namespace JSC
    295248
  • trunk/JavaScriptCore/VM/RegisterFile.h

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

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

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

    r37427 r37428  
    3030#define DebuggerCallFrame_h
    3131
    32 #include "ExecState.h"
    33 
    3432namespace JSC {
     33   
     34    class CodeBlock;
     35    class ExecState;
     36    class JSGlobalObject;
     37    class JSObject;
     38    class JSValue;
     39    class Machine;
     40    class UString;
     41    class Register;
     42    class ScopeChainNode;
    3543   
    3644    class DebuggerCallFrame {
    3745    public:
    38         enum Type { ProgramType, FunctionType };
     46        enum Type {
     47            ProgramType,
     48            FunctionType
     49        };
    3950
    40         DebuggerCallFrame(CallFrame* callFrame, JSValue* exception)
    41             : m_callFrame(callFrame)
     51        DebuggerCallFrame(JSGlobalObject* dynamicGlobalObject, const CodeBlock* codeBlock, ScopeChainNode* scopeChain, Register* r, JSValue* exception)
     52            : m_dynamicGlobalObject(dynamicGlobalObject)
     53            , m_codeBlock(codeBlock)
     54            , m_scopeChain(scopeChain)
     55            , m_registers(r)
    4256            , m_exception(exception)
    4357        {
    4458        }
    4559
    46         JSGlobalObject* dynamicGlobalObject() const { return m_callFrame->dynamicGlobalObject(); }
    47         const ScopeChainNode* scopeChain() const { return m_callFrame->scopeChain(); }
     60        JSGlobalObject* dynamicGlobalObject() const { return m_dynamicGlobalObject; }
     61        const ScopeChainNode* scopeChain() const { return m_scopeChain; }
    4862        const UString* functionName() const;
    4963        Type type() const;
     
    5367
    5468    private:
    55         CallFrame* m_callFrame;
     69        JSGlobalObject* m_dynamicGlobalObject;
     70        const CodeBlock* m_codeBlock;
     71        ScopeChainNode* m_scopeChain;
     72        Register* m_registers;
    5673        JSValue* m_exception;
    5774    };
  • trunk/JavaScriptCore/kjs/ExecState.cpp

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    r37427 r37428  
    3333namespace JSC {
    3434
    35 inline RegExp::RegExp(JSGlobalData* globalData, const UString& pattern)
     35
     36
     37inline RegExp::RegExp(ExecState* exec, const UString& pattern)
    3638    : m_pattern(pattern)
    3739    , m_flagBits(0)
     
    4143{
    4244#if ENABLE(WREC)
    43     m_wrecFunction = reinterpret_cast<WRECFunction>(CTI::compileRegExp(globalData->machine, pattern, &m_numSubpatterns, &m_constructionError));
    44     if (m_wrecFunction)
    45         return;
    46     // Fall through to non-WREC case.
     45    if (!(m_wrecFunction = (WRECFunction)CTI::compileRegExp(exec, pattern, &m_numSubpatterns, &m_constructionError)))
    4746#else
    48     UNUSED_PARAM(globalData);
     47    UNUSED_PARAM(exec);
    4948#endif
    50     m_regExp = jsRegExpCompile(reinterpret_cast<const UChar*>(pattern.data()), pattern.size(),
    51         JSRegExpDoNotIgnoreCase, JSRegExpSingleLine, &m_numSubpatterns, &m_constructionError);
     49    {
     50        m_regExp = jsRegExpCompile(reinterpret_cast<const UChar*>(pattern.data()), pattern.size(),
     51            JSRegExpDoNotIgnoreCase, JSRegExpSingleLine, &m_numSubpatterns, &m_constructionError);
     52    }
    5253}
    5354
    54 PassRefPtr<RegExp> RegExp::create(JSGlobalData* globalData, const UString& pattern)
     55PassRefPtr<RegExp> RegExp::create(ExecState* exec, const UString& pattern)
    5556{
    56     return adoptRef(new RegExp(globalData, pattern));
     57    return adoptRef(new RegExp(exec, pattern));
    5758}
    5859
    59 inline RegExp::RegExp(JSGlobalData* globalData, const UString& pattern, const UString& flags)
     60inline RegExp::RegExp(ExecState* exec, const UString& pattern, const UString& flags)
    6061    : m_pattern(pattern)
    6162    , m_flags(flags)
     
    8485
    8586#if ENABLE(WREC)
    86     m_wrecFunction = reinterpret_cast<WRECFunction>(CTI::compileRegExp(globalData->machine, pattern, &m_numSubpatterns, &m_constructionError, (m_flagBits & IgnoreCase), (m_flagBits & Multiline)));
    87     if (m_wrecFunction)
    88         return;
    89     // Fall through to non-WREC case.
     87    if (!(m_wrecFunction = (WRECFunction)CTI::compileRegExp(exec, pattern, &m_numSubpatterns, &m_constructionError, (m_flagBits & IgnoreCase), (m_flagBits & Multiline))))
    9088#else
    91     UNUSED_PARAM(globalData);
     89    UNUSED_PARAM(exec);
    9290#endif
    93     m_regExp = jsRegExpCompile(reinterpret_cast<const UChar*>(pattern.data()), pattern.size(),
    94         ignoreCaseOption, multilineOption, &m_numSubpatterns, &m_constructionError);
     91    {
     92        m_regExp = jsRegExpCompile(reinterpret_cast<const UChar*>(pattern.data()), pattern.size(),
     93            ignoreCaseOption, multilineOption, &m_numSubpatterns, &m_constructionError);
     94    }
    9595}
    9696
    97 PassRefPtr<RegExp> RegExp::create(JSGlobalData* globalData, const UString& pattern, const UString& flags)
     97PassRefPtr<RegExp> RegExp::create(ExecState* exec, const UString& pattern, const UString& flags)
    9898{
    99     return adoptRef(new RegExp(globalData, pattern, flags));
     99    return adoptRef(new RegExp(exec, pattern, flags));
    100100}
    101101
  • trunk/JavaScriptCore/kjs/regexp.h

    r37427 r37428  
    2323
    2424#include "ustring.h"
     25#include "ExecState.h"
    2526#include <wtf/Forward.h>
    2627#include <wtf/RefCounted.h>
     
    3132namespace JSC {
    3233
    33     class JSGlobalData;
    34 
    3534    class RegExp : public RefCounted<RegExp> {
    3635    public:
    37         static PassRefPtr<RegExp> create(JSGlobalData*, const UString& pattern);
    38         static PassRefPtr<RegExp> create(JSGlobalData*, const UString& pattern, const UString& flags);
     36        static PassRefPtr<RegExp> create(ExecState*, const UString& pattern);
     37        static PassRefPtr<RegExp> create(ExecState*, const UString& pattern, const UString& flags);
    3938        ~RegExp();
    4039
     
    5352
    5453    private:
    55         RegExp(JSGlobalData*, const UString& pattern);
    56         RegExp(JSGlobalData*, const UString& pattern, const UString& flags);
     54        RegExp(ExecState*, const UString& pattern);
     55        RegExp(ExecState*, const UString& pattern, const UString& flags);
    5756
    5857        void compile();
  • trunk/JavaScriptCore/profiler/HeavyProfile.h

    r37427 r37428  
    3333namespace JSC {
    3434
     35    class ExecState;
    3536    class UString;
    3637
  • trunk/JavaScriptCore/profiler/Profile.h

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

    r37427 r37428  
    3030
    3131#include "CharacterClassConstructor.h"
     32#include "ExecState.h"
    3233#include "Machine.h"
    3334#include "pcre_internal.h"
  • trunk/JavaScriptCore/wrec/WREC.h

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

    r37427 r37428  
     12008-10-08  Timothy Hatcher  <timothy@apple.com>
     2
     3        Roll out r37427 because it causes an infinite recursion loading about:blank.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=21476
     6
    172008-10-08  Darin Adler  <darin@apple.com>
    28
  • trunk/WebKit/mac/WebView/WebScriptDebugger.mm

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