Reviewers: danno,

Message:
Hey danno,
The HCompareNumericAndBranch instruction is necessary for the
NumberToStringStub, so we need an X87 fallback here. PTAL
-- Benedikt

Description:
Make HCompareNumericAndBranch safe for snapshots on ia32.

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

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

Affected files (+10, -2 lines):
  M src/ia32/lithium-codegen-ia32.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 7d7b51d116aa834eea4c871ec465f57c1bcc0d34..270bac276a9b9c1c76a6fb0af70e00a3a2b22a7c 100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -2556,10 +2556,18 @@ void LCodeGen::DoCompareNumericAndBranch(LCompareNumericAndBranch* instr) {
     EmitGoto(next_block);
   } else {
     if (instr->is_double()) {
-      CpuFeatureScope scope(masm(), SSE2);
+      if (CpuFeatures::IsSafeForSnapshot(SSE2)) {
+        X87Fxch(ToX87Register(right));
+        X87Fxch(ToX87Register(left), 1);
+        __ fstp(0);
+        __ fstp(2);
+        __ FCmp();
+      } else {
+        CpuFeatureScope scope(masm(), SSE2);
+        __ ucomisd(ToDoubleRegister(left), ToDoubleRegister(right));
+      }
       // Don't base result on EFLAGS when a NaN is involved. Instead
       // jump to the false block.
-      __ ucomisd(ToDoubleRegister(left), ToDoubleRegister(right));
       __ j(parity_even, instr->FalseLabel(chunk_));
     } else {
       if (right->IsConstantOperand()) {


--
--
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