Keep track of topCallFrame for Stack traces
https://bugs.webkit.org/show_bug.cgi?id=66571

Patch by Juan C. Montemayor <jmont@apple.com> on 2011-08-24
Reviewed by Geoffrey Garen.

This patch adds a TopCallFrame to JSC in order to have that information
when an error is thrown to create a stack trace. The TopCallFrame is
updated throughout select points in the Interpreter and the JSC.

* interpreter/Interpreter.cpp:
(JSC::Interpreter::unwindCallFrame):
(JSC::Interpreter::throwException):
(JSC::Interpreter::execute):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
(JSC::Interpreter::privateExecute):
* interpreter/Interpreter.h:
(JSC::TopCallFrameSetter::TopCallFrameSetter):
(JSC::TopCallFrameSetter::~TopCallFrameSetter):
* jit/JIT.h:
* jit/JITInlineMethods.h:
(JSC::JIT::updateTopCallFrame):
* jit/JITStubCall.h:
(JSC::JITStubCall::call):
* jit/JITStubs.cpp:
(JSC::throwExceptionFromOpCall):
(JSC::DEFINE_STUB_FUNCTION):
(JSC::arityCheckFor):
* runtime/JSGlobalData.cpp:
(JSC::JSGlobalData::JSGlobalData):
* runtime/JSGlobalData.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@93755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/jit/JIT.h b/Source/JavaScriptCore/jit/JIT.h
index 1dabc59..54fbf06 100644
--- a/Source/JavaScriptCore/jit/JIT.h
+++ b/Source/JavaScriptCore/jit/JIT.h
@@ -370,7 +370,7 @@
 #if ENABLE(OPCODE_SAMPLING)
         static const int patchOffsetGetByIdSlowCaseCall = 37;
 #else
-        static const int patchOffsetGetByIdSlowCaseCall = 27;
+        static const int patchOffsetGetByIdSlowCaseCall = 33;
 #endif
         static const int patchOffsetOpCallCompareToJump = 6;
 
@@ -428,7 +428,7 @@
 #if ENABLE(OPCODE_SAMPLING)
         #error "OPCODE_SAMPLING is not yet supported"
 #else
-        static const int patchOffsetGetByIdSlowCaseCall = 30;
+        static const int patchOffsetGetByIdSlowCaseCall = 40;
 #endif
         static const int patchOffsetOpCallCompareToJump = 16;
 
@@ -606,7 +606,7 @@
 #if ENABLE(OPCODE_SAMPLING)
         static const int patchOffsetGetByIdSlowCaseCall = 64;
 #else
-        static const int patchOffsetGetByIdSlowCaseCall = 41;
+        static const int patchOffsetGetByIdSlowCaseCall = 54;
 #endif
         static const int patchOffsetOpCallCompareToJump = 9;
 
@@ -961,6 +961,7 @@
 
         void restoreArgumentReference();
         void restoreArgumentReferenceForTrampoline();
+        void updateTopCallFrame();
 
         Call emitNakedCall(CodePtr function = CodePtr());