From 99e7df7c47b5bc455fab1577838354c0e54f57dd Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 30 Jan 2015 16:05:55 -0800 Subject: [PATCH] Bug 1125202 - SpiderMonkey: Minimize diffs between Architecture-x64.h and Architecture-x86.h r=mjrosenb --- js/src/jit/x64/Architecture-x64.h | 11 ++++------- js/src/jit/x86/Architecture-x86.h | 8 +++----- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/js/src/jit/x64/Architecture-x64.h b/js/src/jit/x64/Architecture-x64.h index df32cae23d40..8087501b3f81 100644 --- a/js/src/jit/x64/Architecture-x64.h +++ b/js/src/jit/x64/Architecture-x64.h @@ -106,11 +106,11 @@ class Registers { (1 << X86Registers::esp) | (1 << X86Registers::r11); // This is ScratchReg. + static const uint32_t AllocatableMask = AllMask & ~NonAllocatableMask; + // Registers that can be allocated without being saved, generally. static const uint32_t TempMask = VolatileMask & ~NonAllocatableMask; - static const uint32_t AllocatableMask = AllMask & ~NonAllocatableMask; - // Registers returned from a JS -> JS call. static const uint32_t JSCallMask = (1 << X86Registers::ecx); @@ -169,10 +169,9 @@ class FloatRegisters { static const uint32_t WrapperMask = VolatileMask; static const uint32_t NonAllocatableMask = - (1 << X86Registers::xmm15); // This is ScratchFloatReg. + (1 << X86Registers::xmm15); // This is ScratchDoubleReg. static const uint32_t AllocatableMask = AllMask & ~NonAllocatableMask; - }; template @@ -221,7 +220,6 @@ struct FloatRegister { uint32_t numAliased() const { return 1; } - // N.B. FloatRegister is an explicit outparam here because msvc-2010 // miscompiled it on win64 when the value was simply returned void aliased(uint32_t aliasIdx, FloatRegister *ret) { @@ -239,7 +237,7 @@ struct FloatRegister { uint32_t size() const { return sizeof(double); } - uint32_t numAlignedAliased() { + uint32_t numAlignedAliased() const { return 1; } void alignedAliased(uint32_t aliasIdx, FloatRegister *ret) { @@ -250,7 +248,6 @@ struct FloatRegister { static uint32_t GetSizeInBytes(const TypedRegisterSet &s); static uint32_t GetPushSizeInBytes(const TypedRegisterSet &s); uint32_t getRegisterDumpOffsetInBytes(); - }; // Arm/D32 has double registers that can NOT be treated as float32 diff --git a/js/src/jit/x86/Architecture-x86.h b/js/src/jit/x86/Architecture-x86.h index 38b749e5db8a..05e3a59fb4dc 100644 --- a/js/src/jit/x86/Architecture-x86.h +++ b/js/src/jit/x86/Architecture-x86.h @@ -146,7 +146,7 @@ class FloatRegisters { static const uint32_t WrapperMask = VolatileMask; static const uint32_t NonAllocatableMask = - (1 << X86Registers::xmm7); + (1 << X86Registers::xmm7); // This is ScratchDoubleReg. static const uint32_t AllocatableMask = AllMask & ~NonAllocatableMask; }; @@ -185,10 +185,10 @@ struct FloatRegister { bool volatile_() const { return !!((1 << code()) & FloatRegisters::VolatileMask); } - bool operator != (FloatRegister other) const { + bool operator !=(FloatRegister other) const { return other.code_ != code_; } - bool operator == (FloatRegister other) const { + bool operator ==(FloatRegister other) const { return other.code_ == code_; } bool aliases(FloatRegister other) const { @@ -225,8 +225,6 @@ struct FloatRegister { static uint32_t GetSizeInBytes(const TypedRegisterSet &s); static uint32_t GetPushSizeInBytes(const TypedRegisterSet &s); uint32_t getRegisterDumpOffsetInBytes(); - - }; // Arm/D32 has double registers that can NOT be treated as float32