From 740fff1c0f85bd4180af9e88805d66988318f83a Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Fri, 20 Feb 2015 18:42:11 +0100 Subject: [PATCH] Bug 1134638: 9. Drive-by cleanup: FloatingTypePolicy can just have SPECIALIZATION_DATA; r=nbp --HG-- extra : rebase_source : 9d181f69a8bc8a1122232b57a2292053a6b1bb30 --- js/src/jit/MIR.cpp | 10 +++++----- js/src/jit/MIR.h | 10 +++++----- js/src/jit/TypePolicy.h | 18 +----------------- 3 files changed, 11 insertions(+), 27 deletions(-) diff --git a/js/src/jit/MIR.cpp b/js/src/jit/MIR.cpp index 06f83d90137f..2a542a8af3e1 100644 --- a/js/src/jit/MIR.cpp +++ b/js/src/jit/MIR.cpp @@ -1359,7 +1359,7 @@ MFloor::trySpecializeFloat32(TempAllocator &alloc) { MOZ_ASSERT(type() == MIRType_Int32); if (EnsureFloatInputOrConvert(this, alloc)) - setPolicyType(MIRType_Float32); + specialization_ = MIRType_Float32; } void @@ -1367,7 +1367,7 @@ MCeil::trySpecializeFloat32(TempAllocator &alloc) { MOZ_ASSERT(type() == MIRType_Int32); if (EnsureFloatInputOrConvert(this, alloc)) - setPolicyType(MIRType_Float32); + specialization_ = MIRType_Float32; } void @@ -1375,7 +1375,7 @@ MRound::trySpecializeFloat32(TempAllocator &alloc) { MOZ_ASSERT(type() == MIRType_Int32); if (EnsureFloatInputOrConvert(this, alloc)) - setPolicyType(MIRType_Float32); + specialization_ = MIRType_Float32; } MCompare * @@ -2308,7 +2308,7 @@ MMathFunction::trySpecializeFloat32(TempAllocator &alloc) } setResultType(MIRType_Float32); - setPolicyType(MIRType_Float32); + specialization_ = MIRType_Float32; } MHypot *MHypot::New(TempAllocator &alloc, const MDefinitionVector & vector) @@ -4330,7 +4330,7 @@ MSqrt::trySpecializeFloat32(TempAllocator &alloc) { } setResultType(MIRType_Float32); - setPolicyType(MIRType_Float32); + specialization_ = MIRType_Float32; } MDefinition * diff --git a/js/src/jit/MIR.h b/js/src/jit/MIR.h index be15db70192f..45adc58fb100 100644 --- a/js/src/jit/MIR.h +++ b/js/src/jit/MIR.h @@ -5533,7 +5533,7 @@ class MSqrt : MUnaryInstruction(num) { setResultType(type); - setPolicyType(type); + specialization_ = type; setMovable(); } @@ -5814,7 +5814,7 @@ class MMathFunction : MUnaryInstruction(input), function_(function), cache_(cache) { setResultType(MIRType_Double); - setPolicyType(MIRType_Double); + specialization_ = MIRType_Double; setMovable(); } @@ -10942,7 +10942,7 @@ class MFloor : MUnaryInstruction(num) { setResultType(MIRType_Int32); - setPolicyType(MIRType_Double); + specialization_ = MIRType_Double; setMovable(); } @@ -10986,7 +10986,7 @@ class MCeil : MUnaryInstruction(num) { setResultType(MIRType_Int32); - setPolicyType(MIRType_Double); + specialization_ = MIRType_Double; setMovable(); } @@ -11030,7 +11030,7 @@ class MRound : MUnaryInstruction(num) { setResultType(MIRType_Int32); - setPolicyType(MIRType_Double); + specialization_ = MIRType_Double; setMovable(); } diff --git a/js/src/jit/TypePolicy.h b/js/src/jit/TypePolicy.h index a720638aa205..6f10ff238397 100644 --- a/js/src/jit/TypePolicy.h +++ b/js/src/jit/TypePolicy.h @@ -221,24 +221,8 @@ class Float32Policy MOZ_FINAL : public TypePolicy template class FloatingPointPolicy MOZ_FINAL : public TypePolicy { - public: - struct PolicyTypeData - { - MIRType policyType_; - - void setPolicyType(MIRType type) { - policyType_ = type; - } - - protected: - MIRType &thisTypeSpecialization() { - return policyType_; - } - }; - - INHERIT_DATA_(PolicyTypeData); - + SPECIALIZATION_DATA_; virtual bool adjustInputs(TempAllocator &alloc, MInstruction *def) MOZ_OVERRIDE; };