[JAEGER] Fixed bug in syncing doubles.
authorDavid Anderson <danderson@mozilla.com>
Fri, 28 May 2010 00:42:40 -0700
changeset 52614 a96f70dac68d2078ea88cfd0912647628db30f51
parent 52613 85d1995d0c5c44438d7034646461538c66ca6f60
child 52615 e62d41ce373de374b973e51b429d974c8dadc8ec
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
[JAEGER] Fixed bug in syncing doubles.
js/src/methodjit/nunbox/Assembler.h
js/src/methodjit/nunbox/FrameEntry.h
js/src/methodjit/nunbox/FrameState.cpp
--- a/js/src/methodjit/nunbox/Assembler.h
+++ b/js/src/methodjit/nunbox/Assembler.h
@@ -50,16 +50,20 @@ class Assembler : public BaseAssembler
     static const uint32 PAYLOAD_OFFSET = 0;
     static const uint32 TAG_OFFSET     = 4;
 
   public:
     Address payloadOf(Address address) {
         return address;
     }
 
+    Address tagOf(Address address) {
+        return Address(address.base, address.offset + TAG_OFFSET);
+    }
+
     void loadTypeTag(Address address, RegisterID reg) {
         load32(Address(address.base, address.offset + TAG_OFFSET), reg);
     }
 
     void storeTypeTag(Imm32 imm, Address address) {
         store32(imm, Address(address.base, address.offset + TAG_OFFSET));
     }
 
@@ -73,15 +77,24 @@ class Assembler : public BaseAssembler
 
     void storeData32(Imm32 imm, Address address) {
         store32(imm, Address(address.base, address.offset + PAYLOAD_OFFSET));
     }
 
     void storeData32(RegisterID reg, Address address) {
         store32(reg, Address(address.base, address.offset + PAYLOAD_OFFSET));
     }
+
+    void storeValue(const Value &v, Address address) {
+        jsval_layout jv;
+        jv.asBits = Jsvalify(v);
+
+        store32(Imm32(jv.s.mask32), tagOf(address));
+        if (!v.isUndefined())
+            store32(Imm32(jv.s.payload.u32), payloadOf(address));
+    }
 };
 
 } /* namespace js */
 } /* namespace mjit */
 
 #endif
 
--- a/js/src/methodjit/nunbox/FrameEntry.h
+++ b/js/src/methodjit/nunbox/FrameEntry.h
@@ -71,17 +71,17 @@ class FrameEntry
         return type.isConstant();
     }
 
     uint32 getTypeTag() {
         return v_.s.mask32;
     }
 
     uint32 getPayload32() {
-        JS_ASSERT(!Valueify(v_.asBits).isDouble());
+        JS_ASSERT(!Valueify(v_.asBits).isDouble() || type.synced());
         return v_.s.payload.u32;
     }
 
     uint32 copyOf() {
         JS_ASSERT(type.isCopy() || data.isCopy());
         return index_;
     }
 
--- a/js/src/methodjit/nunbox/FrameState.cpp
+++ b/js/src/methodjit/nunbox/FrameState.cpp
@@ -168,20 +168,26 @@ FrameState::syncData(FrameEntry *fe, Ass
         masm.storeData32(fe->data.reg(), addressOf(fe));
     fe->data.setSynced();
 }
 
 void
 FrameState::sync(Assembler &masm, RegSnapshot &snapshot) const
 {
     for (FrameEntry *fe = base; fe < sp; fe++) {
-        if (fe->type.needsSync())
-            syncType(fe, masm);
-        if (fe->data.needsSync())
-            syncData(fe, masm);
+        if (fe->isConstant()) {
+            JS_ASSERT(fe->type.synced() == fe->data.synced());
+            if (!fe->data.synced())
+                masm.storeValue(fe->getValue(), addressOf(fe));
+        } else {
+            if (fe->type.needsSync())
+                syncType(fe, masm);
+            if (fe->data.needsSync())
+                syncData(fe, masm);
+        }
     }
 
     JS_STATIC_ASSERT(sizeof(snapshot.regs) == sizeof(regstate));
     JS_STATIC_ASSERT(sizeof(RegState) == sizeof(uint32));
     memcpy(snapshot.regs, regstate, sizeof(regstate));
     snapshot.alloc = regalloc;
 }