Index: src/ia32/codegen-ia32.cc |
=================================================================== |
--- src/ia32/codegen-ia32.cc (revision 5123) |
+++ src/ia32/codegen-ia32.cc (working copy) |
@@ -1445,45 +1445,49 @@ |
} |
-void CodeGenerator::JumpIfBothSmiUsingTypeInfo(Register left, |
- Register right, |
- TypeInfo left_info, |
- TypeInfo right_info, |
+void CodeGenerator::JumpIfBothSmiUsingTypeInfo(Result* left, |
+ Result* right, |
JumpTarget* both_smi) { |
+ TypeInfo left_info = left->type_info(); |
+ TypeInfo right_info = right->type_info(); |
if (left_info.IsDouble() || left_info.IsString() || |
right_info.IsDouble() || right_info.IsString()) { |
// We know that left and right are not both smi. Don't do any tests. |
return; |
} |
- if (left.is(right)) { |
+ if (left->reg().is(right->reg())) { |
if (!left_info.IsSmi()) { |
- __ test(left, Immediate(kSmiTagMask)); |
+ __ test(left->reg(), Immediate(kSmiTagMask)); |
both_smi->Branch(zero); |
} else { |
- if (FLAG_debug_code) __ AbortIfNotSmi(left); |
+ if (FLAG_debug_code) __ AbortIfNotSmi(left->reg()); |
+ left->Unuse(); |
+ right->Unuse(); |
both_smi->Jump(); |
} |
} else if (!left_info.IsSmi()) { |
if (!right_info.IsSmi()) { |
Result temp = allocator_->Allocate(); |
ASSERT(temp.is_valid()); |
- __ mov(temp.reg(), left); |
- __ or_(temp.reg(), Operand(right)); |
+ __ mov(temp.reg(), left->reg()); |
+ __ or_(temp.reg(), Operand(right->reg())); |
__ test(temp.reg(), Immediate(kSmiTagMask)); |
temp.Unuse(); |
both_smi->Branch(zero); |
} else { |
- __ test(left, Immediate(kSmiTagMask)); |
+ __ test(left->reg(), Immediate(kSmiTagMask)); |
both_smi->Branch(zero); |
} |
} else { |
- if (FLAG_debug_code) __ AbortIfNotSmi(left); |
+ if (FLAG_debug_code) __ AbortIfNotSmi(left->reg()); |
if (!right_info.IsSmi()) { |
- __ test(right, Immediate(kSmiTagMask)); |
+ __ test(right->reg(), Immediate(kSmiTagMask)); |
both_smi->Branch(zero); |
} else { |
- if (FLAG_debug_code) __ AbortIfNotSmi(right); |
+ if (FLAG_debug_code) __ AbortIfNotSmi(right->reg()); |
+ left->Unuse(); |
+ right->Unuse(); |
both_smi->Jump(); |
} |
} |
@@ -2780,9 +2784,7 @@ |
Register right_reg = right_side.reg(); |
// In-line check for comparing two smis. |
- JumpIfBothSmiUsingTypeInfo(left_side.reg(), right_side.reg(), |
- left_side.type_info(), right_side.type_info(), |
- &is_smi); |
+ JumpIfBothSmiUsingTypeInfo(&left_side, &right_side, &is_smi); |
if (has_valid_frame()) { |
// Inline the equality check if both operands can't be a NaN. If both |