[INFER] Don't track type sets of values pushed by opcode fusions, bug 646411.
authorBrian Hackett <bhackett1024@gmail.com>
Wed, 30 Mar 2011 11:30:23 -0700
changeset 74874 df80ae4a87769a8c7f294585e27986128e6d96fb
parent 74873 81ee9f8d4c343c7bbc3e3268cee652723f20c4e0
child 74875 d8c960080f06674b3f7bd544f66823f11b8bec43
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
bugs646411
milestone2.0b13pre
[INFER] Don't track type sets of values pushed by opcode fusions, bug 646411.
js/src/jit-test/tests/jaeger/bug646411.js
js/src/methodjit/Compiler.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/jaeger/bug646411.js
@@ -0,0 +1,9 @@
+__proto__ = Function();
+eval("\
+var MS = 16;\
+addNewTestCase(new Date(1899,11,31,16,0,0), \"new Date(1899,11,31,16,0,0)\",\
+typeof UTC_DAY == 'undefined');\
+function addNewTestCase( DateCase, DateString, ResultArray ) {\
+        ResultArray[MS];\
+}\
+");
--- a/js/src/methodjit/Compiler.cpp
+++ b/js/src/methodjit/Compiler.cpp
@@ -2601,18 +2601,22 @@ mjit::Compiler::generateMethod()
 #endif
             return Compile_Abort;
         }
 
     /**********************
      *  END COMPILER OPS  *
      **********************/ 
 
-        if (cx->typeInferenceEnabled()) {
-            /* Inform the frame of the type sets for values just pushed. */
+        if (cx->typeInferenceEnabled() && PC == oldPC + analyze::GetBytecodeLength(oldPC)) {
+            /*
+             * Inform the frame of the type sets for values just pushed. Skip
+             * this if we did any opcode fusions, we don't keep track of the
+             * associated type sets in such cases.
+             */
             unsigned nuses = analyze::GetUseCount(script, oldPC - script->code);
             unsigned ndefs = analyze::GetDefCount(script, oldPC - script->code);
             for (unsigned i = 0; i < ndefs; i++) {
                 frame.learnTypeSet(opinfo->stackDepth - nuses + i,
                                    script->types->pushed(oldPC - script->code, i));
             }
         }