summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/interpreter/Interpreter.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-01-11 10:03:25 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-01-11 10:03:25 +0100
commitd11f84f5b5cdc0d92a08af01b13472fdd5f9acb9 (patch)
treeb318cf594dc1da2fa48224005945c9157f35bb41 /Source/JavaScriptCore/interpreter/Interpreter.cpp
parent6300a96eca9f152b379f1bcf3d9efdc5572d989a (diff)
downloadqtwebkit-d11f84f5b5cdc0d92a08af01b13472fdd5f9acb9.tar.gz
Imported WebKit commit 75bb2fc5882d2e1b3d5572c2961507996cbca5e3 (http://svn.webkit.org/repository/webkit/trunk@104681)
Diffstat (limited to 'Source/JavaScriptCore/interpreter/Interpreter.cpp')
-rw-r--r--Source/JavaScriptCore/interpreter/Interpreter.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/Source/JavaScriptCore/interpreter/Interpreter.cpp b/Source/JavaScriptCore/interpreter/Interpreter.cpp
index 38befcd4f..980bf8a1a 100644
--- a/Source/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/Source/JavaScriptCore/interpreter/Interpreter.cpp
@@ -370,16 +370,16 @@ NEVER_INLINE bool Interpreter::resolveThisAndProperty(CallFrame* callFrame, Inst
ALWAYS_INLINE CallFrame* Interpreter::slideRegisterWindowForCall(CodeBlock* newCodeBlock, RegisterFile* registerFile, CallFrame* callFrame, size_t registerOffset, int argumentCountIncludingThis)
{
// This ensures enough space for the worst case scenario of zero arguments passed by the caller.
- if (!registerFile->grow(callFrame->registers() + registerOffset + newCodeBlock->m_numParameters + newCodeBlock->m_numCalleeRegisters))
+ if (!registerFile->grow(callFrame->registers() + registerOffset + newCodeBlock->numParameters() + newCodeBlock->m_numCalleeRegisters))
return 0;
- if (argumentCountIncludingThis >= newCodeBlock->m_numParameters) {
+ if (argumentCountIncludingThis >= newCodeBlock->numParameters()) {
Register* newCallFrame = callFrame->registers() + registerOffset;
return CallFrame::create(newCallFrame);
}
// Too few arguments -- copy arguments, then fill in missing arguments with undefined.
- size_t delta = newCodeBlock->m_numParameters - argumentCountIncludingThis;
+ size_t delta = newCodeBlock->numParameters() - argumentCountIncludingThis;
CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset + delta);
Register* dst = &newCallFrame->uncheckedR(CallFrame::thisArgumentOffset());
@@ -556,7 +556,6 @@ void Interpreter::initialize(bool canUseJIT)
for (int i = 0; i < numOpcodeIDs; ++i) {
Opcode opcode = bitwise_cast<void*>(static_cast<uintptr_t>(i));
m_opcodeTable[i] = opcode;
- m_opcodeIDTable.add(opcode, static_cast<OpcodeID>(i));
}
} else {
privateExecute(InitializeAndReturn, 0, 0);
@@ -603,14 +602,14 @@ void Interpreter::dumpRegisters(CallFrame* callFrame)
const Register* end;
JSValue v;
- it = callFrame->registers() - RegisterFile::CallFrameHeaderSize - codeBlock->m_numParameters;
+ it = callFrame->registers() - RegisterFile::CallFrameHeaderSize - codeBlock->numParameters();
v = (*it).jsValue();
#if USE(JSVALUE32_64)
printf("[this] | %10p | %-16s 0x%llx \n", it, v.description(), JSValue::encode(v)); ++it;
#else
printf("[this] | %10p | %-16s %p \n", it, v.description(), JSValue::encode(v)); ++it;
#endif
- end = it + max(codeBlock->m_numParameters - 1, 0); // - 1 to skip "this"
+ end = it + max(codeBlock->numParameters() - 1, 0); // - 1 to skip "this"
if (it != end) {
do {
v = (*it).jsValue();
@@ -669,6 +668,8 @@ void Interpreter::dumpRegisters(CallFrame* callFrame)
bool Interpreter::isOpcode(Opcode opcode)
{
#if ENABLE(COMPUTED_GOTO_INTERPRETER)
+ if (!m_enabled)
+ return opcode >= 0 && static_cast<OpcodeID>(bitwise_cast<uintptr_t>(opcode)) <= op_end;
return opcode != HashTraits<Opcode>::emptyValue()
&& !HashTraits<Opcode>::isDeletedValue(opcode)
&& m_opcodeIDTable.contains(opcode);
@@ -984,13 +985,13 @@ failedJSONP:
CodeBlock* codeBlock = &program->generatedBytecode();
Register* oldEnd = m_registerFile.end();
- Register* newEnd = oldEnd + codeBlock->m_numParameters + RegisterFile::CallFrameHeaderSize + codeBlock->m_numCalleeRegisters;
+ Register* newEnd = oldEnd + codeBlock->numParameters() + RegisterFile::CallFrameHeaderSize + codeBlock->m_numCalleeRegisters;
if (!m_registerFile.grow(newEnd))
return checkedReturn(throwStackOverflowError(callFrame));
- CallFrame* newCallFrame = CallFrame::create(oldEnd + codeBlock->m_numParameters + RegisterFile::CallFrameHeaderSize);
- ASSERT(codeBlock->m_numParameters == 1); // 1 parameter for 'this'.
- newCallFrame->init(codeBlock, 0, scopeChain, CallFrame::noCaller(), codeBlock->m_numParameters, 0);
+ CallFrame* newCallFrame = CallFrame::create(oldEnd + codeBlock->numParameters() + RegisterFile::CallFrameHeaderSize);
+ ASSERT(codeBlock->numParameters() == 1); // 1 parameter for 'this'.
+ newCallFrame->init(codeBlock, 0, scopeChain, CallFrame::noCaller(), codeBlock->numParameters(), 0);
newCallFrame->setThisValue(thisObj);
TopCallFrameSetter topCallFrame(callFrame->globalData(), newCallFrame);
@@ -1255,7 +1256,7 @@ CallFrameClosure Interpreter::prepareForRepeatCall(FunctionExecutable* functionE
}
newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), argumentCountIncludingThis, function);
scopeChain->globalData->topCallFrame = newCallFrame;
- CallFrameClosure result = { callFrame, newCallFrame, function, functionExecutable, scopeChain->globalData, oldEnd, scopeChain, codeBlock->m_numParameters, argumentCountIncludingThis };
+ CallFrameClosure result = { callFrame, newCallFrame, function, functionExecutable, scopeChain->globalData, oldEnd, scopeChain, codeBlock->numParameters(), argumentCountIncludingThis };
return result;
}
@@ -1366,8 +1367,8 @@ JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSValue
CallFrame* newCallFrame = CallFrame::create(m_registerFile.begin() + globalRegisterOffset);
- ASSERT(codeBlock->m_numParameters == 1); // 1 parameter for 'this'.
- newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), codeBlock->m_numParameters, 0);
+ ASSERT(codeBlock->numParameters() == 1); // 1 parameter for 'this'.
+ newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), codeBlock->numParameters(), 0);
newCallFrame->setThisValue(thisValue);
TopCallFrameSetter topCallFrame(callFrame->globalData(), newCallFrame);