Reviewers: Jakob,

Description:
Fix implementation of compare-minus-zero-and-branch on ia32 and x64.

[email protected]
BUG=

Please review this at https://codereview.chromium.org/63573004/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+3, -3 lines):
  M src/ia32/lithium-codegen-ia32.cc
  M src/x64/lithium-codegen-x64.cc


Index: src/ia32/lithium-codegen-ia32.cc
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index 14a40baa19e08fee26c268c1018438266da70474..bc46113cc82037bab44f3579d41fff24ecfc6544 100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -2689,7 +2689,7 @@ void LCodeGen::DoCompareMinusZeroAndBranch(LCompareMinusZeroAndBranch* instr) {
   } else {
     Register value = ToRegister(instr->value());
     Handle<Map> map = masm()->isolate()->factory()->heap_number_map();
-    __ CheckMap(eax, map, &if_false, DO_SMI_CHECK);
+    __ CheckMap(value, map, &if_false, DO_SMI_CHECK);
     __ cmp(FieldOperand(value, HeapNumber::kExponentOffset),
            Immediate(0x80000000));
     __ j(not_equal, &if_false);
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index 5e2367f986567bcc8ea4c580d2e14f7fc720bf9e..4f79aaa7377e8ab731a2e9a3c60b9b667be45b3e 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -2250,7 +2250,7 @@ void LCodeGen::DoCompareMinusZeroAndBranch(LCompareMinusZeroAndBranch* instr) {
   Representation rep = instr->hydrogen()->value()->representation();
   ASSERT(!rep.IsInteger32());
   Label if_false;
-
+  __ int3();
   if (rep.IsDouble()) {
     XMMRegister value = ToDoubleRegister(instr->value());
     XMMRegister xmm_scratch = double_scratch0();
@@ -2263,7 +2263,7 @@ void LCodeGen::DoCompareMinusZeroAndBranch(LCompareMinusZeroAndBranch* instr) {
   } else {
     Register value = ToRegister(instr->value());
     Handle<Map> map = masm()->isolate()->factory()->heap_number_map();
-    __ CheckMap(rax, map, &if_false, DO_SMI_CHECK);
+    __ CheckMap(value, map, &if_false, DO_SMI_CHECK);
     __ cmpl(FieldOperand(value, HeapNumber::kExponentOffset),
             Immediate(0x80000000));
     __ j(not_equal, &if_false);


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to