Invalidate all compilation modes if only a JSScript* is default tip
authorNicholas D. Matsakis <nmatsakis@mozilla.com>
Thu, 01 Nov 2012 15:13:58 -0700
changeset 112021 35b68eb3abd1
parent 112020 a5efa31bdc18
push id95
push usernmatsakis@mozilla.com
push dateThu, 01 Nov 2012 22:14:42 +0000
milestone19.0a1
Invalidate all compilation modes if only a JSScript* is available.
js/src/ion/Ion.cpp
--- a/js/src/ion/Ion.cpp
+++ b/js/src/ion/Ion.cpp
@@ -1930,25 +1930,22 @@ void
 ion::Invalidate(JSContext *cx, const Vector<types::RecompileInfo> &invalid, bool resetUses)
 {
     ion::Invalidate(cx->compartment->types, cx->runtime->defaultFreeOp(), invalid, resetUses);
 }
 
 bool
 ion::Invalidate(JSContext *cx, JSScript *script, bool resetUses)
 {
-    // According to nbp, this path is going away.  So I just
-    // leave it using COMPILE_MODE_SEQ by default, not sure
-    // if that's 100% correct. - nmatsakis
-
-    JS_ASSERT(script->hasIonScript(COMPILE_MODE_SEQ));
+    JS_ASSERT(script->hasAnyIonScript());
 
     Vector<types::RecompileInfo> scripts(cx);
-    if (!scripts.append(script->ionScript(COMPILE_MODE_SEQ)->recompileInfo()))
-        return false;
+    for (EACH_COMPILE_MODE(cmode))
+        if (!scripts.append(script->ionScript(cmode)->recompileInfo()))
+            return false;
 
     Invalidate(cx, scripts, resetUses);
     return true;
 }
 
 void
 ion::FinishInvalidation(FreeOp *fop, JSScript *script)
 {