Commit 876c3e06 authored by lrn@chromium.org's avatar lrn@chromium.org

Synchronizing Comparison codegen between X64 and ia32.

Review URL: http://codereview.chromium.org/2010007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4612 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 347b578c
......@@ -2497,7 +2497,9 @@ void CodeGenerator::Comparison(AstNode* node,
// by reconstituting them on the non-fall-through path.
if (left_side.is_smi()) {
if (FLAG_debug_code) __ AbortIfNotSmi(left_side.reg());
if (FLAG_debug_code) {
__ AbortIfNotSmi(left_side.reg());
}
} else {
JumpTarget is_smi;
__ test(left_side.reg(), Immediate(kSmiTagMask));
......@@ -2526,7 +2528,7 @@ void CodeGenerator::Comparison(AstNode* node,
__ cvtsi2sd(xmm0, Operand(temp.reg()));
temp.Unuse();
}
__ comisd(xmm1, xmm0);
__ ucomisd(xmm1, xmm0);
// Jump to builtin for NaN.
not_number.Branch(parity_even, &left_side);
left_side.Unuse();
......@@ -2817,11 +2819,7 @@ void CodeGenerator::Comparison(AstNode* node,
// number comparison in the stub if it was inlined.
CompareStub stub(cc, strict, nan_info, !inline_number_compare);
Result answer = frame_->CallStub(&stub, &left_side, &right_side);
if (cc == equal) {
__ test(answer.reg(), Operand(answer.reg()));
} else {
__ cmp(answer.reg(), 0);
}
answer.Unuse();
dest->true_target()->Branch(cc);
dest->false_target()->Jump();
......
......@@ -5739,6 +5739,11 @@ void CodeGenerator::Comparison(AstNode* node,
// by reconstituting them on the non-fall-through path.
JumpTarget is_smi;
if (left_side.is_smi()) {
if (FLAG_debug_code) {
__ AbortIfNotSmi(left_side.reg(), "Non-smi value inferred as smi.");
}
} else {
Condition left_is_smi = masm_->CheckSmi(left_side.reg());
is_smi.Branch(left_is_smi);
......@@ -5781,6 +5786,8 @@ void CodeGenerator::Comparison(AstNode* node,
dest->false_target()->Jump();
is_smi.Bind();
}
left_side = Result(left_reg);
right_side = Result(right_val);
// Test smi equality and comparison by signed int comparison.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment