[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 75890 df80ae4a87769a8c7f294585e27986128e6d96fb
parent 75889 81ee9f8d4c343c7bbc3e3268cee652723f20c4e0
child 75891 d8c960080f06674b3f7bd544f66823f11b8bec43
push id67
push userclegnitto@mozilla.com
push dateFri, 04 Nov 2011 22:39:41 +0000
treeherdermozilla-release@04778346a3b0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs646411
milestone2.0b13pre
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
[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));
             }
         }