summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJedrzej Nowacki <jedrzej.nowacki@nokia.com>2009-09-03 15:12:15 (GMT)
committerJedrzej Nowacki <jedrzej.nowacki@nokia.com>2009-09-07 07:58:59 (GMT)
commitd9abfdc26d711ffdfcbb8ac04a314aa80396e56f (patch)
tree4b20629802a66d8ccc70e0ecd0ea23b4f8c693ba
parentbd4771a8a135bf2307c6fb2e27ccdac64637992d (diff)
downloadQt-d9abfdc26d711ffdfcbb8ac04a314aa80396e56f.zip
Qt-d9abfdc26d711ffdfcbb8ac04a314aa80396e56f.tar.gz
Qt-d9abfdc26d711ffdfcbb8ac04a314aa80396e56f.tar.bz2
Few expected fails were fixed in QScriptEngineAgent
functionExit event was partially fixed. The time point in JS execution with JIT enabled works now but still there is no returning value in few cases. Autotest was corrected. Reviewed-by: Kent Hansen
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp4
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp10
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h1
-rw-r--r--src/script/api/qscriptengineagent.cpp4
-rw-r--r--tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp17
5 files changed, 16 insertions, 20 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp
index 4a33e67..dab6682 100644
--- a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp
@@ -285,6 +285,10 @@ void JIT::emit_op_tear_off_arguments(Instruction*)
void JIT::emit_op_ret(Instruction* currentInstruction)
{
+#ifdef QT_BUILD_SCRIPT_LIB
+ JITStubCall stubCall(this, JITStubs::cti_op_debug_return);
+ stubCall.call();
+#endif
// We could JIT generate the deref, only calling out to C when the refcount hits zero.
if (m_codeBlock->needsFullScopeChain())
JITStubCall(this, JITStubs::cti_op_ret_scopeChain).call();
diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp
index 0eb0799..1d39ba4 100644
--- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp
@@ -2750,6 +2750,16 @@ DEFINE_STUB_FUNCTION(void, op_debug_catch)
debugger->exceptionCatch(DebuggerCallFrame(callFrame), callFrame->codeBlock()->ownerNode()->sourceID());
}
}
+
+DEFINE_STUB_FUNCTION(void, op_debug_return)
+{
+ STUB_INIT_STACK_FRAME(stackFrame);
+ CallFrame* callFrame = stackFrame.callFrame;
+ if (JSC::Debugger* debugger = callFrame->lexicalGlobalObject()->debugger() ) {
+ debugger->functionExit(JSValue(), callFrame->codeBlock()->ownerNode()->sourceID());
+ }
+}
+
#endif
DEFINE_STUB_FUNCTION(EncodedJSValue, vm_throw)
diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h
index 60bf64a..325c3fd 100644
--- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h
+++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h
@@ -223,6 +223,7 @@ namespace JITStubs { extern "C" {
void JIT_STUB cti_op_debug(STUB_ARGS_DECLARATION);
#ifdef QT_BUILD_SCRIPT_LIB
void JIT_STUB cti_op_debug_catch(STUB_ARGS_DECLARATION);
+ void JIT_STUB cti_op_debug_return(STUB_ARGS_DECLARATION);
#endif
void JIT_STUB cti_op_end(STUB_ARGS_DECLARATION);
void JIT_STUB cti_op_jmp_scopes(STUB_ARGS_DECLARATION);
diff --git a/src/script/api/qscriptengineagent.cpp b/src/script/api/qscriptengineagent.cpp
index 333a415..13bc6a6 100644
--- a/src/script/api/qscriptengineagent.cpp
+++ b/src/script/api/qscriptengineagent.cpp
@@ -146,11 +146,7 @@ void QScriptEngineAgentPrivate::returnEvent(const JSC::DebuggerCallFrame& frame,
{
Q_UNUSED(frame);
Q_UNUSED(lineno);
-#if ENABLE(JIT)
- functionExit(JSC::JSValue(), sourceID);
-#else
Q_UNUSED(sourceID);
-#endif
}
void QScriptEngineAgentPrivate::exceptionThrow(const JSC::DebuggerCallFrame& frame, intptr_t sourceID, bool hasHandler)
diff --git a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
index 8fe6839..f92bec3 100644
--- a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
+++ b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
@@ -176,7 +176,6 @@ struct ScriptEngineEvent
: type(ExceptionThrow), scriptId(scriptId),
value(exception), hasExceptionHandler(hasHandler)
{ }
-
};
class ScriptEngineSpy : public QScriptEngineAgent, public QList<ScriptEngineEvent>
@@ -1834,7 +1833,7 @@ void tst_QScriptEngineAgent::eventOrder_functions()
eng.evaluate("foo('ciao')");
- //QCOMPARE(spy->count(), 45);
+ QCOMPARE(spy->count(), 45);
// load
QCOMPARE(spy->at(25).type, ScriptEngineEvent::ScriptLoad);
@@ -1875,33 +1874,21 @@ void tst_QScriptEngineAgent::eventOrder_functions()
// bar() exit
QCOMPARE(spy->at(39).type, ScriptEngineEvent::FunctionExit);
QCOMPARE(spy->at(39).scriptId, spy->at(21).scriptId);
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "function return value is not reported when JIT is enabled", Continue);
QVERIFY(spy->at(39).value.isError());
// restore context
QCOMPARE(spy->at(40).type, ScriptEngineEvent::ContextPop);
// foo() exit
QCOMPARE(spy->at(41).type, ScriptEngineEvent::FunctionExit);
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "script ID for function exit is not correct when JIT is enabled", Continue);
QCOMPARE(spy->at(41).scriptId, spy->at(0).scriptId);
QVERIFY(spy->at(41).value.isError());
// restore context
QCOMPARE(spy->at(42).type, ScriptEngineEvent::ContextPop);
// evaluate() exit
QCOMPARE(spy->at(43).type, ScriptEngineEvent::FunctionExit);
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "script ID for function exit is not correct when JIT is enabled", Continue);
QCOMPARE(spy->at(43).scriptId, spy->at(26).scriptId);
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "function return value is not reported when JIT is enabled", Continue);
QVERIFY(spy->at(43).value.isError());
// unload
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "wrong event type when JIT is enabled", Continue);
QCOMPARE(spy->at(44).type, ScriptEngineEvent::ScriptUnload);
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "wrong script ID when JIT is enabled", Continue);
QCOMPARE(spy->at(44).scriptId, spy->at(25).scriptId);
}
delete spy;
@@ -1958,8 +1945,6 @@ void tst_QScriptEngineAgent::eventOrder_signalsHandling()
emit testSignal(123);
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "too many events reported when JIT is enabled", Abort);
QCOMPARE(spy->count(), 14);
// new context
QCOMPARE(spy->at(4).type, ScriptEngineEvent::ContextPush);