Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Fix the bug in CompareIC_GenerateNumber for X87 platform.
Browse files Browse the repository at this point in the history
The original code will not update the IC info if one of parameter is SMI. It Can not handle Number + Smi.

BUG=

Review URL: https://codereview.chromium.org/1056663005

Cr-Commit-Position: refs/heads/master@{#27583}
  • Loading branch information
cdai2 authored and Commit bot committed Apr 2, 2015
1 parent cdeaf08 commit 845154a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/x87/code-stubs-x87.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3258,7 +3258,7 @@ void CompareICStub::GenerateSmis(MacroAssembler* masm) {
void CompareICStub::GenerateNumbers(MacroAssembler* masm) {
DCHECK(state() == CompareICState::NUMBER);

Label generic_stub;
Label generic_stub, check_left;
Label unordered, maybe_undefined1, maybe_undefined2;
Label miss;

Expand All @@ -3271,13 +3271,13 @@ void CompareICStub::GenerateNumbers(MacroAssembler* masm) {

// Inlining the double comparison and falling back to the general compare
// stub if NaN is involved or SSE2 or CMOV is unsupported.
__ mov(ecx, edx);
__ and_(ecx, eax);
__ JumpIfSmi(ecx, &generic_stub, Label::kNear);

__ JumpIfSmi(eax, &check_left, Label::kNear);
__ cmp(FieldOperand(eax, HeapObject::kMapOffset),
isolate()->factory()->heap_number_map());
__ j(not_equal, &maybe_undefined1, Label::kNear);

__ bind(&check_left);
__ JumpIfSmi(edx, &generic_stub, Label::kNear);
__ cmp(FieldOperand(edx, HeapObject::kMapOffset),
isolate()->factory()->heap_number_map());
__ j(not_equal, &maybe_undefined2, Label::kNear);
Expand Down

0 comments on commit 845154a

Please sign in to comment.