Backed out changeset 97163e4941f2 (bug 869507) for checktest assertions and crashes.

CLOSED TREE
This commit is contained in:
Ryan VanderMeulen 2013-05-08 14:59:12 -04:00
parent cb92e38e0c
commit f83acac229
3 changed files with 8 additions and 17 deletions

View File

@ -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<Condition>(cond & ~DoubleConditionBits);
}

View File

@ -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);

View File

@ -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)