summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-07-14 15:49:56 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-07-14 15:49:56 (GMT)
commit8fd9cbc859346d758bb730e85c679635f00940df (patch)
treebc3b10d79a458933b1f481bd7e88d1a633e7bc1e /src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp
parent65b788014759fa06d65d1677b3dbd5cc4b596f6b (diff)
parent06af27069497a693f5b1a867b29d96297f68eb75 (diff)
downloadQt-8fd9cbc859346d758bb730e85c679635f00940df.zip
Qt-8fd9cbc859346d758bb730e85c679635f00940df.tar.gz
Qt-8fd9cbc859346d758bb730e85c679635f00940df.tar.bz2
Merge branch 'qtwebkit-4.6-staging' into qtscript-jsc-backend
Conflicts: src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp src/script/qscriptecmafunction.cpp src/script/qscriptecmaglobal.cpp src/script/qscriptengine.cpp src/script/qscriptengine_p.cpp src/script/qscriptenginefwd_p.h src/script/qscriptextqobject.cpp src/script/qscriptextqobject_p.h tests/auto/qscriptqobject/tst_qscriptqobject.cpp
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp558
1 files changed, 265 insertions, 293 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp
index d006b53..ccc26bb 100644
--- a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp
@@ -116,7 +116,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);
@@ -149,7 +149,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);
@@ -167,7 +167,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;
}
@@ -182,14 +182,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;
}
@@ -201,7 +201,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)
@@ -229,8 +229,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;
@@ -274,8 +274,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;
@@ -440,17 +440,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());
@@ -571,13 +561,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
}
@@ -629,7 +619,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())
@@ -686,10 +676,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);
@@ -747,7 +737,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);
@@ -858,7 +848,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())
@@ -922,9 +912,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);
}
@@ -1201,7 +1191,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();
@@ -1218,7 +1208,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();
@@ -1232,7 +1222,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();
@@ -1244,7 +1234,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();
@@ -1257,14 +1247,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;
@@ -1277,15 +1267,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();
}
@@ -1297,14 +1287,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;
@@ -1317,15 +1307,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();
}
@@ -1337,9 +1327,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();
@@ -1352,9 +1342,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();
@@ -1367,11 +1357,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();
@@ -1384,11 +1374,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();
@@ -1400,13 +1390,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;
@@ -1419,13 +1409,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;
@@ -1440,15 +1430,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;
@@ -1463,15 +1453,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;
@@ -1486,14 +1476,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;
@@ -1506,15 +1496,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();
@@ -1527,14 +1517,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();
@@ -1546,23 +1536,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;
@@ -1576,16 +1566,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();
@@ -1601,15 +1591,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();
}
@@ -1617,7 +1607,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();
}
@@ -1629,18 +1619,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();
@@ -1653,18 +1643,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;
@@ -1678,18 +1668,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;
@@ -1703,14 +1693,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;
@@ -1724,18 +1714,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;
@@ -1749,18 +1739,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;
@@ -1774,18 +1764,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;
@@ -1798,14 +1788,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();
@@ -1818,9 +1808,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();
@@ -1843,14 +1833,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();
@@ -1863,7 +1853,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();
@@ -1877,8 +1867,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();
@@ -1892,7 +1882,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();
@@ -1906,7 +1896,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();
@@ -1920,7 +1910,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();
@@ -1934,7 +1924,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();
@@ -1948,7 +1938,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();
@@ -1966,21 +1956,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;
@@ -2038,7 +2028,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();
}
@@ -2052,7 +2042,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();
}
@@ -2077,7 +2067,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();
}
@@ -2100,7 +2090,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();
}
@@ -2168,14 +2158,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();
}
@@ -2187,7 +2177,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);
@@ -2200,7 +2190,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();
@@ -2218,7 +2208,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);
@@ -2234,7 +2224,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();
@@ -2267,7 +2257,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);
@@ -2289,7 +2279,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();
@@ -2315,12 +2305,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();
}
@@ -2333,10 +2323,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();
}
@@ -2353,10 +2343,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();
}
@@ -2379,10 +2369,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);
@@ -2402,7 +2392,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);
@@ -2430,7 +2420,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();
@@ -2452,7 +2442,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);
@@ -2465,7 +2455,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();
@@ -2488,10 +2478,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;
@@ -2509,11 +2499,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();
}
@@ -2529,8 +2519,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;
@@ -2554,7 +2544,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
}
CHECK_FOR_EXCEPTION();
- callFrame[dst] = result;
+ callFrame->r(dst) = result;
++vPC;
NEXT_INSTRUCTION();
}
@@ -2573,21 +2563,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))
@@ -2595,12 +2585,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);
}
}
@@ -2620,9 +2610,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))
@@ -2635,7 +2625,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
}
CHECK_FOR_EXCEPTION();
- callFrame[dst] = result;
+ callFrame->r(dst) = result;
++vPC;
NEXT_INSTRUCTION();
}
@@ -2655,7 +2645,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();
@@ -2702,7 +2692,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();
@@ -2719,7 +2709,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();
}
@@ -2735,7 +2725,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();
}
@@ -2751,7 +2741,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;
@@ -2769,7 +2759,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;
@@ -2788,7 +2778,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();
@@ -2808,8 +2798,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);
@@ -2835,8 +2825,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);
@@ -2859,8 +2849,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);
@@ -2882,8 +2872,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);
@@ -2908,7 +2898,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 {
@@ -2932,7 +2922,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 {
@@ -2955,7 +2945,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
@@ -2973,7 +2963,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();
@@ -2989,7 +2979,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();
@@ -3011,7 +3001,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;
@@ -3022,7 +3012,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();
@@ -3048,7 +3038,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);
@@ -3097,7 +3087,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
}
CHECK_FOR_EXCEPTION();
- callFrame[dst] = JSValue(returnValue);
+ callFrame->r(dst) = JSValue(returnValue);
vPC += 5;
NEXT_INSTRUCTION();
@@ -3112,19 +3102,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
@@ -3168,7 +3158,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();
}
@@ -3180,7 +3170,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
}
}
CHECK_FOR_EXCEPTION();
- callFrame[argCountDst] = argCount + 1;
+ callFrame->r(argCountDst) = argCount + 1;
++vPC;
NEXT_INSTRUCTION();
}
@@ -3201,8 +3191,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);
@@ -3251,7 +3241,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
}
CHECK_FOR_EXCEPTION();
- callFrame[dst] = JSValue(returnValue);
+ callFrame->r(dst) = JSValue(returnValue);
vPC += 5;
NEXT_INSTRUCTION();
@@ -3278,7 +3268,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();
@@ -3318,7 +3308,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();
@@ -3327,7 +3317,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
if (callFrame->hasHostCallFrameFlag())
return returnValue;
- callFrame[dst] = JSValue(returnValue);
+ callFrame->r(dst) = JSValue(returnValue);
NEXT_INSTRUCTION();
}
@@ -3346,10 +3336,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();
@@ -3371,14 +3358,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;
@@ -3397,9 +3381,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();
@@ -3414,7 +3398,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();
}
@@ -3429,7 +3413,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();
@@ -3456,7 +3440,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);
@@ -3467,7 +3451,7 @@ 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
@@ -3478,7 +3462,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
#else
JSObject* newObject = new (globalData) JSObject(structure);
#endif
- callFrame[thisRegister] = JSValue(newObject); // "this" value
+ callFrame->r(thisRegister) = JSValue(newObject); // "this" value
CallFrame* previousCallFrame = callFrame;
@@ -3527,7 +3511,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();
@@ -3546,13 +3530,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();
@@ -3562,7 +3546,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();
@@ -3571,7 +3555,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();
@@ -3584,11 +3568,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;
@@ -3615,7 +3599,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();
}
@@ -3632,10 +3616,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();
}
@@ -3691,7 +3675,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;
@@ -3709,7 +3693,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) {
@@ -3720,18 +3704,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)
@@ -3745,7 +3717,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();
@@ -3763,7 +3735,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)
@@ -3780,11 +3752,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();
@@ -3804,11 +3776,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();
@@ -3825,7 +3797,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();
@@ -3838,7 +3810,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) {
@@ -3865,7 +3837,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();
@@ -3879,7 +3851,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();
@@ -3922,12 +3894,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();