Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(812)

Unified Diff: src/x87/code-stubs-x87.cc

Issue 1056663005: X87: Fix the bug in CompareIC_GenerateNumber (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x87/code-stubs-x87.cc
diff --git a/src/x87/code-stubs-x87.cc b/src/x87/code-stubs-x87.cc
index 4e39ab86297a8e52f75f198763eacb4e6da7e9d8..e6fc7b83e49a3b98b7fdb37d84e2b97ec37da04c 100644
--- a/src/x87/code-stubs-x87.cc
+++ b/src/x87/code-stubs-x87.cc
@@ -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;
@@ -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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698