Bug 898451 - IonMonkey: Add MOZ_CONSTEXPR_VAR to several variables to help eliminate static constructor calls. r=waldo
authorDan Gohman <sunfish@google.com>
Mon, 29 Jul 2013 16:49:57 -0700
changeset 140486 a7540e8f269ecac8e43ba609b57f6cfcbc2ecb4c
parent 140485 df5c28c3b93ebff600d4a1a10f33a42b24fd4fb3
child 140487 e3ff3875a6f0ef773f367dc6a5ec1c0a2416dd87
push id1970
push userryanvm@gmail.com
push dateTue, 30 Jul 2013 17:12:32 +0000
treeherderfx-team@72240998c094 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswaldo
bugs898451
milestone25.0a1
Bug 898451 - IonMonkey: Add MOZ_CONSTEXPR_VAR to several variables to help eliminate static constructor calls. r=waldo
js/src/ion/arm/BaselineRegisters-arm.h
js/src/ion/x64/Assembler-x64.h
js/src/ion/x64/BaselineRegisters-x64.h
js/src/ion/x86/BaselineRegisters-x86.h
--- a/js/src/ion/arm/BaselineRegisters-arm.h
+++ b/js/src/ion/arm/BaselineRegisters-arm.h
@@ -14,47 +14,47 @@
 namespace js {
 namespace ion {
 
 // r15 = program-counter
 // r14 = link-register
 
 // r13 = stack-pointer
 // r11 = frame-pointer
-static const Register BaselineFrameReg = r11;
-static const Register BaselineStackReg = sp;
+static MOZ_CONSTEXPR_VAR Register BaselineFrameReg = r11;
+static MOZ_CONSTEXPR_VAR Register BaselineStackReg = sp;
 
 // ValueOperands R0, R1, and R2.
 // R0 == JSReturnReg, and R2 uses registers not
 // preserved across calls.  R1 value should be
 // preserved across calls.
-static const ValueOperand R0(r3, r2);
-static const ValueOperand R1(r5, r4);
-static const ValueOperand R2(r1, r0);
+static MOZ_CONSTEXPR_VAR ValueOperand R0(r3, r2);
+static MOZ_CONSTEXPR_VAR ValueOperand R1(r5, r4);
+static MOZ_CONSTEXPR_VAR ValueOperand R2(r1, r0);
 
 // BaselineTailCallReg and BaselineStubReg
 // These use registers that are not preserved across
 // calls.
-static const Register BaselineTailCallReg = r14;
-static const Register BaselineStubReg     = r9;
+static MOZ_CONSTEXPR_VAR Register BaselineTailCallReg = r14;
+static MOZ_CONSTEXPR_VAR Register BaselineStubReg     = r9;
 
-static const Register ExtractTemp0        = InvalidReg;
-static const Register ExtractTemp1        = InvalidReg;
+static MOZ_CONSTEXPR_VAR Register ExtractTemp0        = InvalidReg;
+static MOZ_CONSTEXPR_VAR Register ExtractTemp1        = InvalidReg;
 
 // Register used internally by MacroAssemblerARM.
-static const Register BaselineSecondScratchReg = r6;
+static MOZ_CONSTEXPR_VAR Register BaselineSecondScratchReg = r6;
 
 // R7 - R9 are generally available for use within stubcode.
 
 // Note that BaselineTailCallReg is actually just the link
 // register.  In ARM code emission, we do not clobber BaselineTailCallReg
 // since we keep the return address for calls there.
 
 // FloatReg0 must be equal to ReturnFloatReg. d1 is ScratchFloatReg.
-static const FloatRegister FloatReg0      = d0;
-static const FloatRegister FloatReg1      = d2;
+static MOZ_CONSTEXPR_VAR FloatRegister FloatReg0      = d0;
+static MOZ_CONSTEXPR_VAR FloatRegister FloatReg1      = d2;
 
 } // namespace ion
 } // namespace js
 
 #endif // JS_ION
 
 #endif /* ion_arm_BaselineRegisters_arm_h */
--- a/js/src/ion/x64/Assembler-x64.h
+++ b/js/src/ion/x64/Assembler-x64.h
@@ -46,30 +46,30 @@ static MOZ_CONSTEXPR_VAR FloatRegister x
 static MOZ_CONSTEXPR_VAR FloatRegister xmm10 = { JSC::X86Registers::xmm10 };
 static MOZ_CONSTEXPR_VAR FloatRegister xmm11 = { JSC::X86Registers::xmm11 };
 static MOZ_CONSTEXPR_VAR FloatRegister xmm12 = { JSC::X86Registers::xmm12 };
 static MOZ_CONSTEXPR_VAR FloatRegister xmm13 = { JSC::X86Registers::xmm13 };
 static MOZ_CONSTEXPR_VAR FloatRegister xmm14 = { JSC::X86Registers::xmm14 };
 static MOZ_CONSTEXPR_VAR FloatRegister xmm15 = { JSC::X86Registers::xmm15 };
 
 // X86-common synonyms.
-static const Register eax = rax;
-static const Register ebx = rbx;
-static const Register ecx = rcx;
-static const Register edx = rdx;
-static const Register esi = rsi;
-static const Register edi = rdi;
-static const Register ebp = rbp;
-static const Register esp = rsp;
+static MOZ_CONSTEXPR_VAR Register eax = rax;
+static MOZ_CONSTEXPR_VAR Register ebx = rbx;
+static MOZ_CONSTEXPR_VAR Register ecx = rcx;
+static MOZ_CONSTEXPR_VAR Register edx = rdx;
+static MOZ_CONSTEXPR_VAR Register esi = rsi;
+static MOZ_CONSTEXPR_VAR Register edi = rdi;
+static MOZ_CONSTEXPR_VAR Register ebp = rbp;
+static MOZ_CONSTEXPR_VAR Register esp = rsp;
 
 static MOZ_CONSTEXPR_VAR Register InvalidReg = { JSC::X86Registers::invalid_reg };
 static MOZ_CONSTEXPR_VAR FloatRegister InvalidFloatReg = { JSC::X86Registers::invalid_xmm };
 
-static const Register StackPointer = rsp;
-static const Register FramePointer = rbp;
+static MOZ_CONSTEXPR_VAR Register StackPointer = rsp;
+static MOZ_CONSTEXPR_VAR Register FramePointer = rbp;
 static MOZ_CONSTEXPR_VAR Register JSReturnReg = rcx;
 // Avoid, except for assertions.
 static MOZ_CONSTEXPR_VAR Register JSReturnReg_Type = JSReturnReg;
 static MOZ_CONSTEXPR_VAR Register JSReturnReg_Data = JSReturnReg;
 
 static MOZ_CONSTEXPR_VAR Register ReturnReg = rax;
 static MOZ_CONSTEXPR_VAR Register ScratchReg = r11;
 static MOZ_CONSTEXPR_VAR Register HeapReg = r15;
@@ -98,17 +98,17 @@ static MOZ_CONSTEXPR_VAR Register CallTe
 static const uint32_t NumCallTempNonArgRegs =
     mozilla::ArrayLength(CallTempNonArgRegs);
 
 static MOZ_CONSTEXPR_VAR FloatRegister FloatArgReg0 = xmm0;
 static MOZ_CONSTEXPR_VAR FloatRegister FloatArgReg1 = xmm1;
 static MOZ_CONSTEXPR_VAR FloatRegister FloatArgReg2 = xmm2;
 static MOZ_CONSTEXPR_VAR FloatRegister FloatArgReg3 = xmm3;
 static const uint32_t NumFloatArgRegs = 4;
-static const FloatRegister FloatArgRegs[NumFloatArgRegs] = { xmm0, xmm1, xmm2, xmm3 };
+static MOZ_CONSTEXPR_VAR FloatRegister FloatArgRegs[NumFloatArgRegs] = { xmm0, xmm1, xmm2, xmm3 };
 #else
 static MOZ_CONSTEXPR_VAR Register IntArgReg0 = rdi;
 static MOZ_CONSTEXPR_VAR Register IntArgReg1 = rsi;
 static MOZ_CONSTEXPR_VAR Register IntArgReg2 = rdx;
 static MOZ_CONSTEXPR_VAR Register IntArgReg3 = rcx;
 static MOZ_CONSTEXPR_VAR Register IntArgReg4 = r8;
 static MOZ_CONSTEXPR_VAR Register IntArgReg5 = r9;
 static MOZ_CONSTEXPR_VAR uint32_t NumIntArgRegs = 6;
--- a/js/src/ion/x64/BaselineRegisters-x64.h
+++ b/js/src/ion/x64/BaselineRegisters-x64.h
@@ -9,33 +9,33 @@
 
 #ifdef JS_ION
 
 #include "ion/IonMacroAssembler.h"
 
 namespace js {
 namespace ion {
 
-static const Register BaselineFrameReg    = rbp;
-static const Register BaselineStackReg    = rsp;
+static MOZ_CONSTEXPR_VAR Register BaselineFrameReg    = rbp;
+static MOZ_CONSTEXPR_VAR Register BaselineStackReg    = rsp;
 
-static const ValueOperand R0(rcx);
-static const ValueOperand R1(rbx);
-static const ValueOperand R2(rax);
+static MOZ_CONSTEXPR_VAR ValueOperand R0(rcx);
+static MOZ_CONSTEXPR_VAR ValueOperand R1(rbx);
+static MOZ_CONSTEXPR_VAR ValueOperand R2(rax);
 
 // BaselineTailCallReg and BaselineStubReg reuse
 // registers from R2.
-static const Register BaselineTailCallReg = rsi;
-static const Register BaselineStubReg     = rdi;
+static MOZ_CONSTEXPR_VAR Register BaselineTailCallReg = rsi;
+static MOZ_CONSTEXPR_VAR Register BaselineStubReg     = rdi;
 
-static const Register ExtractTemp0        = r14;
-static const Register ExtractTemp1        = r15;
+static MOZ_CONSTEXPR_VAR Register ExtractTemp0        = r14;
+static MOZ_CONSTEXPR_VAR Register ExtractTemp1        = r15;
 
 // FloatReg0 must be equal to ReturnFloatReg.
-static const FloatRegister FloatReg0      = xmm0;
-static const FloatRegister FloatReg1      = xmm1;
+static MOZ_CONSTEXPR_VAR FloatRegister FloatReg0      = xmm0;
+static MOZ_CONSTEXPR_VAR FloatRegister FloatReg1      = xmm1;
 
 } // namespace ion
 } // namespace js
 
 #endif // JS_ION
 
 #endif /* ion_x64_BaselineRegisters_x64_h */
--- a/js/src/ion/x86/BaselineRegisters-x86.h
+++ b/js/src/ion/x86/BaselineRegisters-x86.h
@@ -9,34 +9,34 @@
 
 #ifdef JS_ION
 
 #include "ion/IonMacroAssembler.h"
 
 namespace js {
 namespace ion {
 
-static const Register BaselineFrameReg = ebp;
-static const Register BaselineStackReg = esp;
+static MOZ_CONSTEXPR_VAR Register BaselineFrameReg = ebp;
+static MOZ_CONSTEXPR_VAR Register BaselineStackReg = esp;
 
 // ValueOperands R0, R1, and R2
-static const ValueOperand R0(ecx, edx);
-static const ValueOperand R1(eax, ebx);
-static const ValueOperand R2(esi, edi);
+static MOZ_CONSTEXPR_VAR ValueOperand R0(ecx, edx);
+static MOZ_CONSTEXPR_VAR ValueOperand R1(eax, ebx);
+static MOZ_CONSTEXPR_VAR ValueOperand R2(esi, edi);
 
 // BaselineTailCallReg and BaselineStubReg reuse
 // registers from R2.
-static const Register BaselineTailCallReg = esi;
-static const Register BaselineStubReg     = edi;
+static MOZ_CONSTEXPR_VAR Register BaselineTailCallReg = esi;
+static MOZ_CONSTEXPR_VAR Register BaselineStubReg     = edi;
 
-static const Register ExtractTemp0        = InvalidReg;
-static const Register ExtractTemp1        = InvalidReg;
+static MOZ_CONSTEXPR_VAR Register ExtractTemp0        = InvalidReg;
+static MOZ_CONSTEXPR_VAR Register ExtractTemp1        = InvalidReg;
 
 // FloatReg0 must be equal to ReturnFloatReg.
-static const FloatRegister FloatReg0      = xmm0;
-static const FloatRegister FloatReg1      = xmm1;
+static MOZ_CONSTEXPR_VAR FloatRegister FloatReg0      = xmm0;
+static MOZ_CONSTEXPR_VAR FloatRegister FloatReg1      = xmm1;
 
 } // namespace ion
 } // namespace js
 
 #endif // JS_ION
 
 #endif /* ion_x86_BaselineRegisters_x86_h */