diff options
author | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2009-08-11 07:29:36 (GMT) |
---|---|---|
committer | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2009-08-11 07:29:36 (GMT) |
commit | 2fdff951927ac4f2aab47c423e73d002b3bed628 (patch) | |
tree | 55741f0fd22784b9bbe8569ea741cf74e9ebd1dd /src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp | |
parent | 3cd1422bbc106ebe4bf14b4af14c90971fe416eb (diff) | |
download | Qt-2fdff951927ac4f2aab47c423e73d002b3bed628.zip Qt-2fdff951927ac4f2aab47c423e73d002b3bed628.tar.gz Qt-2fdff951927ac4f2aab47c423e73d002b3bed628.tar.bz2 |
Calls to JSC::Debugger's new events that where created in
b62ab93d001d2f3238e24faa133720cb877e3023 commit.
In CallData and ConstructData native function call were replaced by
class with operator() that decorate every call with debugger->functionEntry
and debugger->functionExit events.
In Interpreter new debugger calls for functionExit, functionEntry,
exceptionThrow and exceptionCatch events where created
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp')
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp index 0c3081c..fe663ae 100644 --- a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp @@ -550,7 +550,8 @@ NEVER_INLINE HandlerInfo* Interpreter::throwException(CallFrame*& callFrame, JSV } } - if (Debugger* debugger = callFrame->dynamicGlobalObject()->debugger()) { + Debugger* debugger = callFrame->dynamicGlobalObject()->debugger(); + if (debugger) { DebuggerCallFrame debuggerCallFrame(callFrame, exceptionValue); debugger->exception(debuggerCallFrame, codeBlock->ownerNode()->sourceID(), codeBlock->lineNumberForBytecodeOffset(callFrame, bytecodeOffset)); } @@ -575,10 +576,18 @@ NEVER_INLINE HandlerInfo* Interpreter::throwException(CallFrame*& callFrame, JSV HandlerInfo* handler = 0; while (!(handler = codeBlock->handlerForBytecodeOffset(bytecodeOffset))) { - if (!unwindCallFrame(callFrame, exceptionValue, bytecodeOffset, codeBlock)) + if (!unwindCallFrame(callFrame, exceptionValue, bytecodeOffset, codeBlock)) { +#ifdef QT_BUILD_SCRIPT_LIB + if (debugger) + debugger->exceptionThrow(DebuggerCallFrame(callFrame, exceptionValue), codeBlock->ownerNode()->sourceID(),false); +#endif return 0; + } } - +#ifdef QT_BUILD_SCRIPT_LIB + if (debugger) + debugger->exceptionThrow(DebuggerCallFrame(callFrame, exceptionValue), codeBlock->ownerNode()->sourceID(),true); +#endif // Now unwind the scope chain within the exception handler's call frame. ScopeChainNode* scopeChain = callFrame->scopeChain(); @@ -3303,17 +3312,27 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi register base to those of the calling function. */ +#ifdef QT_BUILD_SCRIPT_LIB + Debugger* debugger = callFrame->dynamicGlobalObject()->debugger(); + intptr_t sourceId = callFrame->codeBlock()->source()->asID(); +#endif + int result = (++vPC)->u.operand; if (callFrame->codeBlock()->needsFullScopeChain()) callFrame->scopeChain()->deref(); JSValue returnValue = callFrame->r(result).jsValue(); +#ifdef QT_BUILD_SCRIPT_LIB + if (debugger) { + debugger->functionExit(returnValue, sourceId); + } +#endif vPC = callFrame->returnPC(); int dst = callFrame->returnValueRegister(); callFrame = callFrame->callerFrame(); - + if (callFrame->hasHostCallFrameFlag()) return returnValue; @@ -3674,6 +3693,16 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi */ ASSERT(exceptionValue); ASSERT(!globalData->exception); + +#ifdef QT_BUILD_SCRIPT_LIB + CodeBlock* codeBlock = callFrame->codeBlock(); + Debugger* debugger = callFrame->dynamicGlobalObject()->debugger(); + if (debugger) { + DebuggerCallFrame debuggerCallFrame(callFrame, exceptionValue); + debugger->exceptionCatch(debuggerCallFrame, codeBlock->ownerNode()->sourceID()); + } +#endif + int ex = (++vPC)->u.operand; callFrame->r(ex) = exceptionValue; exceptionValue = JSValue(); |