Adding in some new push functions for callvm (Bug 726210, r=cdleary)
authorMarty Rosenberg <mrosenberg@mozilla.com>
Wed, 15 Feb 2012 11:26:33 -0800
changeset 112698 ef7d9616a99b5f4400da76873b8c4c775c9c8929
parent 112697 132462b85b08292526d3c3d87ecffe552ac81727
child 112699 00805dcfb6a0f2db54a08e2bcf5c7e1e4e87c958
push id239
push userakeybl@mozilla.com
push dateThu, 03 Jan 2013 21:54:43 +0000
treeherdermozilla-release@3a7b66445659 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscdleary
bugs726210
milestone13.0a1
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
Adding in some new push functions for callvm (Bug 726210, r=cdleary)
js/src/ion/arm/Assembler-arm.h
js/src/ion/arm/MacroAssembler-arm.cpp
js/src/ion/arm/MacroAssembler-arm.h
--- a/js/src/ion/arm/Assembler-arm.h
+++ b/js/src/ion/arm/Assembler-arm.h
@@ -193,17 +193,17 @@ class VFPRegister
     }
     bool isDouble() { return kind == Double; }
     bool isSingle() { return kind == Single; }
     bool isFloat() { return (kind == Double) || (kind == Single); }
     bool isInt() { return (kind == UInt) || (kind == Int); }
     bool isSInt()   { return kind == Int; }
     bool isUInt()   { return kind == UInt; }
     bool equiv(VFPRegister other) { return other.kind == kind; }
-
+    size_t size() { return (kind == Double) ? 8 : 4; }
     bool isInvalid();
     bool isMissing();
 
     VFPRegister doubleOverlay();
     VFPRegister singleOverlay();
     VFPRegister sintOverlay();
     VFPRegister uintOverlay();
 
@@ -1554,16 +1554,17 @@ class Assembler
     {
         JS_ASSERT(!dtmActive);
         dtmActive = true;
         dtmUpdate = update;
         dtmLoadStore = ls;
         dtmBase = rm;
         dtmCond = c;
         dtmLastReg = -1;
+        dtmMode = mode;
     }
     void transferFloatReg(VFPRegister rn)
     {
         if (dtmLastReg == -1) {
             vdtmFirstReg = rn;
         } else {
             JS_ASSERT(dtmLastReg >= 0);
             JS_ASSERT(rn.code() == unsigned(dtmLastReg) + 1);
--- a/js/src/ion/arm/MacroAssembler-arm.cpp
+++ b/js/src/ion/arm/MacroAssembler-arm.cpp
@@ -861,16 +861,31 @@ MacroAssemblerARM::ma_pop(Register r)
         m_buffer.markGuard();
 }
 void
 MacroAssemblerARM::ma_push(Register r)
 {
     ma_dtr(IsStore, sp,Imm32(-4), r, PreIndex);
 }
 
+void
+MacroAssemblerARM::ma_vpop(VFPRegister r)
+{
+    startFloatTransferM(IsLoad, sp, IA, WriteBack);
+    transferFloatReg(r);
+    finishFloatTransfer();
+}
+void
+MacroAssemblerARM::ma_vpush(VFPRegister r)
+{
+    startFloatTransferM(IsStore, sp, DB, WriteBack);
+    transferFloatReg(r);
+    finishFloatTransfer();
+}
+
 // branches when done from within arm-specific code
 void
 MacroAssemblerARM::ma_b(Label *dest, Assembler::Condition c)
 {
     as_b(dest, c);
 }
 
 void
--- a/js/src/ion/arm/MacroAssembler-arm.h
+++ b/js/src/ion/arm/MacroAssembler-arm.h
@@ -660,20 +660,26 @@ class MacroAssemblerARMCompat : public M
     void loadValue(const BaseIndex &addr, ValueOperand val) {
         // Harder cases not handled yet.
         JS_ASSERT(addr.offset == 0);
         loadValue(addr.base, addr.index, val);
     }
     void pushValue(ValueOperand val);
     void popValue(ValueOperand val);
     void pushValue(const Value &val) {
-        JS_NOT_REACHED("NYI");
+        jsval_layout jv = JSVAL_TO_IMPL(val);
+        push(Imm32(jv.s.tag));
+        if (val.isGCThing())
+            push(ImmGCPtr(reinterpret_cast<gc::Cell *>(val.toGCThing())));
+        else
+            push(Imm32(jv.s.payload.i32));
     }
     void pushValue(JSValueType type, Register reg) {
-        JS_NOT_REACHED("NYI");
+        push(ImmTag(JSVAL_TYPE_TO_TAG(type)));
+        ma_push(reg);
     }
     void storePayload(const Value &val, Operand dest);
     void storePayload(Register src, Operand dest);
     void storePayload(const Value &val, Register base, Register index, int32 shift = defaultShift);
     void storePayload(Register src, Register base, Register index, int32 shift = defaultShift);
     void storeTypeTag(ImmTag tag, Operand dest);
     void storeTypeTag(ImmTag tag, Register base, Register index, int32 shift = defaultShift);
     void makeFrameDescriptor(Register frameSizeReg, FrameType type) {
@@ -704,17 +710,19 @@ class MacroAssemblerARMCompat : public M
         push(imm);
         adjustFrame(STACK_SLOT_SIZE);
     }
     void Push(const ImmGCPtr ptr) {
         push(ptr);
         adjustFrame(STACK_SLOT_SIZE);
     }
     void Push(const FloatRegister &t) {
-        JS_NOT_REACHED("NYI");
+        VFPRegister r = VFPRegister(t);
+        ma_vpush(VFPRegister(t));
+        adjustFrame(r.size());
     }
     void Pop(const Register &reg) {
         ma_pop(reg);
         adjustFrame(-STACK_SLOT_SIZE);
     }
     void implicitPop(uint32 args) {
         JS_ASSERT(args % STACK_SLOT_SIZE == 0);
         adjustFrame(-args);