diff --git a/js/src/ion/shared/Assembler-x86-shared.h b/js/src/ion/shared/Assembler-x86-shared.h index 75793ccf971..601e251a2b8 100644 --- a/js/src/ion/shared/Assembler-x86-shared.h +++ b/js/src/ion/shared/Assembler-x86-shared.h @@ -101,39 +101,33 @@ class AssemblerX86Shared }; enum NaNCond { - NaN_HandledByCond, + NaN_Unexpected, NaN_IsTrue, NaN_IsFalse }; - // If the primary condition returned by ConditionFromDoubleCondition doesn't - // handle NaNs properly, return NaN_IsFalse if the comparison should be - // overridden to return false on NaN, NaN_IsTrue if it should be overridden - // to return true on NaN, or NaN_HandledByCond if no secondary check is - // needed. static inline NaNCond NaNCondFromDoubleCondition(DoubleCondition cond) { switch (cond) { case DoubleOrdered: + case DoubleEqual: case DoubleNotEqual: case DoubleGreaterThan: case DoubleGreaterThanOrEqual: case DoubleLessThan: case DoubleLessThanOrEqual: + return NaN_IsFalse; case DoubleUnordered: case DoubleEqualOrUnordered: + case DoubleNotEqualOrUnordered: case DoubleGreaterThanOrUnordered: case DoubleGreaterThanOrEqualOrUnordered: case DoubleLessThanOrUnordered: case DoubleLessThanOrEqualOrUnordered: - return NaN_HandledByCond; - case DoubleEqual: - return NaN_IsFalse; - case DoubleNotEqualOrUnordered: return NaN_IsTrue; } JS_NOT_REACHED("Unknown double condition"); - return NaN_HandledByCond; + return NaN_Unexpected; } static void staticAsserts() { @@ -149,9 +143,6 @@ class AssemblerX86Shared static Condition InvertCondition(Condition cond); - // Return the primary condition to test. Some primary conditions may not - // handle NaNs properly and may therefore require a secondary condition. - // Use NaNCondFromDoubleCondition to determine what else is needed. static inline Condition ConditionFromDoubleCondition(DoubleCondition cond) { return static_cast(cond & ~DoubleConditionBits); } diff --git a/js/src/ion/shared/CodeGenerator-x86-shared.h b/js/src/ion/shared/CodeGenerator-x86-shared.h index 76916f0c5f2..10727bbfb9c 100644 --- a/js/src/ion/shared/CodeGenerator-x86-shared.h +++ b/js/src/ion/shared/CodeGenerator-x86-shared.h @@ -65,7 +65,7 @@ class CodeGeneratorX86Shared : public CodeGeneratorShared // Emits a branch that directs control flow to the true block if |cond| is // true, and the false block if |cond| is false. void emitBranch(Assembler::Condition cond, MBasicBlock *ifTrue, MBasicBlock *ifFalse, - Assembler::NaNCond ifNaN = Assembler::NaN_HandledByCond); + Assembler::NaNCond ifNaN = Assembler::NaN_Unexpected); void emitBranch(Assembler::DoubleCondition cond, MBasicBlock *ifTrue, MBasicBlock *ifFalse); bool emitTableSwitchDispatch(MTableSwitch *mir, const Register &index, const Register &base); diff --git a/js/src/ion/shared/MacroAssembler-x86-shared.h b/js/src/ion/shared/MacroAssembler-x86-shared.h index 438c98c9cbf..88ba8c9f4a4 100644 --- a/js/src/ion/shared/MacroAssembler-x86-shared.h +++ b/js/src/ion/shared/MacroAssembler-x86-shared.h @@ -423,14 +423,14 @@ class MacroAssemblerX86Shared : public Assembler } void emitSet(Assembler::Condition cond, const Register &dest, - Assembler::NaNCond ifNaN = Assembler::NaN_HandledByCond) { + Assembler::NaNCond ifNaN = Assembler::NaN_Unexpected) { if (GeneralRegisterSet(Registers::SingleByteRegs).has(dest)) { // If the register we're defining is a single byte register, // take advantage of the setCC instruction setCC(cond, dest); movzxbl(dest, dest); - if (ifNaN != Assembler::NaN_HandledByCond) { + if (ifNaN != Assembler::NaN_Unexpected) { Label noNaN; j(Assembler::NoParity, &noNaN); if (ifNaN == Assembler::NaN_IsTrue)