Fixed jump in non-SSE4.1 implementation of LMathFloor instruction on x64.
authorishell@chromium.org <ishell@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 6 May 2014 14:20:46 +0000 (14:20 +0000)
committerishell@chromium.org <ishell@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 6 May 2014 14:20:46 +0000 (14:20 +0000)
BUG=chromium:370384
LOG=N
R=ulan@chromium.org

Review URL: https://codereview.chromium.org/261853009

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21171 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/x64/lithium-codegen-x64.cc
test/mjsunit/regress/regress-370384.js [new file with mode: 0644]

index c0b46f4..a53a196 100644 (file)
@@ -3639,7 +3639,7 @@ void LCodeGen::DoMathFloor(LMathFloor* instr) {
       __ testq(output_reg, Immediate(1));
       DeoptimizeIf(not_zero, instr->environment());
       __ Set(output_reg, 0);
-      __ jmp(&done, Label::kNear);
+      __ jmp(&done);
       __ bind(&positive_sign);
     }
 
diff --git a/test/mjsunit/regress/regress-370384.js b/test/mjsunit/regress/regress-370384.js
new file mode 100644 (file)
index 0000000..28aea69
--- /dev/null
@@ -0,0 +1,16 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --deopt-every-n-times=1 --no-enable_sse4_1
+
+function g(f, x, name) {
+  var v2 = f(x);
+  for (var i = 0; i < 13000; i++) {
+    f(i);
+  }
+  var v1 = f(x);
+  assertEquals(v1, v2);
+}
+
+g(Math.sin, 6.283185307179586, "Math.sin");