[INFER] Allow known integers to be copies of doubles, bug 645657.
authorBrian Hackett <bhackett1024@gmail.com>
Tue, 29 Mar 2011 22:17:23 -0700
changeset 74871 842d95ddaec5049b3c4b917d4d76cdd72ce27ac5
parent 74870 e786040097a38690b8078491a907b3c96b0eff4e
child 74872 93bc88428f167e29e1060e972d199af4543c35cd
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
bugs645657
milestone2.0b13pre
[INFER] Allow known integers to be copies of doubles, bug 645657.
js/src/jit-test/tests/jaeger/bug645657.js
js/src/methodjit/FrameState.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/jaeger/bug645657.js
@@ -0,0 +1,8 @@
+function f() {
+    var x = 3;
+    var y = 1.2;
+    var z;
+    y = --z;
+    x = z++;
+}
+f();
--- a/js/src/methodjit/FrameState.cpp
+++ b/js/src/methodjit/FrameState.cpp
@@ -2460,24 +2460,23 @@ FrameState::storeTop(FrameEntry *target,
      * consistent ordering - all copies of |backing| are tracked after 
      * |backing|. Transitively, only one swap is needed.
      */
     if (backing->trackerIndex() < target->trackerIndex())
         swapInTracker(backing, target);
 
     if (backing->isType(JSVAL_TYPE_DOUBLE)) {
         FPRegisterID fpreg = tempFPRegForData(backing);
-        if (type == JSVAL_TYPE_UNKNOWN) {
+        if (type != JSVAL_TYPE_DOUBLE) {
             masm.storeDouble(fpreg, addressOf(target));
             target->resetSynced();
 
             /* We're about to invalidate the backing, so forget the FP register. */
             forgetReg(fpreg);
         } else {
-            JS_ASSERT(type == JSVAL_TYPE_DOUBLE);
             target->data.setFPRegister(fpreg);
             regstate(fpreg).reassociate(target);
         }
 
         target->setType(JSVAL_TYPE_DOUBLE);
     } else {
         /*
          * Move the backing store down - we spill registers here, but we could be