JavaScriptCore:
2008-05-27 Geoffrey Garen <ggaren@apple.com>
Reviewed by Tim Hatcher.
Fixed https://bugs.webkit.org/show_bug.cgi?id=19183
REGRESSION (r33979): Crash in DebuggerCallFrame::functionName when
clicking button in returnEvent-crash.html
Added two new debugger hooks, willExecuteProgram and didExecuteProgram,
along with code to generate them, code to invoke them when unwinding
due to an exception, and code to dump them.
SunSpider reports no change.
* VM/CodeBlock.cpp:
(KJS::debugHookName): I had to mark this function NEVER_INLINE to avoid
a .4% performance regression. The mind boggles.
WebCore:
2008-05-27 Geoffrey Garen <ggaren@apple.com>
Reviewed by Tim Hatcher.
Fixed https://bugs.webkit.org/show_bug.cgi?id=19183
REGRESSION (r33979): Crash in DebuggerCallFrame::functionName when
clicking button in returnEvent-crash.html
Added implementations for willExecuteProgram and didExecuteProgram. They
take care to update our call frame when entering and exiting programs,
preventing us from keeping around a stale global frame after executing
a program.
eval programs now show up as "anonymous function" in a new scope. This
is slightly better than what they used to do -- overwriting the current
scope -- but obviously we can do better.
WebKit/mac:
2008-05-27 Geoffrey Garen <ggaren@apple.com>
Reviewed by Tim Hatcher.
Fixed https://bugs.webkit.org/show_bug.cgi?id=19183
REGRESSION (r33979): Crash in DebuggerCallFrame::functionName when
clicking button in returnEvent-crash.html
Added implementations for willExecuteProgram and didExecuteProgram, which
take care of making sure we're not hanging on to stale data.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34182 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/VM/CodeBlock.cpp b/JavaScriptCore/VM/CodeBlock.cpp
index dbe2600..28c2661 100644
--- a/JavaScriptCore/VM/CodeBlock.cpp
+++ b/JavaScriptCore/VM/CodeBlock.cpp
@@ -95,16 +95,23 @@
return (regexpToSourceString(regexp) + "(@re" + UString::from(re) + ")").UTF8String();
}
-static const char* debugHookName(int debugHookID)
+NEVER_INLINE static const char* debugHookName(int debugHookID)
{
- if (debugHookID == DidEnterCallFrame)
+ switch((DebugHookID)debugHookID) {
+ case DidEnterCallFrame:
return "didEnterCallFrame";
- else if (debugHookID == WillLeaveCallFrame)
+ case WillLeaveCallFrame:
return "willLeaveCallFrame";
- else {
- ASSERT(debugHookID == WillExecuteStatement);
+ case WillExecuteStatement:
return "willExecuteStatement";
+ case WillExecuteProgram:
+ return "willExecuteProgram";
+ case DidExecuteProgram:
+ return "didExecuteProgram";
}
+
+ ASSERT_NOT_REACHED();
+ return "";
}
static int jumpTarget(const Vector<Instruction>::const_iterator& begin, Vector<Instruction>::const_iterator& it, int offset)