Fix recompilation hazard in CALLELEMENT, bug 686107. r=dvander
authorBrian Hackett <bhackett1024@gmail.com>
Fri, 07 Oct 2011 07:45:50 -0700
changeset 78338 7277c1bddd227eaba8dfe8eb843424948a1ca910
parent 78337 463ad8fec3e5410adae430e2ec25aa9b637da684
child 78339 6171821962370aed9697db2600ab0b35063eff44
push id21284
push usermbrubeck@mozilla.com
push dateFri, 07 Oct 2011 19:07:02 +0000
treeherdermozilla-central@35954e6f3167 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs686107
milestone10.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Fix recompilation hazard in CALLELEMENT, bug 686107. r=dvander
js/src/methodjit/PolyIC.cpp
--- a/js/src/methodjit/PolyIC.cpp
+++ b/js/src/methodjit/PolyIC.cpp
@@ -2874,29 +2874,31 @@ ic::CallElement(VMFrame &f, ic::GetEleme
 
     // Right now, we don't optimize for strings.
     if (!f.regs.sp[-2].isObject()) {
         ic->disable(cx, "non-object");
         stubs::CallElem(f);
         return;
     }
 
+    RecompilationMonitor monitor(cx);
+
     Value thisv = f.regs.sp[-2];
     JSObject *thisObj = ValuePropertyBearer(cx, thisv, -2);
     if (!thisObj)
         THROW();
 
     jsid id;
     Value idval = f.regs.sp[-1];
     if (idval.isInt32() && INT_FITS_IN_JSID(idval.toInt32()))
         id = INT_TO_JSID(idval.toInt32());
     else if (!js_InternNonIntElementId(cx, thisObj, idval, &id))
         THROW();
 
-    if (ic->shouldUpdate(cx)) {
+    if (!monitor.recompiled() && ic->shouldUpdate(cx)) {
 #ifdef DEBUG
         f.regs.sp[-2] = MagicValue(JS_GENERIC_MAGIC);
 #endif
         LookupStatus status = ic->update(f, cx, thisObj, idval, id, &f.regs.sp[-2]);
         if (status != Lookup_Uncacheable) {
             if (status == Lookup_Error)
                 THROW();