Bug 852140: IonMonkey: Backout bug 844452 and add testcase, r=nbp

This commit is contained in:
Hannes Verschore 2013-03-19 23:49:49 +01:00
parent 2c73a3ccb2
commit b7b4a74a9e
2 changed files with 17 additions and 9 deletions

View File

@ -160,13 +160,17 @@ ComparePolicy::adjustInputs(MInstruction *def)
return true;
}
if (compare->compareType() == MCompare::Compare_Undefined ||
compare->compareType() == MCompare::Compare_Null)
{
// Nothing to do for undefined and null, lowering handles all types.
return true;
}
// Convert all inputs to the right input type
MIRType type = compare->inputType();
// Nothing to do for undefined and null, lowering handles all types.
if (type == MIRType_Undefined || type == MIRType_Null)
return true;
JS_ASSERT(type == MIRType_Int32 || type == MIRType_Double ||
type == MIRType_Object || type == MIRType_String);
for (size_t i = 0; i < 2; i++) {
MDefinition *in = def->getOperand(i);
if (in->type() == type)
@ -175,11 +179,8 @@ ComparePolicy::adjustInputs(MInstruction *def)
MInstruction *replace;
// See BinaryArithPolicy::adjustInputs for an explanation of the following
if (in->type() == MIRType_Object || in->type() == MIRType_String ||
(in->type() == MIRType_Boolean && type != MIRType_Double && type != MIRType_Int32))
{
if (in->type() == MIRType_Object || in->type() == MIRType_String)
in = boxAt(def, in);
}
switch (type) {
case MIRType_Double:

View File

@ -0,0 +1,7 @@
function reportCompare (expected, actual) {
if (expected != actual) {}
}
function exitFunc (funcName)
reportCompare(undefined, '');
reportCompare('', '');
exitFunc();