diff options
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp')
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp | 562 |
1 files changed, 265 insertions, 297 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp index 7b1e547..ed7e1ee 100644 --- a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp @@ -65,10 +65,6 @@ #include "JIT.h" #endif -#if ENABLE(ASSEMBLER) -#include "AssemblerBuffer.h" -#endif - using namespace std; namespace JSC { @@ -112,7 +108,7 @@ NEVER_INLINE bool Interpreter::resolve(CallFrame* callFrame, Instruction* vPC, J exceptionValue = callFrame->globalData().exception; if (exceptionValue) return false; - callFrame[dst] = JSValue(result); + callFrame->r(dst) = JSValue(result); return true; } } while (++iter != end); @@ -145,7 +141,7 @@ NEVER_INLINE bool Interpreter::resolveSkip(CallFrame* callFrame, Instruction* vP exceptionValue = callFrame->globalData().exception; if (exceptionValue) return false; - callFrame[dst] = JSValue(result); + callFrame->r(dst) = JSValue(result); return true; } } while (++iter != end); @@ -163,7 +159,7 @@ NEVER_INLINE bool Interpreter::resolveGlobal(CallFrame* callFrame, Instruction* int offset = (vPC + 5)->u.operand; if (structure == globalObject->structure()) { - callFrame[dst] = JSValue(globalObject->getDirectOffset(offset)); + callFrame->r(dst) = JSValue(globalObject->getDirectOffset(offset)); return true; } @@ -178,14 +174,14 @@ NEVER_INLINE bool Interpreter::resolveGlobal(CallFrame* callFrame, Instruction* globalObject->structure()->ref(); vPC[4] = globalObject->structure(); vPC[5] = slot.cachedOffset(); - callFrame[dst] = JSValue(result); + callFrame->r(dst) = JSValue(result); return true; } exceptionValue = callFrame->globalData().exception; if (exceptionValue) return false; - callFrame[dst] = JSValue(result); + callFrame->r(dst) = JSValue(result); return true; } @@ -197,7 +193,7 @@ NEVER_INLINE void Interpreter::resolveBase(CallFrame* callFrame, Instruction* vP { int dst = (vPC + 1)->u.operand; int property = (vPC + 2)->u.operand; - callFrame[dst] = JSValue(JSC::resolveBase(callFrame, callFrame->codeBlock()->identifier(property), callFrame->scopeChain())); + callFrame->r(dst) = JSValue(JSC::resolveBase(callFrame, callFrame->codeBlock()->identifier(property), callFrame->scopeChain())); } NEVER_INLINE bool Interpreter::resolveBaseAndProperty(CallFrame* callFrame, Instruction* vPC, JSValue& exceptionValue) @@ -225,8 +221,8 @@ NEVER_INLINE bool Interpreter::resolveBaseAndProperty(CallFrame* callFrame, Inst exceptionValue = callFrame->globalData().exception; if (exceptionValue) return false; - callFrame[propDst] = JSValue(result); - callFrame[baseDst] = JSValue(base); + callFrame->r(propDst) = JSValue(result); + callFrame->r(baseDst) = JSValue(base); return true; } ++iter; @@ -270,8 +266,8 @@ NEVER_INLINE bool Interpreter::resolveBaseAndFunc(CallFrame* callFrame, Instruct if (exceptionValue) return false; - callFrame[baseDst] = JSValue(thisObj); - callFrame[funcDst] = JSValue(result); + callFrame->r(baseDst) = JSValue(thisObj); + callFrame->r(funcDst) = JSValue(result); return true; } ++iter; @@ -436,17 +432,7 @@ void Interpreter::dumpRegisters(CallFrame* callFrame) } printf("----------------------------------------------------\n"); - end = it + codeBlock->m_numConstants; - if (it != end) { - do { - printf("[r%2d] | %10p | %10p \n", registerCount, it, (*it).v()); - ++it; - ++registerCount; - } while (it != end); - } - printf("----------------------------------------------------\n"); - - end = it + codeBlock->m_numCalleeRegisters - codeBlock->m_numConstants - codeBlock->m_numVars; + end = it + codeBlock->m_numCalleeRegisters - codeBlock->m_numVars; if (it != end) { do { printf("[r%2d] | %10p | %10p \n", registerCount, it, (*it).v()); @@ -567,13 +553,13 @@ NEVER_INLINE HandlerInfo* Interpreter::throwException(CallFrame*& callFrame, JSV if (Profiler* profiler = *Profiler::enabledProfilerReference()) { #if !ENABLE(JIT) if (isCallBytecode(codeBlock->instructions()[bytecodeOffset].u.opcode)) - profiler->didExecute(callFrame, callFrame[codeBlock->instructions()[bytecodeOffset + 2].u.operand].jsValue()); + profiler->didExecute(callFrame, callFrame->r(codeBlock->instructions()[bytecodeOffset + 2].u.operand).jsValue()); else if (codeBlock->instructions()[bytecodeOffset + 8].u.opcode == getOpcode(op_construct)) - profiler->didExecute(callFrame, callFrame[codeBlock->instructions()[bytecodeOffset + 10].u.operand].jsValue()); + profiler->didExecute(callFrame, callFrame->r(codeBlock->instructions()[bytecodeOffset + 10].u.operand).jsValue()); #else int functionRegisterIndex; if (codeBlock->functionRegisterForBytecodeOffset(bytecodeOffset, functionRegisterIndex)) - profiler->didExecute(callFrame, callFrame[functionRegisterIndex].jsValue()); + profiler->didExecute(callFrame, callFrame->r(functionRegisterIndex).jsValue()); #endif } @@ -625,7 +611,7 @@ JSValue Interpreter::execute(ProgramNode* programNode, CallFrame* callFrame, Sco globalObject->copyGlobalsTo(m_registerFile); CallFrame* newCallFrame = CallFrame::create(oldEnd + codeBlock->m_numParameters + RegisterFile::CallFrameHeaderSize); - newCallFrame[codeBlock->thisRegister()] = JSValue(thisObj); + newCallFrame->r(codeBlock->thisRegister()) = JSValue(thisObj); newCallFrame->init(codeBlock, 0, scopeChain, CallFrame::noCaller(), 0, 0, 0); if (codeBlock->needsFullScopeChain()) @@ -682,10 +668,10 @@ JSValue Interpreter::execute(FunctionBodyNode* functionBodyNode, CallFrame* call CallFrame* newCallFrame = CallFrame::create(oldEnd); size_t dst = 0; - newCallFrame[0] = JSValue(thisObj); + newCallFrame->r(0) = JSValue(thisObj); ArgList::const_iterator end = args.end(); for (ArgList::const_iterator it = args.begin(); it != end; ++it) - newCallFrame[++dst] = *it; + newCallFrame->r(++dst) = *it; CodeBlock* codeBlock = &functionBodyNode->bytecode(scopeChain); newCallFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc); @@ -743,7 +729,7 @@ CallFrameClosure Interpreter::prepareForRepeatCall(FunctionBodyNode* functionBod CallFrame* newCallFrame = CallFrame::create(oldEnd); size_t dst = 0; for (int i = 0; i < argc; ++i) - newCallFrame[++dst] = jsUndefined(); + newCallFrame->r(++dst) = jsUndefined(); CodeBlock* codeBlock = &functionBodyNode->bytecode(scopeChain); newCallFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc); @@ -854,7 +840,7 @@ JSValue Interpreter::execute(EvalNode* evalNode, CallFrame* callFrame, JSObject* CallFrame* newCallFrame = CallFrame::create(m_registerFile.start() + globalRegisterOffset); // a 0 codeBlock indicates a built-in caller - newCallFrame[codeBlock->thisRegister()] = JSValue(thisObj); + newCallFrame->r(codeBlock->thisRegister()) = JSValue(thisObj); newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), 0, 0, 0); if (codeBlock->needsFullScopeChain()) @@ -918,9 +904,9 @@ NEVER_INLINE ScopeChainNode* Interpreter::createExceptionScope(CallFrame* callFr int dst = (++vPC)->u.operand; CodeBlock* codeBlock = callFrame->codeBlock(); Identifier& property = codeBlock->identifier((++vPC)->u.operand); - JSValue value = callFrame[(++vPC)->u.operand].jsValue(); + JSValue value = callFrame->r((++vPC)->u.operand).jsValue(); JSObject* scope = new (callFrame) JSStaticScopeObject(callFrame, property, value, DontDelete); - callFrame[dst] = JSValue(scope); + callFrame->r(dst) = JSValue(scope); return callFrame->scopeChain()->push(scope); } @@ -1197,7 +1183,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi constructor, and puts the result in register dst. */ int dst = (++vPC)->u.operand; - callFrame[dst] = JSValue(constructEmptyObject(callFrame)); + callFrame->r(dst) = JSValue(constructEmptyObject(callFrame)); ++vPC; NEXT_INSTRUCTION(); @@ -1214,7 +1200,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int firstArg = (++vPC)->u.operand; int argCount = (++vPC)->u.operand; ArgList args(callFrame->registers() + firstArg, argCount); - callFrame[dst] = JSValue(constructArray(callFrame, args)); + callFrame->r(dst) = JSValue(constructArray(callFrame, args)); ++vPC; NEXT_INSTRUCTION(); @@ -1228,7 +1214,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int dst = (++vPC)->u.operand; int regExp = (++vPC)->u.operand; - callFrame[dst] = JSValue(new (globalData) RegExpObject(callFrame->scopeChain()->globalObject()->regExpStructure(), callFrame->codeBlock()->regexp(regExp))); + callFrame->r(dst) = JSValue(new (globalData) RegExpObject(callFrame->scopeChain()->globalObject()->regExpStructure(), callFrame->codeBlock()->regexp(regExp))); ++vPC; NEXT_INSTRUCTION(); @@ -1240,7 +1226,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int dst = (++vPC)->u.operand; int src = (++vPC)->u.operand; - callFrame[dst] = callFrame[src]; + callFrame->r(dst) = callFrame->r(src); ++vPC; NEXT_INSTRUCTION(); @@ -1253,14 +1239,14 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi as a boolean in register dst. */ int dst = (++vPC)->u.operand; - JSValue src1 = callFrame[(++vPC)->u.operand].jsValue(); - JSValue src2 = callFrame[(++vPC)->u.operand].jsValue(); + JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue(); + JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue(); if (JSFastMath::canDoFastBitwiseOperations(src1, src2)) - callFrame[dst] = JSFastMath::equal(src1, src2); + callFrame->r(dst) = JSFastMath::equal(src1, src2); else { JSValue result = jsBoolean(JSValue::equalSlowCase(callFrame, src1, src2)); CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; } ++vPC; @@ -1273,15 +1259,15 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi operator, and puts the result as a boolean in register dst. */ int dst = (++vPC)->u.operand; - JSValue src = callFrame[(++vPC)->u.operand].jsValue(); + JSValue src = callFrame->r((++vPC)->u.operand).jsValue(); if (src.isUndefinedOrNull()) { - callFrame[dst] = jsBoolean(true); + callFrame->r(dst) = jsBoolean(true); ++vPC; NEXT_INSTRUCTION(); } - callFrame[dst] = jsBoolean(src.isCell() && src.asCell()->structure()->typeInfo().masqueradesAsUndefined()); + callFrame->r(dst) = jsBoolean(src.isCell() && src.asCell()->structure()->typeInfo().masqueradesAsUndefined()); ++vPC; NEXT_INSTRUCTION(); } @@ -1293,14 +1279,14 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi result as a boolean in register dst. */ int dst = (++vPC)->u.operand; - JSValue src1 = callFrame[(++vPC)->u.operand].jsValue(); - JSValue src2 = callFrame[(++vPC)->u.operand].jsValue(); + JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue(); + JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue(); if (JSFastMath::canDoFastBitwiseOperations(src1, src2)) - callFrame[dst] = JSFastMath::notEqual(src1, src2); + callFrame->r(dst) = JSFastMath::notEqual(src1, src2); else { JSValue result = jsBoolean(!JSValue::equalSlowCase(callFrame, src1, src2)); CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; } ++vPC; @@ -1313,15 +1299,15 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi operator, and puts the result as a boolean in register dst. */ int dst = (++vPC)->u.operand; - JSValue src = callFrame[(++vPC)->u.operand].jsValue(); + JSValue src = callFrame->r((++vPC)->u.operand).jsValue(); if (src.isUndefinedOrNull()) { - callFrame[dst] = jsBoolean(false); + callFrame->r(dst) = jsBoolean(false); ++vPC; NEXT_INSTRUCTION(); } - callFrame[dst] = jsBoolean(!src.isCell() || !asCell(src)->structure()->typeInfo().masqueradesAsUndefined()); + callFrame->r(dst) = jsBoolean(!src.isCell() || !asCell(src)->structure()->typeInfo().masqueradesAsUndefined()); ++vPC; NEXT_INSTRUCTION(); } @@ -1333,9 +1319,9 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi result as a boolean in register dst. */ int dst = (++vPC)->u.operand; - JSValue src1 = callFrame[(++vPC)->u.operand].jsValue(); - JSValue src2 = callFrame[(++vPC)->u.operand].jsValue(); - callFrame[dst] = jsBoolean(JSValue::strictEqual(src1, src2)); + JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue(); + JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue(); + callFrame->r(dst) = jsBoolean(JSValue::strictEqual(src1, src2)); ++vPC; NEXT_INSTRUCTION(); @@ -1348,9 +1334,9 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi puts the result as a boolean in register dst. */ int dst = (++vPC)->u.operand; - JSValue src1 = callFrame[(++vPC)->u.operand].jsValue(); - JSValue src2 = callFrame[(++vPC)->u.operand].jsValue(); - callFrame[dst] = jsBoolean(!JSValue::strictEqual(src1, src2)); + JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue(); + JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue(); + callFrame->r(dst) = jsBoolean(!JSValue::strictEqual(src1, src2)); ++vPC; NEXT_INSTRUCTION(); @@ -1363,11 +1349,11 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi a boolean in register dst. */ int dst = (++vPC)->u.operand; - JSValue src1 = callFrame[(++vPC)->u.operand].jsValue(); - JSValue src2 = callFrame[(++vPC)->u.operand].jsValue(); + JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue(); + JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue(); JSValue result = jsBoolean(jsLess(callFrame, src1, src2)); CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; ++vPC; NEXT_INSTRUCTION(); @@ -1380,11 +1366,11 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi puts the result as a boolean in register dst. */ int dst = (++vPC)->u.operand; - JSValue src1 = callFrame[(++vPC)->u.operand].jsValue(); - JSValue src2 = callFrame[(++vPC)->u.operand].jsValue(); + JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue(); + JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue(); JSValue result = jsBoolean(jsLessEq(callFrame, src1, src2)); CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; ++vPC; NEXT_INSTRUCTION(); @@ -1396,13 +1382,13 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi back in register srcDst. */ int srcDst = (++vPC)->u.operand; - JSValue v = callFrame[srcDst].jsValue(); + JSValue v = callFrame->r(srcDst).jsValue(); if (JSFastMath::canDoFastAdditiveOperations(v)) - callFrame[srcDst] = JSValue(JSFastMath::incImmediateNumber(v)); + callFrame->r(srcDst) = JSValue(JSFastMath::incImmediateNumber(v)); else { JSValue result = jsNumber(callFrame, v.toNumber(callFrame) + 1); CHECK_FOR_EXCEPTION(); - callFrame[srcDst] = result; + callFrame->r(srcDst) = result; } ++vPC; @@ -1415,13 +1401,13 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi back in register srcDst. */ int srcDst = (++vPC)->u.operand; - JSValue v = callFrame[srcDst].jsValue(); + JSValue v = callFrame->r(srcDst).jsValue(); if (JSFastMath::canDoFastAdditiveOperations(v)) - callFrame[srcDst] = JSValue(JSFastMath::decImmediateNumber(v)); + callFrame->r(srcDst) = JSValue(JSFastMath::decImmediateNumber(v)); else { JSValue result = jsNumber(callFrame, v.toNumber(callFrame) - 1); CHECK_FOR_EXCEPTION(); - callFrame[srcDst] = result; + callFrame->r(srcDst) = result; } ++vPC; @@ -1436,15 +1422,15 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int dst = (++vPC)->u.operand; int srcDst = (++vPC)->u.operand; - JSValue v = callFrame[srcDst].jsValue(); + JSValue v = callFrame->r(srcDst).jsValue(); if (JSFastMath::canDoFastAdditiveOperations(v)) { - callFrame[dst] = v; - callFrame[srcDst] = JSValue(JSFastMath::incImmediateNumber(v)); + callFrame->r(dst) = v; + callFrame->r(srcDst) = JSValue(JSFastMath::incImmediateNumber(v)); } else { - JSValue number = callFrame[srcDst].jsValue().toJSNumber(callFrame); + JSValue number = callFrame->r(srcDst).jsValue().toJSNumber(callFrame); CHECK_FOR_EXCEPTION(); - callFrame[dst] = number; - callFrame[srcDst] = JSValue(jsNumber(callFrame, number.uncheckedGetNumber() + 1)); + callFrame->r(dst) = number; + callFrame->r(srcDst) = JSValue(jsNumber(callFrame, number.uncheckedGetNumber() + 1)); } ++vPC; @@ -1459,15 +1445,15 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int dst = (++vPC)->u.operand; int srcDst = (++vPC)->u.operand; - JSValue v = callFrame[srcDst].jsValue(); + JSValue v = callFrame->r(srcDst).jsValue(); if (JSFastMath::canDoFastAdditiveOperations(v)) { - callFrame[dst] = v; - callFrame[srcDst] = JSValue(JSFastMath::decImmediateNumber(v)); + callFrame->r(dst) = v; + callFrame->r(srcDst) = JSValue(JSFastMath::decImmediateNumber(v)); } else { - JSValue number = callFrame[srcDst].jsValue().toJSNumber(callFrame); + JSValue number = callFrame->r(srcDst).jsValue().toJSNumber(callFrame); CHECK_FOR_EXCEPTION(); - callFrame[dst] = number; - callFrame[srcDst] = JSValue(jsNumber(callFrame, number.uncheckedGetNumber() - 1)); + callFrame->r(dst) = number; + callFrame->r(srcDst) = JSValue(jsNumber(callFrame, number.uncheckedGetNumber() - 1)); } ++vPC; @@ -1482,14 +1468,14 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int dst = (++vPC)->u.operand; int src = (++vPC)->u.operand; - JSValue srcVal = callFrame[src].jsValue(); + JSValue srcVal = callFrame->r(src).jsValue(); if (LIKELY(srcVal.isNumber())) - callFrame[dst] = callFrame[src]; + callFrame->r(dst) = callFrame->r(src); else { JSValue result = srcVal.toJSNumber(callFrame); CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; } ++vPC; @@ -1502,15 +1488,15 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi result in register dst. */ int dst = (++vPC)->u.operand; - JSValue src = callFrame[(++vPC)->u.operand].jsValue(); + JSValue src = callFrame->r((++vPC)->u.operand).jsValue(); ++vPC; double v; if (src.getNumber(v)) - callFrame[dst] = JSValue(jsNumber(callFrame, -v)); + callFrame->r(dst) = JSValue(jsNumber(callFrame, -v)); else { JSValue result = jsNumber(callFrame, -src.toNumber(callFrame)); CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; } NEXT_INSTRUCTION(); @@ -1523,14 +1509,14 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi numeric add, depending on the types of the operands.) */ int dst = (++vPC)->u.operand; - JSValue src1 = callFrame[(++vPC)->u.operand].jsValue(); - JSValue src2 = callFrame[(++vPC)->u.operand].jsValue(); + JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue(); + JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue(); if (JSFastMath::canDoFastAdditiveOperations(src1, src2)) - callFrame[dst] = JSValue(JSFastMath::addImmediateNumbers(src1, src2)); + callFrame->r(dst) = JSValue(JSFastMath::addImmediateNumbers(src1, src2)); else { JSValue result = jsAdd(callFrame, src1, src2); CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; } vPC += 2; NEXT_INSTRUCTION(); @@ -1542,23 +1528,23 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi numbers), and puts the product in register dst. */ int dst = (++vPC)->u.operand; - JSValue src1 = callFrame[(++vPC)->u.operand].jsValue(); - JSValue src2 = callFrame[(++vPC)->u.operand].jsValue(); + JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue(); + JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue(); double left; double right; if (JSValue::areBothInt32Fast(src1, src2)) { int32_t left = src1.getInt32Fast(); int32_t right = src2.getInt32Fast(); if ((left | right) >> 15 == 0) - callFrame[dst] = JSValue(jsNumber(callFrame, left * right)); + callFrame->r(dst) = JSValue(jsNumber(callFrame, left * right)); else - callFrame[dst] = JSValue(jsNumber(callFrame, static_cast<double>(left) * static_cast<double>(right))); + callFrame->r(dst) = JSValue(jsNumber(callFrame, static_cast<double>(left) * static_cast<double>(right))); } else if (src1.getNumber(left) && src2.getNumber(right)) - callFrame[dst] = JSValue(jsNumber(callFrame, left * right)); + callFrame->r(dst) = JSValue(jsNumber(callFrame, left * right)); else { JSValue result = jsNumber(callFrame, src1.toNumber(callFrame) * src2.toNumber(callFrame)); CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; } vPC += 2; @@ -1572,16 +1558,16 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi quotient in register dst. */ int dst = (++vPC)->u.operand; - JSValue dividend = callFrame[(++vPC)->u.operand].jsValue(); - JSValue divisor = callFrame[(++vPC)->u.operand].jsValue(); + JSValue dividend = callFrame->r((++vPC)->u.operand).jsValue(); + JSValue divisor = callFrame->r((++vPC)->u.operand).jsValue(); double left; double right; if (dividend.getNumber(left) && divisor.getNumber(right)) - callFrame[dst] = JSValue(jsNumber(callFrame, left / right)); + callFrame->r(dst) = JSValue(jsNumber(callFrame, left / right)); else { JSValue result = jsNumber(callFrame, dividend.toNumber(callFrame) / divisor.toNumber(callFrame)); CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; } ++vPC; NEXT_INSTRUCTION(); @@ -1597,15 +1583,15 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int dividend = (++vPC)->u.operand; int divisor = (++vPC)->u.operand; - JSValue dividendValue = callFrame[dividend].jsValue(); - JSValue divisorValue = callFrame[divisor].jsValue(); + JSValue dividendValue = callFrame->r(dividend).jsValue(); + JSValue divisorValue = callFrame->r(divisor).jsValue(); if (JSValue::areBothInt32Fast(dividendValue, divisorValue) && divisorValue != jsNumber(callFrame, 0)) { // We expect the result of the modulus of a number that was representable as an int32 to also be representable // as an int32. JSValue result = JSValue::makeInt32Fast(dividendValue.getInt32Fast() % divisorValue.getInt32Fast()); ASSERT(result); - callFrame[dst] = result; + callFrame->r(dst) = result; ++vPC; NEXT_INSTRUCTION(); } @@ -1613,7 +1599,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi double d = dividendValue.toNumber(callFrame); JSValue result = jsNumber(callFrame, fmod(d, divisorValue.toNumber(callFrame))); CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; ++vPC; NEXT_INSTRUCTION(); } @@ -1625,18 +1611,18 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi register dst. */ int dst = (++vPC)->u.operand; - JSValue src1 = callFrame[(++vPC)->u.operand].jsValue(); - JSValue src2 = callFrame[(++vPC)->u.operand].jsValue(); + JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue(); + JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue(); double left; double right; if (JSFastMath::canDoFastAdditiveOperations(src1, src2)) - callFrame[dst] = JSValue(JSFastMath::subImmediateNumbers(src1, src2)); + callFrame->r(dst) = JSValue(JSFastMath::subImmediateNumbers(src1, src2)); else if (src1.getNumber(left) && src2.getNumber(right)) - callFrame[dst] = JSValue(jsNumber(callFrame, left - right)); + callFrame->r(dst) = JSValue(jsNumber(callFrame, left - right)); else { JSValue result = jsNumber(callFrame, src1.toNumber(callFrame) - src2.toNumber(callFrame)); CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; } vPC += 2; NEXT_INSTRUCTION(); @@ -1649,18 +1635,18 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi in register dst. */ int dst = (++vPC)->u.operand; - JSValue val = callFrame[(++vPC)->u.operand].jsValue(); - JSValue shift = callFrame[(++vPC)->u.operand].jsValue(); + JSValue val = callFrame->r((++vPC)->u.operand).jsValue(); + JSValue shift = callFrame->r((++vPC)->u.operand).jsValue(); int32_t left; uint32_t right; if (JSValue::areBothInt32Fast(val, shift)) - callFrame[dst] = JSValue(jsNumber(callFrame, val.getInt32Fast() << (shift.getInt32Fast() & 0x1f))); + callFrame->r(dst) = JSValue(jsNumber(callFrame, val.getInt32Fast() << (shift.getInt32Fast() & 0x1f))); else if (val.numberToInt32(left) && shift.numberToUInt32(right)) - callFrame[dst] = JSValue(jsNumber(callFrame, left << (right & 0x1f))); + callFrame->r(dst) = JSValue(jsNumber(callFrame, left << (right & 0x1f))); else { JSValue result = jsNumber(callFrame, (val.toInt32(callFrame)) << (shift.toUInt32(callFrame) & 0x1f)); CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; } ++vPC; @@ -1674,18 +1660,18 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi uint32), and puts the result in register dst. */ int dst = (++vPC)->u.operand; - JSValue val = callFrame[(++vPC)->u.operand].jsValue(); - JSValue shift = callFrame[(++vPC)->u.operand].jsValue(); + JSValue val = callFrame->r((++vPC)->u.operand).jsValue(); + JSValue shift = callFrame->r((++vPC)->u.operand).jsValue(); int32_t left; uint32_t right; if (JSFastMath::canDoFastRshift(val, shift)) - callFrame[dst] = JSValue(JSFastMath::rightShiftImmediateNumbers(val, shift)); + callFrame->r(dst) = JSValue(JSFastMath::rightShiftImmediateNumbers(val, shift)); else if (val.numberToInt32(left) && shift.numberToUInt32(right)) - callFrame[dst] = JSValue(jsNumber(callFrame, left >> (right & 0x1f))); + callFrame->r(dst) = JSValue(jsNumber(callFrame, left >> (right & 0x1f))); else { JSValue result = jsNumber(callFrame, (val.toInt32(callFrame)) >> (shift.toUInt32(callFrame) & 0x1f)); CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; } ++vPC; @@ -1699,14 +1685,14 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi uint32), and puts the result in register dst. */ int dst = (++vPC)->u.operand; - JSValue val = callFrame[(++vPC)->u.operand].jsValue(); - JSValue shift = callFrame[(++vPC)->u.operand].jsValue(); + JSValue val = callFrame->r((++vPC)->u.operand).jsValue(); + JSValue shift = callFrame->r((++vPC)->u.operand).jsValue(); if (JSFastMath::canDoFastUrshift(val, shift)) - callFrame[dst] = JSValue(JSFastMath::rightShiftImmediateNumbers(val, shift)); + callFrame->r(dst) = JSValue(JSFastMath::rightShiftImmediateNumbers(val, shift)); else { JSValue result = jsNumber(callFrame, (val.toUInt32(callFrame)) >> (shift.toUInt32(callFrame) & 0x1f)); CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; } ++vPC; @@ -1720,18 +1706,18 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi in register dst. */ int dst = (++vPC)->u.operand; - JSValue src1 = callFrame[(++vPC)->u.operand].jsValue(); - JSValue src2 = callFrame[(++vPC)->u.operand].jsValue(); + JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue(); + JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue(); int32_t left; int32_t right; if (JSFastMath::canDoFastBitwiseOperations(src1, src2)) - callFrame[dst] = JSValue(JSFastMath::andImmediateNumbers(src1, src2)); + callFrame->r(dst) = JSValue(JSFastMath::andImmediateNumbers(src1, src2)); else if (src1.numberToInt32(left) && src2.numberToInt32(right)) - callFrame[dst] = JSValue(jsNumber(callFrame, left & right)); + callFrame->r(dst) = JSValue(jsNumber(callFrame, left & right)); else { JSValue result = jsNumber(callFrame, src1.toInt32(callFrame) & src2.toInt32(callFrame)); CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; } vPC += 2; @@ -1745,18 +1731,18 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi in register dst. */ int dst = (++vPC)->u.operand; - JSValue src1 = callFrame[(++vPC)->u.operand].jsValue(); - JSValue src2 = callFrame[(++vPC)->u.operand].jsValue(); + JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue(); + JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue(); int32_t left; int32_t right; if (JSFastMath::canDoFastBitwiseOperations(src1, src2)) - callFrame[dst] = JSValue(JSFastMath::xorImmediateNumbers(src1, src2)); + callFrame->r(dst) = JSValue(JSFastMath::xorImmediateNumbers(src1, src2)); else if (src1.numberToInt32(left) && src2.numberToInt32(right)) - callFrame[dst] = JSValue(jsNumber(callFrame, left ^ right)); + callFrame->r(dst) = JSValue(jsNumber(callFrame, left ^ right)); else { JSValue result = jsNumber(callFrame, src1.toInt32(callFrame) ^ src2.toInt32(callFrame)); CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; } vPC += 2; @@ -1770,18 +1756,18 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi result in register dst. */ int dst = (++vPC)->u.operand; - JSValue src1 = callFrame[(++vPC)->u.operand].jsValue(); - JSValue src2 = callFrame[(++vPC)->u.operand].jsValue(); + JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue(); + JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue(); int32_t left; int32_t right; if (JSFastMath::canDoFastBitwiseOperations(src1, src2)) - callFrame[dst] = JSValue(JSFastMath::orImmediateNumbers(src1, src2)); + callFrame->r(dst) = JSValue(JSFastMath::orImmediateNumbers(src1, src2)); else if (src1.numberToInt32(left) && src2.numberToInt32(right)) - callFrame[dst] = JSValue(jsNumber(callFrame, left | right)); + callFrame->r(dst) = JSValue(jsNumber(callFrame, left | right)); else { JSValue result = jsNumber(callFrame, src1.toInt32(callFrame) | src2.toInt32(callFrame)); CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; } vPC += 2; @@ -1794,14 +1780,14 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi and puts the result in register dst. */ int dst = (++vPC)->u.operand; - JSValue src = callFrame[(++vPC)->u.operand].jsValue(); + JSValue src = callFrame->r((++vPC)->u.operand).jsValue(); int32_t value; if (src.numberToInt32(value)) - callFrame[dst] = JSValue(jsNumber(callFrame, ~value)); + callFrame->r(dst) = JSValue(jsNumber(callFrame, ~value)); else { JSValue result = jsNumber(callFrame, ~src.toInt32(callFrame)); CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; } ++vPC; NEXT_INSTRUCTION(); @@ -1814,9 +1800,9 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int dst = (++vPC)->u.operand; int src = (++vPC)->u.operand; - JSValue result = jsBoolean(!callFrame[src].jsValue().toBoolean(callFrame)); + JSValue result = jsBoolean(!callFrame->r(src).jsValue().toBoolean(callFrame)); CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; ++vPC; NEXT_INSTRUCTION(); @@ -1839,14 +1825,14 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int base = vPC[3].u.operand; int baseProto = vPC[4].u.operand; - JSValue baseVal = callFrame[base].jsValue(); + JSValue baseVal = callFrame->r(base).jsValue(); if (isInvalidParamForInstanceOf(callFrame, callFrame->codeBlock(), vPC, baseVal, exceptionValue)) goto vm_throw; - bool result = asObject(baseVal)->hasInstance(callFrame, callFrame[value].jsValue(), callFrame[baseProto].jsValue()); + bool result = asObject(baseVal)->hasInstance(callFrame, callFrame->r(value).jsValue(), callFrame->r(baseProto).jsValue()); CHECK_FOR_EXCEPTION(); - callFrame[dst] = jsBoolean(result); + callFrame->r(dst) = jsBoolean(result); vPC += 5; NEXT_INSTRUCTION(); @@ -1859,7 +1845,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int dst = (++vPC)->u.operand; int src = (++vPC)->u.operand; - callFrame[dst] = JSValue(jsTypeStringForValue(callFrame, callFrame[src].jsValue())); + callFrame->r(dst) = JSValue(jsTypeStringForValue(callFrame, callFrame->r(src).jsValue())); ++vPC; NEXT_INSTRUCTION(); @@ -1873,8 +1859,8 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int dst = (++vPC)->u.operand; int src = (++vPC)->u.operand; - JSValue v = callFrame[src].jsValue(); - callFrame[dst] = jsBoolean(v.isCell() ? v.asCell()->structure()->typeInfo().masqueradesAsUndefined() : v.isUndefined()); + JSValue v = callFrame->r(src).jsValue(); + callFrame->r(dst) = jsBoolean(v.isCell() ? v.asCell()->structure()->typeInfo().masqueradesAsUndefined() : v.isUndefined()); ++vPC; NEXT_INSTRUCTION(); @@ -1888,7 +1874,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int dst = (++vPC)->u.operand; int src = (++vPC)->u.operand; - callFrame[dst] = jsBoolean(callFrame[src].jsValue().isBoolean()); + callFrame->r(dst) = jsBoolean(callFrame->r(src).jsValue().isBoolean()); ++vPC; NEXT_INSTRUCTION(); @@ -1902,7 +1888,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int dst = (++vPC)->u.operand; int src = (++vPC)->u.operand; - callFrame[dst] = jsBoolean(callFrame[src].jsValue().isNumber()); + callFrame->r(dst) = jsBoolean(callFrame->r(src).jsValue().isNumber()); ++vPC; NEXT_INSTRUCTION(); @@ -1916,7 +1902,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int dst = (++vPC)->u.operand; int src = (++vPC)->u.operand; - callFrame[dst] = jsBoolean(callFrame[src].jsValue().isString()); + callFrame->r(dst) = jsBoolean(callFrame->r(src).jsValue().isString()); ++vPC; NEXT_INSTRUCTION(); @@ -1930,7 +1916,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int dst = (++vPC)->u.operand; int src = (++vPC)->u.operand; - callFrame[dst] = jsBoolean(jsIsObjectType(callFrame[src].jsValue())); + callFrame->r(dst) = jsBoolean(jsIsObjectType(callFrame->r(src).jsValue())); ++vPC; NEXT_INSTRUCTION(); @@ -1944,7 +1930,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int dst = (++vPC)->u.operand; int src = (++vPC)->u.operand; - callFrame[dst] = jsBoolean(jsIsFunctionType(callFrame[src].jsValue())); + callFrame->r(dst) = jsBoolean(jsIsFunctionType(callFrame->r(src).jsValue())); ++vPC; NEXT_INSTRUCTION(); @@ -1962,21 +1948,21 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int property = (++vPC)->u.operand; int base = (++vPC)->u.operand; - JSValue baseVal = callFrame[base].jsValue(); + JSValue baseVal = callFrame->r(base).jsValue(); if (isInvalidParamForIn(callFrame, callFrame->codeBlock(), vPC, baseVal, exceptionValue)) goto vm_throw; JSObject* baseObj = asObject(baseVal); - JSValue propName = callFrame[property].jsValue(); + JSValue propName = callFrame->r(property).jsValue(); uint32_t i; if (propName.getUInt32(i)) - callFrame[dst] = jsBoolean(baseObj->hasProperty(callFrame, i)); + callFrame->r(dst) = jsBoolean(baseObj->hasProperty(callFrame, i)); else { Identifier property(callFrame, propName.toString(callFrame)); CHECK_FOR_EXCEPTION(); - callFrame[dst] = jsBoolean(baseObj->hasProperty(callFrame, property)); + callFrame->r(dst) = jsBoolean(baseObj->hasProperty(callFrame, property)); } ++vPC; @@ -2034,7 +2020,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi ASSERT(scope->isGlobalObject()); int index = (++vPC)->u.operand; - callFrame[dst] = scope->registerAt(index); + callFrame->r(dst) = scope->registerAt(index); ++vPC; NEXT_INSTRUCTION(); } @@ -2048,7 +2034,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int index = (++vPC)->u.operand; int value = (++vPC)->u.operand; - scope->registerAt(index) = JSValue(callFrame[value].jsValue()); + scope->registerAt(index) = JSValue(callFrame->r(value).jsValue()); ++vPC; NEXT_INSTRUCTION(); } @@ -2073,7 +2059,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi ASSERT((*iter)->isVariableObject()); JSVariableObject* scope = static_cast<JSVariableObject*>(*iter); - callFrame[dst] = scope->registerAt(index); + callFrame->r(dst) = scope->registerAt(index); ++vPC; NEXT_INSTRUCTION(); } @@ -2096,7 +2082,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi ASSERT((*iter)->isVariableObject()); JSVariableObject* scope = static_cast<JSVariableObject*>(*iter); - scope->registerAt(index) = JSValue(callFrame[value].jsValue()); + scope->registerAt(index) = JSValue(callFrame->r(value).jsValue()); ++vPC; NEXT_INSTRUCTION(); } @@ -2164,14 +2150,14 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi CodeBlock* codeBlock = callFrame->codeBlock(); Identifier& ident = codeBlock->identifier(property); - JSValue baseValue = callFrame[base].jsValue(); + JSValue baseValue = callFrame->r(base).jsValue(); PropertySlot slot(baseValue); JSValue result = baseValue.get(callFrame, ident, slot); CHECK_FOR_EXCEPTION(); tryCacheGetByID(callFrame, codeBlock, vPC, baseValue, ident, slot); - callFrame[dst] = result; + callFrame->r(dst) = result; vPC += 8; NEXT_INSTRUCTION(); } @@ -2183,7 +2169,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi op_get_by_id. */ int base = vPC[2].u.operand; - JSValue baseValue = callFrame[base].jsValue(); + JSValue baseValue = callFrame->r(base).jsValue(); if (LIKELY(baseValue.isCell())) { JSCell* baseCell = asCell(baseValue); @@ -2196,7 +2182,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int offset = vPC[5].u.operand; ASSERT(baseObject->get(callFrame, callFrame->codeBlock()->identifier(vPC[3].u.operand)) == baseObject->getDirectOffset(offset)); - callFrame[dst] = JSValue(baseObject->getDirectOffset(offset)); + callFrame->r(dst) = JSValue(baseObject->getDirectOffset(offset)); vPC += 8; NEXT_INSTRUCTION(); @@ -2214,7 +2200,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi reverts to op_get_by_id. */ int base = vPC[2].u.operand; - JSValue baseValue = callFrame[base].jsValue(); + JSValue baseValue = callFrame->r(base).jsValue(); if (LIKELY(baseValue.isCell())) { JSCell* baseCell = asCell(baseValue); @@ -2230,7 +2216,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int offset = vPC[6].u.operand; ASSERT(protoObject->get(callFrame, callFrame->codeBlock()->identifier(vPC[3].u.operand)) == protoObject->getDirectOffset(offset)); - callFrame[dst] = JSValue(protoObject->getDirectOffset(offset)); + callFrame->r(dst) = JSValue(protoObject->getDirectOffset(offset)); vPC += 8; NEXT_INSTRUCTION(); @@ -2263,7 +2249,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi reverts to op_get_by_id. */ int base = vPC[2].u.operand; - JSValue baseValue = callFrame[base].jsValue(); + JSValue baseValue = callFrame->r(base).jsValue(); if (LIKELY(baseValue.isCell())) { JSCell* baseCell = asCell(baseValue); @@ -2285,7 +2271,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int offset = vPC[7].u.operand; ASSERT(baseObject->get(callFrame, callFrame->codeBlock()->identifier(vPC[3].u.operand)) == baseObject->getDirectOffset(offset)); - callFrame[dst] = JSValue(baseObject->getDirectOffset(offset)); + callFrame->r(dst) = JSValue(baseObject->getDirectOffset(offset)); vPC += 8; NEXT_INSTRUCTION(); @@ -2311,12 +2297,12 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int property = vPC[3].u.operand; Identifier& ident = callFrame->codeBlock()->identifier(property); - JSValue baseValue = callFrame[base].jsValue(); + JSValue baseValue = callFrame->r(base).jsValue(); PropertySlot slot(baseValue); JSValue result = baseValue.get(callFrame, ident, slot); CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; vPC += 8; NEXT_INSTRUCTION(); } @@ -2329,10 +2315,10 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int base = vPC[2].u.operand; - JSValue baseValue = callFrame[base].jsValue(); + JSValue baseValue = callFrame->r(base).jsValue(); if (LIKELY(isJSArray(globalData, baseValue))) { int dst = vPC[1].u.operand; - callFrame[dst] = JSValue(jsNumber(callFrame, asArray(baseValue)->length())); + callFrame->r(dst) = JSValue(jsNumber(callFrame, asArray(baseValue)->length())); vPC += 8; NEXT_INSTRUCTION(); } @@ -2349,10 +2335,10 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int base = vPC[2].u.operand; - JSValue baseValue = callFrame[base].jsValue(); + JSValue baseValue = callFrame->r(base).jsValue(); if (LIKELY(isJSString(globalData, baseValue))) { int dst = vPC[1].u.operand; - callFrame[dst] = JSValue(jsNumber(callFrame, asString(baseValue)->value().size())); + callFrame->r(dst) = JSValue(jsNumber(callFrame, asString(baseValue)->value().size())); vPC += 8; NEXT_INSTRUCTION(); } @@ -2375,10 +2361,10 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int value = vPC[3].u.operand; CodeBlock* codeBlock = callFrame->codeBlock(); - JSValue baseValue = callFrame[base].jsValue(); + JSValue baseValue = callFrame->r(base).jsValue(); Identifier& ident = codeBlock->identifier(property); PutPropertySlot slot; - baseValue.put(callFrame, ident, callFrame[value].jsValue(), slot); + baseValue.put(callFrame, ident, callFrame->r(value).jsValue(), slot); CHECK_FOR_EXCEPTION(); tryCachePutByID(callFrame, codeBlock, vPC, baseValue, slot); @@ -2398,7 +2384,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi the register file. */ int base = vPC[1].u.operand; - JSValue baseValue = callFrame[base].jsValue(); + JSValue baseValue = callFrame->r(base).jsValue(); if (LIKELY(baseValue.isCell())) { JSCell* baseCell = asCell(baseValue); @@ -2426,7 +2412,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int value = vPC[3].u.operand; unsigned offset = vPC[7].u.operand; ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(callFrame->codeBlock()->identifier(vPC[2].u.operand))) == offset); - baseObject->putDirectOffset(offset, callFrame[value].jsValue()); + baseObject->putDirectOffset(offset, callFrame->r(value).jsValue()); vPC += 8; NEXT_INSTRUCTION(); @@ -2448,7 +2434,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi the register file. */ int base = vPC[1].u.operand; - JSValue baseValue = callFrame[base].jsValue(); + JSValue baseValue = callFrame->r(base).jsValue(); if (LIKELY(baseValue.isCell())) { JSCell* baseCell = asCell(baseValue); @@ -2461,7 +2447,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi unsigned offset = vPC[5].u.operand; ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(callFrame->codeBlock()->identifier(vPC[2].u.operand))) == offset); - baseObject->putDirectOffset(offset, callFrame[value].jsValue()); + baseObject->putDirectOffset(offset, callFrame->r(value).jsValue()); vPC += 8; NEXT_INSTRUCTION(); @@ -2484,10 +2470,10 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int property = vPC[2].u.operand; int value = vPC[3].u.operand; - JSValue baseValue = callFrame[base].jsValue(); + JSValue baseValue = callFrame->r(base).jsValue(); Identifier& ident = callFrame->codeBlock()->identifier(property); PutPropertySlot slot; - baseValue.put(callFrame, ident, callFrame[value].jsValue(), slot); + baseValue.put(callFrame, ident, callFrame->r(value).jsValue(), slot); CHECK_FOR_EXCEPTION(); vPC += 8; @@ -2505,11 +2491,11 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int base = (++vPC)->u.operand; int property = (++vPC)->u.operand; - JSObject* baseObj = callFrame[base].jsValue().toObject(callFrame); + JSObject* baseObj = callFrame->r(base).jsValue().toObject(callFrame); Identifier& ident = callFrame->codeBlock()->identifier(property); JSValue result = jsBoolean(baseObj->deleteProperty(callFrame, ident)); CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; ++vPC; NEXT_INSTRUCTION(); } @@ -2525,8 +2511,8 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int base = (++vPC)->u.operand; int property = (++vPC)->u.operand; - JSValue baseValue = callFrame[base].jsValue(); - JSValue subscript = callFrame[property].jsValue(); + JSValue baseValue = callFrame->r(base).jsValue(); + JSValue subscript = callFrame->r(property).jsValue(); JSValue result; @@ -2550,7 +2536,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi } CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; ++vPC; NEXT_INSTRUCTION(); } @@ -2569,21 +2555,21 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int property = (++vPC)->u.operand; int value = (++vPC)->u.operand; - JSValue baseValue = callFrame[base].jsValue(); - JSValue subscript = callFrame[property].jsValue(); + JSValue baseValue = callFrame->r(base).jsValue(); + JSValue subscript = callFrame->r(property).jsValue(); if (LIKELY(subscript.isUInt32Fast())) { uint32_t i = subscript.getUInt32Fast(); if (isJSArray(globalData, baseValue)) { JSArray* jsArray = asArray(baseValue); if (jsArray->canSetIndex(i)) - jsArray->setIndex(i, callFrame[value].jsValue()); + jsArray->setIndex(i, callFrame->r(value).jsValue()); else - jsArray->JSArray::put(callFrame, i, callFrame[value].jsValue()); + jsArray->JSArray::put(callFrame, i, callFrame->r(value).jsValue()); } else if (isJSByteArray(globalData, baseValue) && asByteArray(baseValue)->canAccessIndex(i)) { JSByteArray* jsByteArray = asByteArray(baseValue); double dValue = 0; - JSValue jsValue = callFrame[value].jsValue(); + JSValue jsValue = callFrame->r(value).jsValue(); if (jsValue.isInt32Fast()) jsByteArray->setIndex(i, jsValue.getInt32Fast()); else if (jsValue.getNumber(dValue)) @@ -2591,12 +2577,12 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi else baseValue.put(callFrame, i, jsValue); } else - baseValue.put(callFrame, i, callFrame[value].jsValue()); + baseValue.put(callFrame, i, callFrame->r(value).jsValue()); } else { Identifier property(callFrame, subscript.toString(callFrame)); if (!globalData->exception) { // Don't put to an object if toString threw an exception. PutPropertySlot slot; - baseValue.put(callFrame, property, callFrame[value].jsValue(), slot); + baseValue.put(callFrame, property, callFrame->r(value).jsValue(), slot); } } @@ -2616,9 +2602,9 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int base = (++vPC)->u.operand; int property = (++vPC)->u.operand; - JSObject* baseObj = callFrame[base].jsValue().toObject(callFrame); // may throw + JSObject* baseObj = callFrame->r(base).jsValue().toObject(callFrame); // may throw - JSValue subscript = callFrame[property].jsValue(); + JSValue subscript = callFrame->r(property).jsValue(); JSValue result; uint32_t i; if (subscript.getUInt32(i)) @@ -2631,7 +2617,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi } CHECK_FOR_EXCEPTION(); - callFrame[dst] = result; + callFrame->r(dst) = result; ++vPC; NEXT_INSTRUCTION(); } @@ -2651,7 +2637,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi unsigned property = (++vPC)->u.operand; int value = (++vPC)->u.operand; - callFrame[base].jsValue().put(callFrame, property, callFrame[value].jsValue()); + callFrame->r(base).jsValue().put(callFrame, property, callFrame->r(value).jsValue()); ++vPC; NEXT_INSTRUCTION(); @@ -2698,7 +2684,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int cond = (++vPC)->u.operand; int target = (++vPC)->u.operand; - if (callFrame[cond].jsValue().toBoolean(callFrame)) { + if (callFrame->r(cond).jsValue().toBoolean(callFrame)) { vPC += target; CHECK_FOR_TIMEOUT(); NEXT_INSTRUCTION(); @@ -2715,7 +2701,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int cond = (++vPC)->u.operand; int target = (++vPC)->u.operand; - if (callFrame[cond].jsValue().toBoolean(callFrame)) { + if (callFrame->r(cond).jsValue().toBoolean(callFrame)) { vPC += target; NEXT_INSTRUCTION(); } @@ -2731,7 +2717,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int cond = (++vPC)->u.operand; int target = (++vPC)->u.operand; - if (!callFrame[cond].jsValue().toBoolean(callFrame)) { + if (!callFrame->r(cond).jsValue().toBoolean(callFrame)) { vPC += target; NEXT_INSTRUCTION(); } @@ -2747,7 +2733,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int src = (++vPC)->u.operand; int target = (++vPC)->u.operand; - JSValue srcValue = callFrame[src].jsValue(); + JSValue srcValue = callFrame->r(src).jsValue(); if (srcValue.isUndefinedOrNull() || (srcValue.isCell() && srcValue.asCell()->structure()->typeInfo().masqueradesAsUndefined())) { vPC += target; @@ -2765,7 +2751,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int src = (++vPC)->u.operand; int target = (++vPC)->u.operand; - JSValue srcValue = callFrame[src].jsValue(); + JSValue srcValue = callFrame->r(src).jsValue(); if (!srcValue.isUndefinedOrNull() || (srcValue.isCell() && !srcValue.asCell()->structure()->typeInfo().masqueradesAsUndefined())) { vPC += target; @@ -2784,7 +2770,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int src = (++vPC)->u.operand; JSValue ptr = JSValue((++vPC)->u.jsCell); int target = (++vPC)->u.operand; - JSValue srcValue = callFrame[src].jsValue(); + JSValue srcValue = callFrame->r(src).jsValue(); if (srcValue != ptr) { vPC += target; NEXT_INSTRUCTION(); @@ -2804,8 +2790,8 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi Additionally this loop instruction may terminate JS execution is the JS timeout is reached. */ - JSValue src1 = callFrame[(++vPC)->u.operand].jsValue(); - JSValue src2 = callFrame[(++vPC)->u.operand].jsValue(); + JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue(); + JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue(); int target = (++vPC)->u.operand; bool result = jsLess(callFrame, src1, src2); @@ -2831,8 +2817,8 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi Additionally this loop instruction may terminate JS execution is the JS timeout is reached. */ - JSValue src1 = callFrame[(++vPC)->u.operand].jsValue(); - JSValue src2 = callFrame[(++vPC)->u.operand].jsValue(); + JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue(); + JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue(); int target = (++vPC)->u.operand; bool result = jsLessEq(callFrame, src1, src2); @@ -2855,8 +2841,8 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi target from the current instruction, if and only if the result of the comparison is false. */ - JSValue src1 = callFrame[(++vPC)->u.operand].jsValue(); - JSValue src2 = callFrame[(++vPC)->u.operand].jsValue(); + JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue(); + JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue(); int target = (++vPC)->u.operand; bool result = jsLess(callFrame, src1, src2); @@ -2878,8 +2864,8 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi and then jumps to offset target from the current instruction, if and only if theresult of the comparison is false. */ - JSValue src1 = callFrame[(++vPC)->u.operand].jsValue(); - JSValue src2 = callFrame[(++vPC)->u.operand].jsValue(); + JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue(); + JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue(); int target = (++vPC)->u.operand; bool result = jsLessEq(callFrame, src1, src2); @@ -2904,7 +2890,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int tableIndex = (++vPC)->u.operand; int defaultOffset = (++vPC)->u.operand; - JSValue scrutinee = callFrame[(++vPC)->u.operand].jsValue(); + JSValue scrutinee = callFrame->r((++vPC)->u.operand).jsValue(); if (scrutinee.isInt32Fast()) vPC += callFrame->codeBlock()->immediateSwitchJumpTable(tableIndex).offsetForValue(scrutinee.getInt32Fast(), defaultOffset); else { @@ -2928,7 +2914,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int tableIndex = (++vPC)->u.operand; int defaultOffset = (++vPC)->u.operand; - JSValue scrutinee = callFrame[(++vPC)->u.operand].jsValue(); + JSValue scrutinee = callFrame->r((++vPC)->u.operand).jsValue(); if (!scrutinee.isString()) vPC += defaultOffset; else { @@ -2951,7 +2937,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int tableIndex = (++vPC)->u.operand; int defaultOffset = (++vPC)->u.operand; - JSValue scrutinee = callFrame[(++vPC)->u.operand].jsValue(); + JSValue scrutinee = callFrame->r((++vPC)->u.operand).jsValue(); if (!scrutinee.isString()) vPC += defaultOffset; else @@ -2969,7 +2955,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int dst = (++vPC)->u.operand; int func = (++vPC)->u.operand; - callFrame[dst] = callFrame->codeBlock()->function(func)->makeFunction(callFrame, callFrame->scopeChain()); + callFrame->r(dst) = callFrame->codeBlock()->function(func)->makeFunction(callFrame, callFrame->scopeChain()); ++vPC; NEXT_INSTRUCTION(); @@ -2985,7 +2971,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int dst = (++vPC)->u.operand; int func = (++vPC)->u.operand; - callFrame[dst] = callFrame->codeBlock()->functionExpression(func)->makeFunction(callFrame, callFrame->scopeChain()); + callFrame->r(dst) = callFrame->codeBlock()->functionExpression(func)->makeFunction(callFrame, callFrame->scopeChain()); ++vPC; NEXT_INSTRUCTION(); @@ -3007,7 +2993,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int argCount = vPC[3].u.operand; int registerOffset = vPC[4].u.operand; - JSValue funcVal = callFrame[func].jsValue(); + JSValue funcVal = callFrame->r(func).jsValue(); Register* newCallFrame = callFrame->registers() + registerOffset; Register* argv = newCallFrame - RegisterFile::CallFrameHeaderSize - argCount; @@ -3018,7 +3004,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi JSValue result = callEval(callFrame, registerFile, argv, argCount, registerOffset, exceptionValue); if (exceptionValue) goto vm_throw; - callFrame[dst] = result; + callFrame->r(dst) = result; vPC += 5; NEXT_INSTRUCTION(); @@ -3044,7 +3030,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int argCount = vPC[3].u.operand; int registerOffset = vPC[4].u.operand; - JSValue v = callFrame[func].jsValue(); + JSValue v = callFrame->r(func).jsValue(); CallData callData; CallType callType = v.getCallData(callData); @@ -3093,7 +3079,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi } CHECK_FOR_EXCEPTION(); - callFrame[dst] = JSValue(returnValue); + callFrame->r(dst) = JSValue(returnValue); vPC += 5; NEXT_INSTRUCTION(); @@ -3108,19 +3094,19 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int argCountDst = (++vPC)->u.operand; int argsOffset = (++vPC)->u.operand; - JSValue arguments = callFrame[argsOffset].jsValue(); - uint32_t argCount = 0; + JSValue arguments = callFrame->r(argsOffset).jsValue(); + int32_t argCount = 0; if (!arguments) { - argCount = (uint32_t)(callFrame[RegisterFile::ArgumentCount].u.i) - 1; + argCount = (uint32_t)(callFrame->argumentCount()) - 1; int32_t sizeDelta = argsOffset + argCount + RegisterFile::CallFrameHeaderSize; Register* newEnd = callFrame->registers() + sizeDelta; if (!registerFile->grow(newEnd) || ((newEnd - callFrame->registers()) != sizeDelta)) { exceptionValue = createStackOverflowError(callFrame); goto vm_throw; } - uint32_t expectedParams = asFunction(callFrame[RegisterFile::Callee].jsValue())->body()->parameterCount(); - uint32_t inplaceArgs = min(argCount, expectedParams); - uint32_t i = 0; + int32_t expectedParams = callFrame->callee()->body()->parameterCount(); + int32_t inplaceArgs = min(argCount, expectedParams); + int32_t i = 0; Register* argStore = callFrame->registers() + argsOffset; // First step is to copy the "expected" parameters from their normal location relative to the callframe @@ -3164,7 +3150,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi goto vm_throw; } Register* argsBuffer = callFrame->registers() + argsOffset; - for (unsigned i = 0; i < argCount; ++i) { + for (int32_t i = 0; i < argCount; ++i) { argsBuffer[i] = asObject(arguments)->get(callFrame, i); CHECK_FOR_EXCEPTION(); } @@ -3176,7 +3162,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi } } CHECK_FOR_EXCEPTION(); - callFrame[argCountDst] = argCount + 1; + callFrame->r(argCountDst) = argCount + 1; ++vPC; NEXT_INSTRUCTION(); } @@ -3197,8 +3183,8 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int argCountReg = vPC[3].u.operand; int registerOffset = vPC[4].u.operand; - JSValue v = callFrame[func].jsValue(); - int argCount = callFrame[argCountReg].i(); + JSValue v = callFrame->r(func).jsValue(); + int argCount = callFrame->r(argCountReg).i(); registerOffset += argCount; CallData callData; CallType callType = v.getCallData(callData); @@ -3247,7 +3233,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi } CHECK_FOR_EXCEPTION(); - callFrame[dst] = JSValue(returnValue); + callFrame->r(dst) = JSValue(returnValue); vPC += 5; NEXT_INSTRUCTION(); @@ -3274,7 +3260,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int src = (++vPC)->u.operand; ASSERT(callFrame->codeBlock()->needsFullScopeChain()); - asActivation(callFrame[src].jsValue())->copyRegisters(callFrame->optionalCalleeArguments()); + asActivation(callFrame->r(src).jsValue())->copyRegisters(callFrame->optionalCalleeArguments()); ++vPC; NEXT_INSTRUCTION(); @@ -3314,7 +3300,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi if (callFrame->codeBlock()->needsFullScopeChain()) callFrame->scopeChain()->deref(); - JSValue returnValue = callFrame[result].jsValue(); + JSValue returnValue = callFrame->r(result).jsValue(); vPC = callFrame->returnPC(); int dst = callFrame->returnValueRegister(); @@ -3323,7 +3309,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi if (callFrame->hasHostCallFrameFlag()) return returnValue; - callFrame[dst] = JSValue(returnValue); + callFrame->r(dst) = JSValue(returnValue); NEXT_INSTRUCTION(); } @@ -3342,10 +3328,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi CodeBlock* codeBlock = callFrame->codeBlock(); for (size_t count = codeBlock->m_numVars; i < count; ++i) - callFrame[i] = jsUndefined(); - - for (size_t count = codeBlock->numberOfConstantRegisters(), j = 0; j < count; ++i, ++j) - callFrame[i] = codeBlock->constantRegister(j); + callFrame->r(i) = jsUndefined(); ++vPC; NEXT_INSTRUCTION(); @@ -3367,14 +3350,11 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi CodeBlock* codeBlock = callFrame->codeBlock(); for (size_t count = codeBlock->m_numVars; i < count; ++i) - callFrame[i] = jsUndefined(); - - for (size_t count = codeBlock->numberOfConstantRegisters(), j = 0; j < count; ++i, ++j) - callFrame[i] = codeBlock->constantRegister(j); + callFrame->r(i) = jsUndefined(); int dst = (++vPC)->u.operand; JSActivation* activation = new (globalData) JSActivation(callFrame, static_cast<FunctionBodyNode*>(codeBlock->ownerNode())); - callFrame[dst] = activation; + callFrame->r(dst) = activation; callFrame->setScopeChain(callFrame->scopeChain()->copy()->push(activation)); ++vPC; @@ -3393,9 +3373,9 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int thisRegister = (++vPC)->u.operand; - JSValue thisVal = callFrame[thisRegister].jsValue(); + JSValue thisVal = callFrame->r(thisRegister).jsValue(); if (thisVal.needsThisConversion()) - callFrame[thisRegister] = JSValue(thisVal.toThisObject(callFrame)); + callFrame->r(thisRegister) = JSValue(thisVal.toThisObject(callFrame)); ++vPC; NEXT_INSTRUCTION(); @@ -3410,7 +3390,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi This opcode should only be used at the beginning of a code block. */ - callFrame[RegisterFile::ArgumentsRegister] = JSValue(); + callFrame->r(RegisterFile::ArgumentsRegister) = JSValue(); ++vPC; NEXT_INSTRUCTION(); } @@ -3425,7 +3405,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi if (!callFrame->optionalCalleeArguments()) { Arguments* arguments = new (globalData) Arguments(callFrame); callFrame->setCalleeArguments(arguments); - callFrame[RegisterFile::ArgumentsRegister] = arguments; + callFrame->r(RegisterFile::ArgumentsRegister) = arguments; } ++vPC; NEXT_INSTRUCTION(); @@ -3452,7 +3432,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int proto = vPC[5].u.operand; int thisRegister = vPC[6].u.operand; - JSValue v = callFrame[func].jsValue(); + JSValue v = callFrame->r(func).jsValue(); ConstructData constructData; ConstructType constructType = v.getConstructData(constructData); @@ -3463,14 +3443,14 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi CodeBlock* newCodeBlock = &functionBodyNode->bytecode(callDataScopeChain); Structure* structure; - JSValue prototype = callFrame[proto].jsValue(); + JSValue prototype = callFrame->r(proto).jsValue(); if (prototype.isObject()) structure = asObject(prototype)->inheritorID(); else structure = callDataScopeChain->globalObject()->emptyObjectStructure(); JSObject* newObject = new (globalData) JSObject(structure); - callFrame[thisRegister] = JSValue(newObject); // "this" value + callFrame->r(thisRegister) = JSValue(newObject); // "this" value CallFrame* previousCallFrame = callFrame; @@ -3504,7 +3484,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi returnValue = constructData.native.function(newCallFrame, asObject(v), args); } CHECK_FOR_EXCEPTION(); - callFrame[dst] = JSValue(returnValue); + callFrame->r(dst) = JSValue(returnValue); vPC += 7; NEXT_INSTRUCTION(); @@ -3523,13 +3503,13 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int dst = vPC[1].u.operand; - if (LIKELY(callFrame[dst].jsValue().isObject())) { + if (LIKELY(callFrame->r(dst).jsValue().isObject())) { vPC += 3; NEXT_INSTRUCTION(); } int override = vPC[2].u.operand; - callFrame[dst] = callFrame[override]; + callFrame->r(dst) = callFrame->r(override); vPC += 3; NEXT_INSTRUCTION(); @@ -3539,7 +3519,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int src = (++vPC)->u.operand; int count = (++vPC)->u.operand; - callFrame[dst] = concatenateStrings(callFrame, &callFrame->registers()[src], count); + callFrame->r(dst) = concatenateStrings(callFrame, &callFrame->registers()[src], count); ++vPC; NEXT_INSTRUCTION(); @@ -3548,7 +3528,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int dst = (++vPC)->u.operand; int src = (++vPC)->u.operand; - callFrame[dst] = callFrame[src].jsValue().toPrimitive(callFrame); + callFrame->r(dst) = callFrame->r(src).jsValue().toPrimitive(callFrame); ++vPC; NEXT_INSTRUCTION(); @@ -3561,11 +3541,11 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi are replaced by the result of toObject conversion of the scope. */ int scope = (++vPC)->u.operand; - JSValue v = callFrame[scope].jsValue(); + JSValue v = callFrame->r(scope).jsValue(); JSObject* o = v.toObject(callFrame); CHECK_FOR_EXCEPTION(); - callFrame[scope] = JSValue(o); + callFrame->r(scope) = JSValue(o); callFrame->setScopeChain(callFrame->scopeChain()->push(o)); ++vPC; @@ -3592,7 +3572,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int dst = (++vPC)->u.operand; int base = (++vPC)->u.operand; - callFrame[dst] = JSPropertyNameIterator::create(callFrame, callFrame[base].jsValue()); + callFrame->r(dst) = JSPropertyNameIterator::create(callFrame, callFrame->r(base).jsValue()); ++vPC; NEXT_INSTRUCTION(); } @@ -3609,10 +3589,10 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int iter = (++vPC)->u.operand; int target = (++vPC)->u.operand; - JSPropertyNameIterator* it = callFrame[iter].propertyNameIterator(); + JSPropertyNameIterator* it = callFrame->r(iter).propertyNameIterator(); if (JSValue temp = it->next(callFrame)) { CHECK_FOR_TIMEOUT(); - callFrame[dst] = JSValue(temp); + callFrame->r(dst) = JSValue(temp); vPC += target; NEXT_INSTRUCTION(); } @@ -3668,7 +3648,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi ASSERT(exceptionValue); ASSERT(!globalData->exception); int ex = (++vPC)->u.operand; - callFrame[ex] = exceptionValue; + callFrame->r(ex) = exceptionValue; exceptionValue = JSValue(); ++vPC; @@ -3686,7 +3666,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int ex = (++vPC)->u.operand; - exceptionValue = callFrame[ex].jsValue(); + exceptionValue = callFrame->r(ex).jsValue(); handler = throwException(callFrame, exceptionValue, vPC - callFrame->codeBlock()->instructions().begin(), true); if (!handler) { @@ -3697,18 +3677,6 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi vPC = callFrame->codeBlock()->instructions().begin() + handler->target; NEXT_INSTRUCTION(); } - DEFINE_OPCODE(op_unexpected_load) { - /* unexpected_load load dst(r) src(k) - - Copies constant src to register dst. - */ - int dst = (++vPC)->u.operand; - int src = (++vPC)->u.operand; - callFrame[dst] = JSValue(callFrame->codeBlock()->unexpectedConstant(src)); - - ++vPC; - NEXT_INSTRUCTION(); - } DEFINE_OPCODE(op_new_error) { /* new_error dst(r) type(n) message(k) @@ -3722,7 +3690,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int message = (++vPC)->u.operand; CodeBlock* codeBlock = callFrame->codeBlock(); - callFrame[dst] = JSValue(Error::create(callFrame, (ErrorType)type, codeBlock->unexpectedConstant(message).toString(callFrame), codeBlock->lineNumberForBytecodeOffset(callFrame, vPC - codeBlock->instructions().begin()), codeBlock->ownerNode()->sourceID(), codeBlock->ownerNode()->sourceURL())); + callFrame->r(dst) = JSValue(Error::create(callFrame, (ErrorType)type, callFrame->r(message).jsValue().toString(callFrame), codeBlock->lineNumberForBytecodeOffset(callFrame, vPC - codeBlock->instructions().begin()), codeBlock->ownerNode()->sourceID(), codeBlock->ownerNode()->sourceURL())); ++vPC; NEXT_INSTRUCTION(); @@ -3740,7 +3708,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi scopeChain->deref(); } int result = (++vPC)->u.operand; - return callFrame[result].jsValue(); + return callFrame->r(result).jsValue(); } DEFINE_OPCODE(op_put_getter) { /* put_getter base(r) property(id) function(r) @@ -3757,11 +3725,11 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int property = (++vPC)->u.operand; int function = (++vPC)->u.operand; - ASSERT(callFrame[base].jsValue().isObject()); - JSObject* baseObj = asObject(callFrame[base].jsValue()); + ASSERT(callFrame->r(base).jsValue().isObject()); + JSObject* baseObj = asObject(callFrame->r(base).jsValue()); Identifier& ident = callFrame->codeBlock()->identifier(property); - ASSERT(callFrame[function].jsValue().isObject()); - baseObj->defineGetter(callFrame, ident, asObject(callFrame[function].jsValue())); + ASSERT(callFrame->r(function).jsValue().isObject()); + baseObj->defineGetter(callFrame, ident, asObject(callFrame->r(function).jsValue())); ++vPC; NEXT_INSTRUCTION(); @@ -3781,11 +3749,11 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int property = (++vPC)->u.operand; int function = (++vPC)->u.operand; - ASSERT(callFrame[base].jsValue().isObject()); - JSObject* baseObj = asObject(callFrame[base].jsValue()); + ASSERT(callFrame->r(base).jsValue().isObject()); + JSObject* baseObj = asObject(callFrame->r(base).jsValue()); Identifier& ident = callFrame->codeBlock()->identifier(property); - ASSERT(callFrame[function].jsValue().isObject()); - baseObj->defineSetter(callFrame, ident, asObject(callFrame[function].jsValue())); + ASSERT(callFrame->r(function).jsValue().isObject()); + baseObj->defineSetter(callFrame, ident, asObject(callFrame->r(function).jsValue())); ++vPC; NEXT_INSTRUCTION(); @@ -3802,7 +3770,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ int retAddrDst = (++vPC)->u.operand; int target = (++vPC)->u.operand; - callFrame[retAddrDst] = vPC + 1; + callFrame->r(retAddrDst) = vPC + 1; vPC += target; NEXT_INSTRUCTION(); @@ -3815,7 +3783,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi register, not as an immediate. */ int retAddrSrc = (++vPC)->u.operand; - vPC = callFrame[retAddrSrc].vPC(); + vPC = callFrame->r(retAddrSrc).vPC(); NEXT_INSTRUCTION(); } DEFINE_OPCODE(op_debug) { @@ -3842,7 +3810,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int function = vPC[1].u.operand; if (*enabledProfilerReference) - (*enabledProfilerReference)->willExecute(callFrame, callFrame[function].jsValue()); + (*enabledProfilerReference)->willExecute(callFrame, callFrame->r(function).jsValue()); vPC += 2; NEXT_INSTRUCTION(); @@ -3856,7 +3824,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi int function = vPC[1].u.operand; if (*enabledProfilerReference) - (*enabledProfilerReference)->didExecute(callFrame, callFrame[function].jsValue()); + (*enabledProfilerReference)->didExecute(callFrame, callFrame->r(function).jsValue()); vPC += 2; NEXT_INSTRUCTION(); @@ -3899,12 +3867,12 @@ JSValue Interpreter::retrieveArguments(CallFrame* callFrame, JSFunction* functio ASSERT(codeBlock->codeType() == FunctionCode); SymbolTable& symbolTable = codeBlock->symbolTable(); int argumentsIndex = symbolTable.get(functionCallFrame->propertyNames().arguments.ustring().rep()).getIndex(); - if (!functionCallFrame[argumentsIndex].arguments()) { + if (!functionCallFrame->r(argumentsIndex).arguments()) { Arguments* arguments = new (callFrame) Arguments(functionCallFrame); functionCallFrame->setCalleeArguments(arguments); - functionCallFrame[RegisterFile::ArgumentsRegister] = arguments; + functionCallFrame->r(RegisterFile::ArgumentsRegister) = arguments; } - return functionCallFrame[argumentsIndex].jsValue(); + return functionCallFrame->r(argumentsIndex).jsValue(); } Arguments* arguments = functionCallFrame->optionalCalleeArguments(); |