From 0768479e7452a662e74b1c5fe89840be8d199f27 Mon Sep 17 00:00:00 2001 From: "alexandre.rames@arm.com" Date: Thu, 20 Mar 2014 10:12:49 +0000 Subject: [PATCH] A64: Improve the deoptimization exit code for LMathRound. R=ulan@chromium.org Review URL: https://codereview.chromium.org/203253004 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20109 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/a64/lithium-codegen-a64.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/a64/lithium-codegen-a64.cc b/src/a64/lithium-codegen-a64.cc index f67eefa..09b4326 100644 --- a/src/a64/lithium-codegen-a64.cc +++ b/src/a64/lithium-codegen-a64.cc @@ -4027,7 +4027,6 @@ void LCodeGen::DoMathRound(LMathRound* instr) { DoubleRegister temp1 = ToDoubleRegister(instr->temp1()); Register result = ToRegister(instr->result()); Label try_rounding; - Label deopt; Label done; // Math.round() rounds to the nearest integer, with ties going towards @@ -4049,8 +4048,7 @@ void LCodeGen::DoMathRound(LMathRound* instr) { if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { __ Fmov(result, input); - __ Cmp(result, 0); - DeoptimizeIf(mi, instr->environment()); // [-0.5, -0.0]. + DeoptimizeIfNegative(result, instr->environment()); // [-0.5, -0.0]. } __ Fcmp(input, dot_five); __ Mov(result, 1); // +0.5. @@ -4059,9 +4057,6 @@ void LCodeGen::DoMathRound(LMathRound* instr) { __ Csel(result, result, xzr, eq); __ B(&done); - __ Bind(&deopt); - Deoptimize(instr->environment()); - __ Bind(&try_rounding); // Since we're providing a 32-bit result, we can implement ties-to-infinity by // adding 0.5 to the input, then taking the floor of the result. This does not @@ -4076,7 +4071,7 @@ void LCodeGen::DoMathRound(LMathRound* instr) { // * the result is not representable using a 32-bit integer. __ Fcmp(input, 0.0); __ Ccmp(result, Operand(result.W(), SXTW), NoFlag, vc); - __ B(ne, &deopt); + DeoptimizeIf(ne, instr->environment()); __ Bind(&done); } -- 2.7.4