bug 888493 - add MOZ_CONSTEXPR_VAR r=waldo
authorTrevor Saunders <trev.saunders@gmail.com>
Fri, 28 Jun 2013 17:34:51 -0400
changeset 150754 040df3280d8c514bffc13c894ee86c74e0fb4bc5
parent 150753 fbeb1c23c115fa38f89c14e1159c24acf0665f20
child 150755 1c6223f7c74f2b161b430815386e77fe90621565
push id382
push userakeybl@mozilla.com
push dateMon, 21 Oct 2013 21:47:13 +0000
treeherdermozilla-release@5f1868ee45cb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswaldo
bugs888493
milestone25.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 888493 - add MOZ_CONSTEXPR_VAR r=waldo
js/src/ion/arm/Assembler-arm.h
js/src/ion/x64/Assembler-x64.h
js/src/ion/x86/Assembler-x86.h
mfbt/Attributes.h
--- a/js/src/ion/arm/Assembler-arm.h
+++ b/js/src/ion/arm/Assembler-arm.h
@@ -22,54 +22,54 @@ namespace js {
 namespace ion {
 
 //NOTE: there are duplicates in this list!
 // sometimes we want to specifically refer to the
 // link register as a link register (bl lr is much
 // clearer than bl r14).  HOWEVER, this register can
 // easily be a gpr when it is not busy holding the return
 // address.
-static const MOZ_CONSTEXPR Register r0  = { Registers::r0 };
-static const MOZ_CONSTEXPR Register r1  = { Registers::r1 };
-static const MOZ_CONSTEXPR Register r2  = { Registers::r2 };
-static const MOZ_CONSTEXPR Register r3  = { Registers::r3 };
-static const MOZ_CONSTEXPR Register r4  = { Registers::r4 };
-static const MOZ_CONSTEXPR Register r5  = { Registers::r5 };
-static const MOZ_CONSTEXPR Register r6  = { Registers::r6 };
-static const MOZ_CONSTEXPR Register r7  = { Registers::r7 };
-static const MOZ_CONSTEXPR Register r8  = { Registers::r8 };
-static const MOZ_CONSTEXPR Register r9  = { Registers::r9 };
-static const MOZ_CONSTEXPR Register r10 = { Registers::r10 };
-static const MOZ_CONSTEXPR Register r11 = { Registers::r11 };
-static const MOZ_CONSTEXPR Register r12 = { Registers::ip };
-static const MOZ_CONSTEXPR Register ip  = { Registers::ip };
-static const MOZ_CONSTEXPR Register sp  = { Registers::sp };
-static const MOZ_CONSTEXPR Register r14 = { Registers::lr };
-static const MOZ_CONSTEXPR Register lr  = { Registers::lr };
-static const MOZ_CONSTEXPR Register pc  = { Registers::pc };
+static MOZ_CONSTEXPR_VAR Register r0  = { Registers::r0 };
+static MOZ_CONSTEXPR_VAR Register r1  = { Registers::r1 };
+static MOZ_CONSTEXPR_VAR Register r2  = { Registers::r2 };
+static MOZ_CONSTEXPR_VAR Register r3  = { Registers::r3 };
+static MOZ_CONSTEXPR_VAR Register r4  = { Registers::r4 };
+static MOZ_CONSTEXPR_VAR Register r5  = { Registers::r5 };
+static MOZ_CONSTEXPR_VAR Register r6  = { Registers::r6 };
+static MOZ_CONSTEXPR_VAR Register r7  = { Registers::r7 };
+static MOZ_CONSTEXPR_VAR Register r8  = { Registers::r8 };
+static MOZ_CONSTEXPR_VAR Register r9  = { Registers::r9 };
+static MOZ_CONSTEXPR_VAR Register r10 = { Registers::r10 };
+static MOZ_CONSTEXPR_VAR Register r11 = { Registers::r11 };
+static MOZ_CONSTEXPR_VAR Register r12 = { Registers::ip };
+static MOZ_CONSTEXPR_VAR Register ip  = { Registers::ip };
+static MOZ_CONSTEXPR_VAR Register sp  = { Registers::sp };
+static MOZ_CONSTEXPR_VAR Register r14 = { Registers::lr };
+static MOZ_CONSTEXPR_VAR Register lr  = { Registers::lr };
+static MOZ_CONSTEXPR_VAR Register pc  = { Registers::pc };
 
-static const MOZ_CONSTEXPR Register ScratchRegister = {Registers::ip};
+static MOZ_CONSTEXPR_VAR Register ScratchRegister = {Registers::ip};
 
-static const MOZ_CONSTEXPR Register OsrFrameReg = r3;
-static const MOZ_CONSTEXPR Register ArgumentsRectifierReg = r8;
-static const MOZ_CONSTEXPR Register CallTempReg0 = r5;
-static const MOZ_CONSTEXPR Register CallTempReg1 = r6;
-static const MOZ_CONSTEXPR Register CallTempReg2 = r7;
-static const MOZ_CONSTEXPR Register CallTempReg3 = r8;
-static const MOZ_CONSTEXPR Register CallTempReg4 = r0;
-static const MOZ_CONSTEXPR Register CallTempReg5 = r1;
-static const MOZ_CONSTEXPR Register CallTempReg6 = r2;
+static MOZ_CONSTEXPR_VAR Register OsrFrameReg = r3;
+static MOZ_CONSTEXPR_VAR Register ArgumentsRectifierReg = r8;
+static MOZ_CONSTEXPR_VAR Register CallTempReg0 = r5;
+static MOZ_CONSTEXPR_VAR Register CallTempReg1 = r6;
+static MOZ_CONSTEXPR_VAR Register CallTempReg2 = r7;
+static MOZ_CONSTEXPR_VAR Register CallTempReg3 = r8;
+static MOZ_CONSTEXPR_VAR Register CallTempReg4 = r0;
+static MOZ_CONSTEXPR_VAR Register CallTempReg5 = r1;
+static MOZ_CONSTEXPR_VAR Register CallTempReg6 = r2;
 
-static const MOZ_CONSTEXPR Register IntArgReg0 = r0;
-static const MOZ_CONSTEXPR Register IntArgReg1 = r1;
-static const MOZ_CONSTEXPR Register IntArgReg2 = r2;
-static const MOZ_CONSTEXPR Register IntArgReg3 = r3;
-static const MOZ_CONSTEXPR Register GlobalReg = r10;
-static const MOZ_CONSTEXPR Register HeapReg = r11;
-static const MOZ_CONSTEXPR Register CallTempNonArgRegs[] = { r5, r6, r7, r8 };
+static MOZ_CONSTEXPR_VAR Register IntArgReg0 = r0;
+static MOZ_CONSTEXPR_VAR Register IntArgReg1 = r1;
+static MOZ_CONSTEXPR_VAR Register IntArgReg2 = r2;
+static MOZ_CONSTEXPR_VAR Register IntArgReg3 = r3;
+static MOZ_CONSTEXPR_VAR Register GlobalReg = r10;
+static MOZ_CONSTEXPR_VAR Register HeapReg = r11;
+static MOZ_CONSTEXPR_VAR Register CallTempNonArgRegs[] = { r5, r6, r7, r8 };
 static const uint32_t NumCallTempNonArgRegs =
     mozilla::ArrayLength(CallTempNonArgRegs);
 class ABIArgGenerator
 {
 #if defined(JS_CPU_ARM_HARDFP)
     unsigned intRegIndex_;
     unsigned floatRegIndex_;
 #else
@@ -83,47 +83,47 @@ class ABIArgGenerator
     ABIArg next(MIRType argType);
     ABIArg &current() { return current_; }
     uint32_t stackBytesConsumedSoFar() const { return stackOffset_; }
     static const Register NonArgReturnVolatileReg0;
     static const Register NonArgReturnVolatileReg1;
 
 };
 
-static const MOZ_CONSTEXPR Register PreBarrierReg = r1;
+static MOZ_CONSTEXPR_VAR Register PreBarrierReg = r1;
 
-static const MOZ_CONSTEXPR Register InvalidReg = { Registers::invalid_reg };
-static const MOZ_CONSTEXPR FloatRegister InvalidFloatReg = { FloatRegisters::invalid_freg };
+static MOZ_CONSTEXPR_VAR Register InvalidReg = { Registers::invalid_reg };
+static MOZ_CONSTEXPR_VAR FloatRegister InvalidFloatReg = { FloatRegisters::invalid_freg };
 
-static const MOZ_CONSTEXPR Register JSReturnReg_Type = r3;
-static const MOZ_CONSTEXPR Register JSReturnReg_Data = r2;
-static const MOZ_CONSTEXPR Register StackPointer = sp;
-static const MOZ_CONSTEXPR Register FramePointer = InvalidReg;
-static const MOZ_CONSTEXPR Register ReturnReg = r0;
-static const MOZ_CONSTEXPR FloatRegister ReturnFloatReg = { FloatRegisters::d0 };
-static const MOZ_CONSTEXPR FloatRegister ScratchFloatReg = { FloatRegisters::d1 };
+static MOZ_CONSTEXPR_VAR Register JSReturnReg_Type = r3;
+static MOZ_CONSTEXPR_VAR Register JSReturnReg_Data = r2;
+static MOZ_CONSTEXPR_VAR Register StackPointer = sp;
+static MOZ_CONSTEXPR_VAR Register FramePointer = InvalidReg;
+static MOZ_CONSTEXPR_VAR Register ReturnReg = r0;
+static MOZ_CONSTEXPR_VAR FloatRegister ReturnFloatReg = { FloatRegisters::d0 };
+static MOZ_CONSTEXPR_VAR FloatRegister ScratchFloatReg = { FloatRegisters::d1 };
 
-static const MOZ_CONSTEXPR FloatRegister NANReg = { FloatRegisters::d15 };
+static MOZ_CONSTEXPR_VAR FloatRegister NANReg = { FloatRegisters::d15 };
 
-static const MOZ_CONSTEXPR FloatRegister d0  = {FloatRegisters::d0};
-static const MOZ_CONSTEXPR FloatRegister d1  = {FloatRegisters::d1};
-static const MOZ_CONSTEXPR FloatRegister d2  = {FloatRegisters::d2};
-static const MOZ_CONSTEXPR FloatRegister d3  = {FloatRegisters::d3};
-static const MOZ_CONSTEXPR FloatRegister d4  = {FloatRegisters::d4};
-static const MOZ_CONSTEXPR FloatRegister d5  = {FloatRegisters::d5};
-static const MOZ_CONSTEXPR FloatRegister d6  = {FloatRegisters::d6};
-static const MOZ_CONSTEXPR FloatRegister d7  = {FloatRegisters::d7};
-static const MOZ_CONSTEXPR FloatRegister d8  = {FloatRegisters::d8};
-static const MOZ_CONSTEXPR FloatRegister d9  = {FloatRegisters::d9};
-static const MOZ_CONSTEXPR FloatRegister d10 = {FloatRegisters::d10};
-static const MOZ_CONSTEXPR FloatRegister d11 = {FloatRegisters::d11};
-static const MOZ_CONSTEXPR FloatRegister d12 = {FloatRegisters::d12};
-static const MOZ_CONSTEXPR FloatRegister d13 = {FloatRegisters::d13};
-static const MOZ_CONSTEXPR FloatRegister d14 = {FloatRegisters::d14};
-static const MOZ_CONSTEXPR FloatRegister d15 = {FloatRegisters::d15};
+static MOZ_CONSTEXPR_VAR FloatRegister d0  = {FloatRegisters::d0};
+static MOZ_CONSTEXPR_VAR FloatRegister d1  = {FloatRegisters::d1};
+static MOZ_CONSTEXPR_VAR FloatRegister d2  = {FloatRegisters::d2};
+static MOZ_CONSTEXPR_VAR FloatRegister d3  = {FloatRegisters::d3};
+static MOZ_CONSTEXPR_VAR FloatRegister d4  = {FloatRegisters::d4};
+static MOZ_CONSTEXPR_VAR FloatRegister d5  = {FloatRegisters::d5};
+static MOZ_CONSTEXPR_VAR FloatRegister d6  = {FloatRegisters::d6};
+static MOZ_CONSTEXPR_VAR FloatRegister d7  = {FloatRegisters::d7};
+static MOZ_CONSTEXPR_VAR FloatRegister d8  = {FloatRegisters::d8};
+static MOZ_CONSTEXPR_VAR FloatRegister d9  = {FloatRegisters::d9};
+static MOZ_CONSTEXPR_VAR FloatRegister d10 = {FloatRegisters::d10};
+static MOZ_CONSTEXPR_VAR FloatRegister d11 = {FloatRegisters::d11};
+static MOZ_CONSTEXPR_VAR FloatRegister d12 = {FloatRegisters::d12};
+static MOZ_CONSTEXPR_VAR FloatRegister d13 = {FloatRegisters::d13};
+static MOZ_CONSTEXPR_VAR FloatRegister d14 = {FloatRegisters::d14};
+static MOZ_CONSTEXPR_VAR FloatRegister d15 = {FloatRegisters::d15};
 
 // For maximal awesomeness, 8 should be sufficent.
 // ldrd/strd (dual-register load/store) operate in a single cycle
 // when the address they are dealing with is 8 byte aligned.
 // Also, the ARM abi wants the stack to be 8 byte aligned at
 // function boundaries.  I'm trying to make sure this is always true.
 static const uint32_t StackAlignment = 8;
 static const uint32_t CodeAlignment = 8;
--- a/js/src/ion/x64/Assembler-x64.h
+++ b/js/src/ion/x64/Assembler-x64.h
@@ -10,128 +10,128 @@
 #include "ion/shared/Assembler-shared.h"
 #include "ion/CompactBuffer.h"
 #include "ion/IonCode.h"
 #include "mozilla/Util.h"
 
 namespace js {
 namespace ion {
 
-static const MOZ_CONSTEXPR Register rax = { JSC::X86Registers::eax };
-static const MOZ_CONSTEXPR Register rbx = { JSC::X86Registers::ebx };
-static const MOZ_CONSTEXPR Register rcx = { JSC::X86Registers::ecx };
-static const MOZ_CONSTEXPR Register rdx = { JSC::X86Registers::edx };
-static const MOZ_CONSTEXPR Register rsi = { JSC::X86Registers::esi };
-static const MOZ_CONSTEXPR Register rdi = { JSC::X86Registers::edi };
-static const MOZ_CONSTEXPR Register rbp = { JSC::X86Registers::ebp };
-static const MOZ_CONSTEXPR Register r8  = { JSC::X86Registers::r8  };
-static const MOZ_CONSTEXPR Register r9  = { JSC::X86Registers::r9  };
-static const MOZ_CONSTEXPR Register r10 = { JSC::X86Registers::r10 };
-static const MOZ_CONSTEXPR Register r11 = { JSC::X86Registers::r11 };
-static const MOZ_CONSTEXPR Register r12 = { JSC::X86Registers::r12 };
-static const MOZ_CONSTEXPR Register r13 = { JSC::X86Registers::r13 };
-static const MOZ_CONSTEXPR Register r14 = { JSC::X86Registers::r14 };
-static const MOZ_CONSTEXPR Register r15 = { JSC::X86Registers::r15 };
-static const MOZ_CONSTEXPR Register rsp = { JSC::X86Registers::esp };
+static MOZ_CONSTEXPR_VAR Register rax = { JSC::X86Registers::eax };
+static MOZ_CONSTEXPR_VAR Register rbx = { JSC::X86Registers::ebx };
+static MOZ_CONSTEXPR_VAR Register rcx = { JSC::X86Registers::ecx };
+static MOZ_CONSTEXPR_VAR Register rdx = { JSC::X86Registers::edx };
+static MOZ_CONSTEXPR_VAR Register rsi = { JSC::X86Registers::esi };
+static MOZ_CONSTEXPR_VAR Register rdi = { JSC::X86Registers::edi };
+static MOZ_CONSTEXPR_VAR Register rbp = { JSC::X86Registers::ebp };
+static MOZ_CONSTEXPR_VAR Register r8  = { JSC::X86Registers::r8  };
+static MOZ_CONSTEXPR_VAR Register r9  = { JSC::X86Registers::r9  };
+static MOZ_CONSTEXPR_VAR Register r10 = { JSC::X86Registers::r10 };
+static MOZ_CONSTEXPR_VAR Register r11 = { JSC::X86Registers::r11 };
+static MOZ_CONSTEXPR_VAR Register r12 = { JSC::X86Registers::r12 };
+static MOZ_CONSTEXPR_VAR Register r13 = { JSC::X86Registers::r13 };
+static MOZ_CONSTEXPR_VAR Register r14 = { JSC::X86Registers::r14 };
+static MOZ_CONSTEXPR_VAR Register r15 = { JSC::X86Registers::r15 };
+static MOZ_CONSTEXPR_VAR Register rsp = { JSC::X86Registers::esp };
 
-static const MOZ_CONSTEXPR FloatRegister xmm0 = { JSC::X86Registers::xmm0 };
-static const MOZ_CONSTEXPR FloatRegister xmm1 = { JSC::X86Registers::xmm1 };
-static const MOZ_CONSTEXPR FloatRegister xmm2 = { JSC::X86Registers::xmm2 };
-static const MOZ_CONSTEXPR FloatRegister xmm3 = { JSC::X86Registers::xmm3 };
-static const MOZ_CONSTEXPR FloatRegister xmm4 = { JSC::X86Registers::xmm4 };
-static const MOZ_CONSTEXPR FloatRegister xmm5 = { JSC::X86Registers::xmm5 };
-static const MOZ_CONSTEXPR FloatRegister xmm6 = { JSC::X86Registers::xmm6 };
-static const MOZ_CONSTEXPR FloatRegister xmm7 = { JSC::X86Registers::xmm7 };
-static const MOZ_CONSTEXPR FloatRegister xmm8 = { JSC::X86Registers::xmm8 };
-static const MOZ_CONSTEXPR FloatRegister xmm9 = { JSC::X86Registers::xmm9 };
-static const MOZ_CONSTEXPR FloatRegister xmm10 = { JSC::X86Registers::xmm10 };
-static const MOZ_CONSTEXPR FloatRegister xmm11 = { JSC::X86Registers::xmm11 };
-static const MOZ_CONSTEXPR FloatRegister xmm12 = { JSC::X86Registers::xmm12 };
-static const MOZ_CONSTEXPR FloatRegister xmm13 = { JSC::X86Registers::xmm13 };
-static const MOZ_CONSTEXPR FloatRegister xmm14 = { JSC::X86Registers::xmm14 };
-static const MOZ_CONSTEXPR FloatRegister xmm15 = { JSC::X86Registers::xmm15 };
+static MOZ_CONSTEXPR_VAR FloatRegister xmm0 = { JSC::X86Registers::xmm0 };
+static MOZ_CONSTEXPR_VAR FloatRegister xmm1 = { JSC::X86Registers::xmm1 };
+static MOZ_CONSTEXPR_VAR FloatRegister xmm2 = { JSC::X86Registers::xmm2 };
+static MOZ_CONSTEXPR_VAR FloatRegister xmm3 = { JSC::X86Registers::xmm3 };
+static MOZ_CONSTEXPR_VAR FloatRegister xmm4 = { JSC::X86Registers::xmm4 };
+static MOZ_CONSTEXPR_VAR FloatRegister xmm5 = { JSC::X86Registers::xmm5 };
+static MOZ_CONSTEXPR_VAR FloatRegister xmm6 = { JSC::X86Registers::xmm6 };
+static MOZ_CONSTEXPR_VAR FloatRegister xmm7 = { JSC::X86Registers::xmm7 };
+static MOZ_CONSTEXPR_VAR FloatRegister xmm8 = { JSC::X86Registers::xmm8 };
+static MOZ_CONSTEXPR_VAR FloatRegister xmm9 = { JSC::X86Registers::xmm9 };
+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 const MOZ_CONSTEXPR Register InvalidReg = { JSC::X86Registers::invalid_reg };
-static const MOZ_CONSTEXPR FloatRegister InvalidFloatReg = { JSC::X86Registers::invalid_xmm };
+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 const MOZ_CONSTEXPR Register JSReturnReg = rcx;
+static MOZ_CONSTEXPR_VAR Register JSReturnReg = rcx;
 // Avoid, except for assertions.
-static const MOZ_CONSTEXPR Register JSReturnReg_Type = JSReturnReg;
-static const MOZ_CONSTEXPR Register JSReturnReg_Data = JSReturnReg;
+static MOZ_CONSTEXPR_VAR Register JSReturnReg_Type = JSReturnReg;
+static MOZ_CONSTEXPR_VAR Register JSReturnReg_Data = JSReturnReg;
 
-static const MOZ_CONSTEXPR Register ReturnReg = rax;
-static const MOZ_CONSTEXPR Register ScratchReg = r11;
-static const MOZ_CONSTEXPR Register HeapReg = r15;
-static const MOZ_CONSTEXPR FloatRegister ReturnFloatReg = xmm0;
-static const MOZ_CONSTEXPR FloatRegister ScratchFloatReg = xmm15;
+static MOZ_CONSTEXPR_VAR Register ReturnReg = rax;
+static MOZ_CONSTEXPR_VAR Register ScratchReg = r11;
+static MOZ_CONSTEXPR_VAR Register HeapReg = r15;
+static MOZ_CONSTEXPR_VAR FloatRegister ReturnFloatReg = xmm0;
+static MOZ_CONSTEXPR_VAR FloatRegister ScratchFloatReg = xmm15;
 
-static const MOZ_CONSTEXPR Register ArgumentsRectifierReg = r8;
-static const MOZ_CONSTEXPR Register CallTempReg0 = rax;
-static const MOZ_CONSTEXPR Register CallTempReg1 = rdi;
-static const MOZ_CONSTEXPR Register CallTempReg2 = rbx;
-static const MOZ_CONSTEXPR Register CallTempReg3 = rcx;
-static const MOZ_CONSTEXPR Register CallTempReg4 = rsi;
-static const MOZ_CONSTEXPR Register CallTempReg5 = rdx;
-static const MOZ_CONSTEXPR Register CallTempReg6 = rbp;
+static MOZ_CONSTEXPR_VAR Register ArgumentsRectifierReg = r8;
+static MOZ_CONSTEXPR_VAR Register CallTempReg0 = rax;
+static MOZ_CONSTEXPR_VAR Register CallTempReg1 = rdi;
+static MOZ_CONSTEXPR_VAR Register CallTempReg2 = rbx;
+static MOZ_CONSTEXPR_VAR Register CallTempReg3 = rcx;
+static MOZ_CONSTEXPR_VAR Register CallTempReg4 = rsi;
+static MOZ_CONSTEXPR_VAR Register CallTempReg5 = rdx;
+static MOZ_CONSTEXPR_VAR Register CallTempReg6 = rbp;
 
 // Different argument registers for WIN64
 #if defined(_WIN64)
-static const MOZ_CONSTEXPR Register IntArgReg0 = rcx;
-static const MOZ_CONSTEXPR Register IntArgReg1 = rdx;
-static const MOZ_CONSTEXPR Register IntArgReg2 = r8;
-static const MOZ_CONSTEXPR Register IntArgReg3 = r9;
-static const MOZ_CONSTEXPR uint32_t NumIntArgRegs = 4;
-static const MOZ_CONSTEXPR Register IntArgRegs[NumIntArgRegs] = { rcx, rdx, r8, r9 };
+static MOZ_CONSTEXPR_VAR Register IntArgReg0 = rcx;
+static MOZ_CONSTEXPR_VAR Register IntArgReg1 = rdx;
+static MOZ_CONSTEXPR_VAR Register IntArgReg2 = r8;
+static MOZ_CONSTEXPR_VAR Register IntArgReg3 = r9;
+static MOZ_CONSTEXPR_VAR uint32_t NumIntArgRegs = 4;
+static MOZ_CONSTEXPR_VAR Register IntArgRegs[NumIntArgRegs] = { rcx, rdx, r8, r9 };
 
-static const MOZ_CONSTEXPR Register CallTempNonArgRegs[] = { rax, rdi, rbx, rsi };
+static MOZ_CONSTEXPR_VAR Register CallTempNonArgRegs[] = { rax, rdi, rbx, rsi };
 static const uint32_t NumCallTempNonArgRegs =
     mozilla::ArrayLength(CallTempNonArgRegs);
 
-static const MOZ_CONSTEXPR FloatRegister FloatArgReg0 = xmm0;
-static const MOZ_CONSTEXPR FloatRegister FloatArgReg1 = xmm1;
-static const MOZ_CONSTEXPR FloatRegister FloatArgReg2 = xmm2;
-static const MOZ_CONSTEXPR FloatRegister FloatArgReg3 = xmm3;
+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 };
 #else
-static const MOZ_CONSTEXPR Register IntArgReg0 = rdi;
-static const MOZ_CONSTEXPR Register IntArgReg1 = rsi;
-static const MOZ_CONSTEXPR Register IntArgReg2 = rdx;
-static const MOZ_CONSTEXPR Register IntArgReg3 = rcx;
-static const MOZ_CONSTEXPR Register IntArgReg4 = r8;
-static const MOZ_CONSTEXPR Register IntArgReg5 = r9;
-static const MOZ_CONSTEXPR uint32_t NumIntArgRegs = 6;
-static const MOZ_CONSTEXPR Register IntArgRegs[NumIntArgRegs] = { rdi, rsi, rdx, rcx, r8, r9 };
+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;
+static MOZ_CONSTEXPR_VAR Register IntArgRegs[NumIntArgRegs] = { rdi, rsi, rdx, rcx, r8, r9 };
 
-static const MOZ_CONSTEXPR Register CallTempNonArgRegs[] = { rax, rbx };
+static MOZ_CONSTEXPR_VAR Register CallTempNonArgRegs[] = { rax, rbx };
 static const uint32_t NumCallTempNonArgRegs =
     mozilla::ArrayLength(CallTempNonArgRegs);
 
-static const MOZ_CONSTEXPR FloatRegister FloatArgReg0 = xmm0;
-static const MOZ_CONSTEXPR FloatRegister FloatArgReg1 = xmm1;
-static const MOZ_CONSTEXPR FloatRegister FloatArgReg2 = xmm2;
-static const MOZ_CONSTEXPR FloatRegister FloatArgReg3 = xmm3;
-static const MOZ_CONSTEXPR FloatRegister FloatArgReg4 = xmm4;
-static const MOZ_CONSTEXPR FloatRegister FloatArgReg5 = xmm5;
-static const MOZ_CONSTEXPR FloatRegister FloatArgReg6 = xmm6;
-static const MOZ_CONSTEXPR FloatRegister FloatArgReg7 = xmm7;
-static const MOZ_CONSTEXPR uint32_t NumFloatArgRegs = 8;
-static const MOZ_CONSTEXPR FloatRegister FloatArgRegs[NumFloatArgRegs] = { xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 };
+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 MOZ_CONSTEXPR_VAR FloatRegister FloatArgReg4 = xmm4;
+static MOZ_CONSTEXPR_VAR FloatRegister FloatArgReg5 = xmm5;
+static MOZ_CONSTEXPR_VAR FloatRegister FloatArgReg6 = xmm6;
+static MOZ_CONSTEXPR_VAR FloatRegister FloatArgReg7 = xmm7;
+static MOZ_CONSTEXPR_VAR uint32_t NumFloatArgRegs = 8;
+static MOZ_CONSTEXPR_VAR FloatRegister FloatArgRegs[NumFloatArgRegs] = { xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 };
 #endif
 
 class ABIArgGenerator
 {
 #if defined(XP_WIN)
     unsigned regIndex_;
 #else
     unsigned intRegIndex_;
@@ -147,19 +147,19 @@ class ABIArgGenerator
     uint32_t stackBytesConsumedSoFar() const { return stackOffset_; }
 
     // Note: these registers are all guaranteed to be different
     static const Register NonArgReturnVolatileReg0;
     static const Register NonArgReturnVolatileReg1;
     static const Register NonVolatileReg;
 };
 
-static const MOZ_CONSTEXPR Register OsrFrameReg = IntArgReg3;
+static MOZ_CONSTEXPR_VAR Register OsrFrameReg = IntArgReg3;
 
-static const MOZ_CONSTEXPR Register PreBarrierReg = rdx;
+static MOZ_CONSTEXPR_VAR Register PreBarrierReg = rdx;
 
 // GCC stack is aligned on 16 bytes, but we don't maintain the invariant in
 // jitted code.
 static const uint32_t StackAlignment = 16;
 static const bool StackKeptAligned = false;
 static const uint32_t CodeAlignment = 8;
 static const uint32_t NativeFrameSize = sizeof(void*);
 static const uint32_t AlignmentAtPrologue = sizeof(void*);
@@ -260,17 +260,17 @@ class Operand
 } // namespace js
 
 #include "ion/shared/Assembler-x86-shared.h"
 
 namespace js {
 namespace ion {
 
 // Return operand from a JS -> JS call.
-static const MOZ_CONSTEXPR ValueOperand JSReturnOperand = ValueOperand(JSReturnReg);
+static MOZ_CONSTEXPR_VAR ValueOperand JSReturnOperand = ValueOperand(JSReturnReg);
 
 class Assembler : public AssemblerX86Shared
 {
     // x64 jumps may need extra bits of relocation, because a jump may extend
     // beyond the signed 32-bit range. To account for this we add an extended
     // jump table at the bottom of the instruction stream, and if a jump
     // overflows its range, it will redirect here.
     //
--- a/js/src/ion/x86/Assembler-x86.h
+++ b/js/src/ion/x86/Assembler-x86.h
@@ -11,56 +11,56 @@
 #include "assembler/assembler/X86Assembler.h"
 #include "ion/CompactBuffer.h"
 #include "ion/IonCode.h"
 #include "mozilla/Util.h"
 
 namespace js {
 namespace ion {
 
-static const MOZ_CONSTEXPR Register eax = { JSC::X86Registers::eax };
-static const MOZ_CONSTEXPR Register ecx = { JSC::X86Registers::ecx };
-static const MOZ_CONSTEXPR Register edx = { JSC::X86Registers::edx };
-static const MOZ_CONSTEXPR Register ebx = { JSC::X86Registers::ebx };
-static const MOZ_CONSTEXPR Register esp = { JSC::X86Registers::esp };
-static const MOZ_CONSTEXPR Register ebp = { JSC::X86Registers::ebp };
-static const MOZ_CONSTEXPR Register esi = { JSC::X86Registers::esi };
-static const MOZ_CONSTEXPR Register edi = { JSC::X86Registers::edi };
+static MOZ_CONSTEXPR_VAR Register eax = { JSC::X86Registers::eax };
+static MOZ_CONSTEXPR_VAR Register ecx = { JSC::X86Registers::ecx };
+static MOZ_CONSTEXPR_VAR Register edx = { JSC::X86Registers::edx };
+static MOZ_CONSTEXPR_VAR Register ebx = { JSC::X86Registers::ebx };
+static MOZ_CONSTEXPR_VAR Register esp = { JSC::X86Registers::esp };
+static MOZ_CONSTEXPR_VAR Register ebp = { JSC::X86Registers::ebp };
+static MOZ_CONSTEXPR_VAR Register esi = { JSC::X86Registers::esi };
+static MOZ_CONSTEXPR_VAR Register edi = { JSC::X86Registers::edi };
 
-static const MOZ_CONSTEXPR FloatRegister xmm0 = { JSC::X86Registers::xmm0 };
-static const MOZ_CONSTEXPR FloatRegister xmm1 = { JSC::X86Registers::xmm1 };
-static const MOZ_CONSTEXPR FloatRegister xmm2 = { JSC::X86Registers::xmm2 };
-static const MOZ_CONSTEXPR FloatRegister xmm3 = { JSC::X86Registers::xmm3 };
-static const MOZ_CONSTEXPR FloatRegister xmm4 = { JSC::X86Registers::xmm4 };
-static const MOZ_CONSTEXPR FloatRegister xmm5 = { JSC::X86Registers::xmm5 };
-static const MOZ_CONSTEXPR FloatRegister xmm6 = { JSC::X86Registers::xmm6 };
-static const MOZ_CONSTEXPR FloatRegister xmm7 = { JSC::X86Registers::xmm7 };
+static MOZ_CONSTEXPR_VAR FloatRegister xmm0 = { JSC::X86Registers::xmm0 };
+static MOZ_CONSTEXPR_VAR FloatRegister xmm1 = { JSC::X86Registers::xmm1 };
+static MOZ_CONSTEXPR_VAR FloatRegister xmm2 = { JSC::X86Registers::xmm2 };
+static MOZ_CONSTEXPR_VAR FloatRegister xmm3 = { JSC::X86Registers::xmm3 };
+static MOZ_CONSTEXPR_VAR FloatRegister xmm4 = { JSC::X86Registers::xmm4 };
+static MOZ_CONSTEXPR_VAR FloatRegister xmm5 = { JSC::X86Registers::xmm5 };
+static MOZ_CONSTEXPR_VAR FloatRegister xmm6 = { JSC::X86Registers::xmm6 };
+static MOZ_CONSTEXPR_VAR FloatRegister xmm7 = { JSC::X86Registers::xmm7 };
 
-static const MOZ_CONSTEXPR Register InvalidReg = { JSC::X86Registers::invalid_reg };
-static const MOZ_CONSTEXPR FloatRegister InvalidFloatReg = { JSC::X86Registers::invalid_xmm };
+static MOZ_CONSTEXPR_VAR Register InvalidReg = { JSC::X86Registers::invalid_reg };
+static MOZ_CONSTEXPR_VAR FloatRegister InvalidFloatReg = { JSC::X86Registers::invalid_xmm };
 
-static const MOZ_CONSTEXPR Register JSReturnReg_Type = ecx;
-static const MOZ_CONSTEXPR Register JSReturnReg_Data = edx;
-static const MOZ_CONSTEXPR Register StackPointer = esp;
-static const MOZ_CONSTEXPR Register FramePointer = ebp;
-static const MOZ_CONSTEXPR Register ReturnReg = eax;
-static const MOZ_CONSTEXPR FloatRegister ReturnFloatReg = xmm0;
-static const MOZ_CONSTEXPR FloatRegister ScratchFloatReg = xmm7;
+static MOZ_CONSTEXPR_VAR Register JSReturnReg_Type = ecx;
+static MOZ_CONSTEXPR_VAR Register JSReturnReg_Data = edx;
+static MOZ_CONSTEXPR_VAR Register StackPointer = esp;
+static MOZ_CONSTEXPR_VAR Register FramePointer = ebp;
+static MOZ_CONSTEXPR_VAR Register ReturnReg = eax;
+static MOZ_CONSTEXPR_VAR FloatRegister ReturnFloatReg = xmm0;
+static MOZ_CONSTEXPR_VAR FloatRegister ScratchFloatReg = xmm7;
 
-static const MOZ_CONSTEXPR Register ArgumentsRectifierReg = esi;
-static const MOZ_CONSTEXPR Register CallTempReg0 = edi;
-static const MOZ_CONSTEXPR Register CallTempReg1 = eax;
-static const MOZ_CONSTEXPR Register CallTempReg2 = ebx;
-static const MOZ_CONSTEXPR Register CallTempReg3 = ecx;
-static const MOZ_CONSTEXPR Register CallTempReg4 = esi;
-static const MOZ_CONSTEXPR Register CallTempReg5 = edx;
-static const MOZ_CONSTEXPR Register CallTempReg6 = ebp;
+static MOZ_CONSTEXPR_VAR Register ArgumentsRectifierReg = esi;
+static MOZ_CONSTEXPR_VAR Register CallTempReg0 = edi;
+static MOZ_CONSTEXPR_VAR Register CallTempReg1 = eax;
+static MOZ_CONSTEXPR_VAR Register CallTempReg2 = ebx;
+static MOZ_CONSTEXPR_VAR Register CallTempReg3 = ecx;
+static MOZ_CONSTEXPR_VAR Register CallTempReg4 = esi;
+static MOZ_CONSTEXPR_VAR Register CallTempReg5 = edx;
+static MOZ_CONSTEXPR_VAR Register CallTempReg6 = ebp;
 
 // We have no arg regs, so our NonArgRegs are just our CallTempReg*
-static const MOZ_CONSTEXPR Register CallTempNonArgRegs[] = { edi, eax, ebx, ecx, esi, edx };
+static MOZ_CONSTEXPR_VAR Register CallTempNonArgRegs[] = { edi, eax, ebx, ecx, esi, edx };
 static const uint32_t NumCallTempNonArgRegs =
     mozilla::ArrayLength(CallTempNonArgRegs);
 
 class ABIArgGenerator
 {
     uint32_t stackOffset_;
     ABIArg current_;
 
@@ -71,18 +71,18 @@ class ABIArgGenerator
     uint32_t stackBytesConsumedSoFar() const { return stackOffset_; }
 
     // Note: these registers are all guaranteed to be different
     static const Register NonArgReturnVolatileReg0;
     static const Register NonArgReturnVolatileReg1;
     static const Register NonVolatileReg;
 };
 
-static const MOZ_CONSTEXPR Register OsrFrameReg = edx;
-static const MOZ_CONSTEXPR Register PreBarrierReg = edx;
+static MOZ_CONSTEXPR_VAR Register OsrFrameReg = edx;
+static MOZ_CONSTEXPR_VAR Register PreBarrierReg = edx;
 
 // GCC stack is aligned on 16 bytes, but we don't maintain the invariant in
 // jitted code.
 #if defined(__GNUC__)
 static const uint32_t StackAlignment = 16;
 #else
 static const uint32_t StackAlignment = 4;
 #endif
--- a/mfbt/Attributes.h
+++ b/mfbt/Attributes.h
@@ -112,21 +112,28 @@
 #  define MOZ_HAVE_NEVER_INLINE          __declspec(noinline)
 #  define MOZ_HAVE_NORETURN              __declspec(noreturn)
 #endif
 
 /*
  * The MOZ_CONSTEXPR specifier declares that a C++11 compiler can evaluate a
  * function at compile time. A constexpr function cannot examine any values
  * except its arguments and can have no side effects except its return value.
+ * The MOZ_CONSTEXPR_VAR specifier tells a C++11 compiler that a variable's
+ * value may be computed at compile time.  It should be prefered to just
+ * marking variables as MOZ_CONSTEXPR because if the compiler does not support
+ * constexpr it will fall back to making the variable const, and some compilers
+ * do not accept variables being marked both const and constexpr.
  */
 #ifdef MOZ_HAVE_CXX11_CONSTEXPR
 #  define MOZ_CONSTEXPR         constexpr
+#  define MOZ_CONSTEXPR_VAR     constexpr
 #else
 #  define MOZ_CONSTEXPR         /* no support */
+#  define MOZ_CONSTEXPR_VAR     const
 #endif
 
 /*
  * MOZ_NEVER_INLINE is a macro which expands to tell the compiler that the
  * method decorated with it must never be inlined, even if the compiler would
  * otherwise choose to inline the method.  Compilers aren't absolutely
  * guaranteed to support this, but most do.
  */