summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/javascriptcore
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-09-29 07:27:40 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-09-29 09:31:17 (GMT)
commitf10dc46c0a0763df4e136bd4664b68e1a1388ad6 (patch)
tree909cbb4944fed9a3914c55cf56c66245d66fe7a7 /src/3rdparty/javascriptcore
parentd2459611fd3650d8c80a3ccafd9ec3d58457a888 (diff)
downloadQt-f10dc46c0a0763df4e136bd4664b68e1a1388ad6.zip
Qt-f10dc46c0a0763df4e136bd4664b68e1a1388ad6.tar.gz
Qt-f10dc46c0a0763df4e136bd4664b68e1a1388ad6.tar.bz2
QScript: fix the way the js stack is advanced.
It is possible to call QScriptEngine::pushContext before we start any evaluation. We need to change JSC so it doesn't always start at the beginning of the stack. Also fix QScriptContext::pushContext not to waste space between callframes. Reviewed-by: Kent Hansen
Diffstat (limited to 'src/3rdparty/javascriptcore')
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp
index bfb0307..4200023 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp
@@ -885,13 +885,21 @@ JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSObjec
}
Register* oldEnd = m_registerFile.end();
+#ifdef QT_BUILD_SCRIPT_LIB //with QtScript, we do not necesserly start from scratch
+ Register* newEnd = oldEnd + globalRegisterOffset + codeBlock->m_numCalleeRegisters;
+#else
Register* newEnd = m_registerFile.start() + globalRegisterOffset + codeBlock->m_numCalleeRegisters;
+#endif
if (!m_registerFile.grow(newEnd)) {
*exception = createStackOverflowError(callFrame);
return jsNull();
}
+#ifdef QT_BUILD_SCRIPT_LIB //with QtScript, we do not necesserly start from scratch
+ CallFrame* newCallFrame = CallFrame::create(oldEnd + globalRegisterOffset);
+#else
CallFrame* newCallFrame = CallFrame::create(m_registerFile.start() + globalRegisterOffset);
+#endif
// a 0 codeBlock indicates a built-in caller
newCallFrame->r(codeBlock->thisRegister()) = JSValue(thisObj);