Don't disable ICs on error paths, bug 694200. r=dvander a=jst
authorBrian Hackett <bhackett1024@gmail.com>
Sat, 22 Oct 2011 07:24:51 -0700
changeset 79122 b9725bcebd715b1d8add6d7589a93040bde8ab63
parent 79121 021bf68f4d51d6dcc0adf968b0bd231871083d9b
child 79123 781ed08803ea10ee78fa48aadd3bea222b9e86a3
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander, jst
bugs694200
milestone9.0a2
Don't disable ICs on error paths, bug 694200. r=dvander a=jst
js/src/methodjit/PolyIC.cpp
--- a/js/src/methodjit/PolyIC.cpp
+++ b/js/src/methodjit/PolyIC.cpp
@@ -1883,36 +1883,28 @@ class BindNameCompiler : public PICStubC
     }
 
     JSObject *update()
     {
         JS_ASSERT(scopeChain->getParent());
         RecompilationMonitor monitor(cx);
 
         JSObject *obj = js_FindIdentifierBase(cx, scopeChain, ATOM_TO_JSID(atom));
-
-        if (monitor.recompiled())
+        if (!obj || monitor.recompiled())
             return obj;
 
-        if (!obj) {
-            disable("error");
-            return obj;
-        }
-
         if (!pic.hit) {
             spew("first hit", "nop");
             pic.hit = true;
             return obj;
         }
 
         LookupStatus status = generateStub(obj);
-        if (status == Lookup_Error) {
-            disable("error");
+        if (status == Lookup_Error)
             return NULL;
-        }
 
         return obj;
     }
 };
 
 static void JS_FASTCALL
 DisabledGetPropIC(VMFrame &f, ic::PICInfo *pic)
 {
@@ -1983,20 +1975,18 @@ ic::GetProp(VMFrame &f, ic::PICInfo *pic
     if (!obj)
         THROW();
 
     if (!monitor.recompiled() && pic->shouldUpdate(f.cx)) {
         VoidStubPIC stub = pic->usePropCache
                            ? DisabledGetPropIC
                            : DisabledGetPropICNoCache;
         GetPropCompiler cc(f, script, obj, *pic, atom, stub);
-        if (!cc.update()) {
-            cc.disable("error");
+        if (!cc.update())
             THROW();
-        }
     }
 
     Value v;
     if (!obj->getGeneric(f.cx, ATOM_TO_JSID(atom), &v))
         THROW();
 
     f.regs.sp[-1] = v;
 }
@@ -2393,17 +2383,16 @@ GetElementIC::disable(JSContext *cx, con
                  : JS_FUNC_TO_DATA_PTR(void *, DisabledCallElem);
     BaseIC::disable(cx, reason, stub);
     return Lookup_Uncacheable;
 }
 
 LookupStatus
 GetElementIC::error(JSContext *cx)
 {
-    disable(cx, "error");
     return Lookup_Error;
 }
 
 void
 GetElementIC::purge(Repatcher &repatcher)
 {
     // Repatch the inline jumps.
     if (inlineTypeGuardPatched)
@@ -2983,17 +2972,16 @@ SetElementIC::disable(JSContext *cx, con
     VoidStub stub = APPLY_STRICTNESS(stubs::SetElem, strictMode);
     BaseIC::disable(cx, reason, JS_FUNC_TO_DATA_PTR(void *, stub));
     return Lookup_Uncacheable;
 }
 
 LookupStatus
 SetElementIC::error(JSContext *cx)
 {
-    disable(cx, "error");
     return Lookup_Error;
 }
 
 void
 SetElementIC::purge(Repatcher &repatcher)
 {
     // Repatch the inline jumps.
     if (inlineClaspGuardPatched)