Bug 780020 - Unbox int/bool more quickly in GetPropertyCacheT on x64. r=pierron
authorSean Stangl <sstangl@mozilla.com>
Mon, 06 Aug 2012 14:32:01 -0700
changeset 112931 3d2f62ee2982abb8f09fbae473121e2656433c9f
parent 112930 b2361e15b665b003f22de07c2deb3ab68669a4c1
child 112932 f823c4da0b2571aae70d9596834f1f3d69cb996d
push id1708
push userakeybl@mozilla.com
push dateMon, 19 Nov 2012 21:10:21 +0000
treeherdermozilla-beta@27b14fe50103 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspierron
bugs780020
milestone17.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
Bug 780020 - Unbox int/bool more quickly in GetPropertyCacheT on x64. r=pierron
js/src/ion/IonMacroAssembler.h
js/src/ion/arm/MacroAssembler-arm.cpp
js/src/ion/arm/MacroAssembler-arm.h
js/src/ion/x64/MacroAssembler-x64.h
js/src/ion/x86/MacroAssembler-x86.h
--- a/js/src/ion/IonMacroAssembler.h
+++ b/js/src/ion/IonMacroAssembler.h
@@ -143,16 +143,20 @@ class MacroAssembler : public MacroAssem
         movePtr(ImmWord(GetIonContext()->cx->runtime), dest);
         loadPtr(Address(dest, offsetof(JSRuntime, ionActivation)), dest);
     }
 
     template<typename T>
     void loadTypedOrValue(const T &src, TypedOrValueRegister dest) {
         if (dest.hasValue())
             loadValue(src, dest.valueReg());
+        else if (dest.type() == MIRType_Int32)
+            unboxInt32(src, dest.typedReg().gpr());
+        else if (dest.type() == MIRType_Boolean)
+            unboxBoolean(src, dest.typedReg().gpr());
         else
             loadUnboxedValue(src, dest.typedReg());
     }
 
     template<typename T>
     void loadElementTypedOrValue(const T &src, TypedOrValueRegister dest, bool holeCheck,
                                  Label *hole) {
         if (dest.hasValue()) {
--- a/js/src/ion/arm/MacroAssembler-arm.cpp
+++ b/js/src/ion/arm/MacroAssembler-arm.cpp
@@ -2153,16 +2153,22 @@ MacroAssemblerARMCompat::unboxInt32(cons
 
 void
 MacroAssemblerARMCompat::unboxBoolean(const ValueOperand &operand, const Register &dest)
 {
     ma_mov(operand.payloadReg(), dest);
 }
 
 void
+MacroAssemblerARMCompat::unboxBoolean(const Address &src, const Register &dest)
+{
+    ma_ldr(payloadOf(src), dest);
+}
+
+void
 MacroAssemblerARMCompat::unboxDouble(const ValueOperand &operand, const FloatRegister &dest)
 {
     JS_ASSERT(dest != ScratchFloatReg);
     as_vxfer(operand.payloadReg(), operand.typeReg(),
              VFPRegister(dest), CoreToFloat);
 }
 
 void
--- a/js/src/ion/arm/MacroAssembler-arm.h
+++ b/js/src/ion/arm/MacroAssembler-arm.h
@@ -534,16 +534,17 @@ class MacroAssemblerARMCompat : public M
     }
 
     void branchTestValue(Condition cond, const ValueOperand &value, const Value &v, Label *label);
 
     // unboxing code
     void unboxInt32(const ValueOperand &operand, const Register &dest);
     void unboxInt32(const Address &src, const Register &dest);
     void unboxBoolean(const ValueOperand &operand, const Register &dest);
+    void unboxBoolean(const Address &src, const Register &dest);
     void unboxDouble(const ValueOperand &operand, const FloatRegister &dest);
     void unboxValue(const ValueOperand &src, AnyRegister dest);
     void unboxPrivate(const ValueOperand &src, Register dest);
 
     // boxing code
     void boxDouble(const FloatRegister &src, const ValueOperand &dest);
 
     // Extended unboxing API. If the payload is already in a register, returns
--- a/js/src/ion/x64/MacroAssembler-x64.h
+++ b/js/src/ion/x64/MacroAssembler-x64.h
@@ -591,16 +591,19 @@ class MacroAssemblerX64 : public MacroAs
     }
 
     void unboxBoolean(const ValueOperand &src, const Register &dest) {
         movl(Operand(src.valueReg()), dest);
     }
     void unboxBoolean(const Operand &src, const Register &dest) {
         movl(src, dest);
     }
+    void unboxBoolean(const Address &src, const Register &dest) {
+        unboxBoolean(Operand(src), dest);
+    }
 
     void unboxDouble(const ValueOperand &src, const FloatRegister &dest) {
         movqsd(src.valueReg(), dest);
     }
     void unboxDouble(const Operand &src, const FloatRegister &dest) {
         lea(src, ScratchReg);
         movqsd(ScratchReg, dest);
     }
--- a/js/src/ion/x86/MacroAssembler-x86.h
+++ b/js/src/ion/x86/MacroAssembler-x86.h
@@ -528,16 +528,19 @@ class MacroAssemblerX86 : public MacroAs
         movl(src.payloadReg(), dest);
     }
     void unboxInt32(const Address &src, const Register &dest) {
         movl(payloadOf(src), dest);
     }
     void unboxBoolean(const ValueOperand &src, const Register &dest) {
         movl(src.payloadReg(), dest);
     }
+    void unboxBoolean(const Address &src, const Register &dest) {
+        movl(payloadOf(src), dest);
+    }
     void unboxDouble(const ValueOperand &src, const FloatRegister &dest) {
         JS_ASSERT(dest != ScratchFloatReg);
         if (Assembler::HasSSE41()) {
             movd(src.payloadReg(), dest);
             pinsrd(src.typeReg(), dest);
         } else {
             movd(src.payloadReg(), dest);
             movd(src.typeReg(), ScratchFloatReg);