Add nestedExit to InterpState and comment its fields.
authorAndreas Gal <gal@mozilla.com>
Wed, 13 Aug 2008 17:12:55 -0700
changeset 18147 3b57c7a92f7488b0d268551e3549cde3716da774
parent 18142 d96e0ab82bb857240580ce26f88172477c075eb5
child 18148 e4548362fa74e5449c76dcda675959130cf8f863
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.1a2pre
Add nestedExit to InterpState and comment its fields.
js/src/jstracer.cpp
js/src/nanojit/avmplus.h
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -1364,16 +1364,18 @@ TraceRecorder::emitTreeCall(Fragment* in
     SideExit* exit = lr->exit;
     import(ti, inner_sp, exit->numGlobalSlots, exit->calldepth, 
            exit->typeMap, exit->typeMap + exit->numGlobalSlots);
     /* Restore sp and rp to their original values (we still have them in a register). */
     if (callDepth > 0) {
         lir->insStorei(lirbuf->sp, lirbuf->state, offsetof(InterpState, sp));
         lir->insStorei(lirbuf->rp, lirbuf->state, offsetof(InterpState, rp));
     }
+    /* Store the guard pointer in case we exit on an unexpected guard */
+    lir->insStorei(lir->insImmPtr(lr), lirbuf->state, offsetof(InterpState, nestedExit));
     /* Guard that we come out of the inner tree along the same side exit we came out when
        we called the inner tree at recording time. */
     guard(true, lir->ins2(LIR_eq, ret, lir->insImmPtr(lr)), NESTED_EXIT);
 }
 
 int
 nanojit::StackFilter::getTop(LInsp guard)
 {
--- a/js/src/nanojit/avmplus.h
+++ b/js/src/nanojit/avmplus.h
@@ -284,22 +284,23 @@ operator delete(void* p)
 #define MMGC_MEM_TYPE(x)
 
 typedef int FunctionID;
 
 namespace avmplus
 {
     struct InterpState
     {
-        void* sp;
-        void* rp;
-        void* gp;
-        JSContext *cx;
-        void* eos;
-        void* eor;
+        void* sp; /* native stack pointer, stack[0] is spbase[0] */
+        void* rp; /* call stack pointer */
+        void* gp; /* global frame pointer */
+        JSContext *cx; /* current VM context handle */
+        void* eos; /* first unusable word after the native stack */
+        void* eor; /* first unusable word after the call stack */
+        nanojit::GuardRecord* nestedExit; /* innermost nested guard for NESTED_EXIT exits */
     };
 
     class String
     {
     };
 
     typedef class String AvmString;