Bug 584219 Fix the use of sPayloadOffset for big endian machine r=lw
authorGinn Chen <ginn.chen@sun.com>
Wed, 11 Aug 2010 06:53:03 +0800
changeset 50479 ba24f1f29feb8ade3243634e89c73470b34f32d7
parent 50478 6d977009d79f814b27c755a075737e4e8765a7ba
child 50480 1140fcfc807a2ed509c459e461ae59af8a0f7384
push idunknown
push userunknown
push dateunknown
reviewerslw
bugs584219
milestone2.0b4pre
Bug 584219 Fix the use of sPayloadOffset for big endian machine r=lw
js/src/jstracer.cpp
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -3490,31 +3490,31 @@ TraceRecorder::importImpl(LIns* base, pt
         JS_ASSERT(hasInt32Repr(*(const Value *)p));
 
         /*
          * Ok, we have a valid demotion attempt pending, so insert an integer
          * read and promote it to double since all arithmetic operations expect
          * to see doubles on entry. The first op to use this slot will emit a
          * d2i cast which will cancel out the i2d we insert here.
          */
-        ins = lir->insLoad(LIR_ldi, base, offset + sPayloadOffset, accSet);
+        ins = lir->insLoad(LIR_ldi, base, offset, accSet);
         ins = lir->ins1(LIR_i2d, ins);
     } else {
         JS_ASSERT_IF(t != JSVAL_TYPE_BOXED && !IsFrameObjPtrTraceType(t),
                      ((const Value *)p)->isNumber() == (t == JSVAL_TYPE_DOUBLE));
         if (t == JSVAL_TYPE_DOUBLE) {
             ins = lir->insLoad(LIR_ldd, base, offset, accSet);
         } else if (t == JSVAL_TYPE_BOOLEAN) {
-            ins = lir->insLoad(LIR_ldi, base, offset + sPayloadOffset, accSet);
+            ins = lir->insLoad(LIR_ldi, base, offset, accSet);
         } else if (t == JSVAL_TYPE_UNDEFINED) {
             ins = INS_UNDEFINED();
         } else if (t == JSVAL_TYPE_MAGIC) {
-            ins = lir->insLoad(LIR_ldi, base, offset + sPayloadOffset, accSet);
+            ins = lir->insLoad(LIR_ldi, base, offset, accSet);
         } else {
-            ins = lir->insLoad(LIR_ldp, base, offset + sPayloadOffset, accSet);
+            ins = lir->insLoad(LIR_ldp, base, offset, accSet);
         }
     }
     checkForGlobalObjectReallocation();
     tracker.set(p, ins);
 
 #ifdef DEBUG
     char name[64];
     JS_ASSERT(strlen(prefix) < 11);
@@ -9660,17 +9660,18 @@ TraceRecorder::stobj_get_const_private_p
                         offsetof(JSObject, fslots) + JSSLOT_PRIVATE * sizeof(Value) + sPayloadOffset,
                         ACCSET_OTHER, LOAD_CONST);
 }
 
 LIns*
 TraceRecorder::stobj_get_fslot_ptr(LIns *obj_ins, unsigned slot)
 {
     JS_ASSERT(slot < JS_INITIAL_NSLOTS);
-    return lir->insLoad(LIR_ldi, obj_ins, offsetof(JSObject, fslots) + slot * sizeof(Value),
+    return lir->insLoad(LIR_ldi, obj_ins,
+                        offsetof(JSObject, fslots) + slot * sizeof(Value) + sPayloadOffset,
                         ACCSET_OTHER);
 }
 
 void
 TraceRecorder::box_undefined_into(LIns *vaddr_ins, ptrdiff_t offset, AccSet accSet)
 {
     lir->insStore(INS_CONSTU(JSVAL_TAG_UNDEFINED), vaddr_ins, offset + sTagOffset, accSet);
     lir->insStore(INS_CONST(0), vaddr_ins, offset + sPayloadOffset, accSet);
@@ -9739,17 +9740,17 @@ TraceRecorder::unbox_value(const Value &
 
     if (v.isInt32()) {
         guard(true, lir->ins2(LIR_eqi, tag_ins, INS_CONSTU(JSVAL_TAG_INT32)), exit);
         return i2d(lir->insLoad(LIR_ldi, vaddr_ins, offset + sPayloadOffset, accSet));
     }
 
     if (v.isDouble()) {
         guard(true, lir->ins2(LIR_ltui, tag_ins, INS_CONSTU(JSVAL_TAG_CLEAR)), exit);
-        return lir->insLoad(LIR_ldd, vaddr_ins, offset + sPayloadOffset, accSet);
+        return lir->insLoad(LIR_ldd, vaddr_ins, offset, accSet);
     }
 
     if (v.isObject()) {
         JSValueType type = v.toObject().isFunction() ? JSVAL_TYPE_FUNOBJ : JSVAL_TYPE_NONFUNOBJ;
         return unbox_object(vaddr_ins, offset, tag_ins, type, exit, accSet);
     }
 
     JSValueType type = v.extractNonDoubleObjectTraceType();