Fix the bug in CompareIC_GenerateNumber for X87 platform.
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}
This commit is contained in:
parent
cdeaf08a0d
commit
845154a896
@ -3258,7 +3258,7 @@ void CompareICStub::GenerateSmis(MacroAssembler* masm) {
|
|||||||
void CompareICStub::GenerateNumbers(MacroAssembler* masm) {
|
void CompareICStub::GenerateNumbers(MacroAssembler* masm) {
|
||||||
DCHECK(state() == CompareICState::NUMBER);
|
DCHECK(state() == CompareICState::NUMBER);
|
||||||
|
|
||||||
Label generic_stub;
|
Label generic_stub, check_left;
|
||||||
Label unordered, maybe_undefined1, maybe_undefined2;
|
Label unordered, maybe_undefined1, maybe_undefined2;
|
||||||
Label miss;
|
Label miss;
|
||||||
|
|
||||||
@ -3271,13 +3271,13 @@ void CompareICStub::GenerateNumbers(MacroAssembler* masm) {
|
|||||||
|
|
||||||
// Inlining the double comparison and falling back to the general compare
|
// Inlining the double comparison and falling back to the general compare
|
||||||
// stub if NaN is involved or SSE2 or CMOV is unsupported.
|
// stub if NaN is involved or SSE2 or CMOV is unsupported.
|
||||||
__ mov(ecx, edx);
|
__ JumpIfSmi(eax, &check_left, Label::kNear);
|
||||||
__ and_(ecx, eax);
|
|
||||||
__ JumpIfSmi(ecx, &generic_stub, Label::kNear);
|
|
||||||
|
|
||||||
__ cmp(FieldOperand(eax, HeapObject::kMapOffset),
|
__ cmp(FieldOperand(eax, HeapObject::kMapOffset),
|
||||||
isolate()->factory()->heap_number_map());
|
isolate()->factory()->heap_number_map());
|
||||||
__ j(not_equal, &maybe_undefined1, Label::kNear);
|
__ j(not_equal, &maybe_undefined1, Label::kNear);
|
||||||
|
|
||||||
|
__ bind(&check_left);
|
||||||
|
__ JumpIfSmi(edx, &generic_stub, Label::kNear);
|
||||||
__ cmp(FieldOperand(edx, HeapObject::kMapOffset),
|
__ cmp(FieldOperand(edx, HeapObject::kMapOffset),
|
||||||
isolate()->factory()->heap_number_map());
|
isolate()->factory()->heap_number_map());
|
||||||
__ j(not_equal, &maybe_undefined2, Label::kNear);
|
__ j(not_equal, &maybe_undefined2, Label::kNear);
|
||||||
|
Loading…
Reference in New Issue
Block a user