From 73b03b895b2925c79294cc15dc94a2fc70fa42d0 Mon Sep 17 00:00:00 2001 From: "bmeurer@chromium.org" Date: Mon, 16 Sep 2013 12:38:41 +0000 Subject: [PATCH] Make HCompareNumericAndBranch safe for snapshots on ia32. R=danno@chromium.org Review URL: https://codereview.chromium.org/24078012 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16730 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/ia32/lithium-codegen-ia32.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index 7d7b51d..ec0d042 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)) { + CpuFeatureScope scope(masm(), SSE2); + __ ucomisd(ToDoubleRegister(left), ToDoubleRegister(right)); + } else { + X87Fxch(ToX87Register(right)); + X87Fxch(ToX87Register(left), 1); + __ fld(0); + __ fld(2); + __ FCmp(); + } // 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()) { -- 2.7.4