adjustCallerTypes does not aggressively undemote globals anymore (bug 496482).
authorAndreas Gal <gal@uci.edu>
Thu, 04 Jun 2009 21:50:26 -0400
changeset 25892 f706df925e9f157860d8cd6429b63f2975eef845
parent 25891 f473446affc1cdd0a0db441d0f6e7d5b502da4df
child 25893 abd967e2173b88dbc3c4f82a5a460178d877327b
push id1655
push userrsayre@mozilla.com
push dateFri, 05 Jun 2009 07:10:30 +0000
bugs496482
milestone1.9.1pre
adjustCallerTypes does not aggressively undemote globals anymore (bug 496482).
js/src/jstracer.cpp
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -2301,18 +2301,21 @@ TraceRecorder::adjustCallerTypes(Fragmen
     unsigned ngslots = treeInfo->globalSlots->length();
     JS_ASSERT(ngslots == treeInfo->nGlobalTypes());
     TreeInfo* ti = (TreeInfo*)f->vmprivate;
     uint8* map = ti->globalTypeMap();
     uint8* m = map;
     FORALL_GLOBAL_SLOTS(cx, ngslots, gslots,
         LIns* i = get(vp);
         bool isPromote = isPromoteInt(i);
-        if (isPromote && *m == JSVAL_DOUBLE)
+        if (isPromote && *m == JSVAL_DOUBLE) {
             lir->insStorei(get(vp), lirbuf->state, nativeGlobalOffset(vp));
+            /* Aggressively undo speculation so the inner tree will compile if this fails. */
+            oracle.markGlobalSlotUndemotable(cx, gslots[n]);
+        }
         JS_ASSERT(!(!isPromote && *m == JSVAL_INT));
         ++m;
     );
     JS_ASSERT(unsigned(m - map) == ti->nGlobalTypes());
     map = ti->stackTypeMap();
     m = map;
     FORALL_SLOTS_IN_PENDING_FRAMES(cx, 0,
         LIns* i = get(vp);