[INFER] Add recompilation rejoin calls in JSOP_GETELEM/JSOP_CALLELEM, bug 641269.
authorBrian Hackett <bhackett1024@gmail.com>
Sun, 13 Mar 2011 20:46:30 -0700
changeset 74763 89a0db8a631717f63b4913a699b22a1b7119f997
parent 74762 92ba109b97da03a0b61fc0a7142ce4d1913f8227
child 74764 479604222c8e8f5ddce3a57a7f4a0763db95a5ed
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
bugs641269
milestone2.0b13pre
[INFER] Add recompilation rejoin calls in JSOP_GETELEM/JSOP_CALLELEM, bug 641269.
js/src/jit-test/tests/jaeger/recompile/bug641269.js
js/src/methodjit/FastOps.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/jaeger/recompile/bug641269.js
@@ -0,0 +1,5 @@
+// |jit-test| debug
+
+(function() {
+  const x = [][x]
+})()
--- a/js/src/methodjit/FastOps.cpp
+++ b/js/src/methodjit/FastOps.cpp
@@ -1644,16 +1644,21 @@ mjit::Compiler::jsop_getelem(bool isCall
     if (isCall)
         frame.pushSynced(knownPushedType(1));
 
     stubcc.rejoin(Changes(2));
 
 #ifdef JS_POLYIC
     if (!getElemICs.append(ic))
         return false;
+
+    if (recompiling) {
+        OOL_STUBCALL(isCall ? stubs::CallElem : stubs::GetElem);
+        stubcc.rejoin(Changes(2));
+    }
 #endif
 
     return true;
 }
 
 static inline bool
 ReallySimpleStrictTest(FrameEntry *fe)
 {