Reviewers: machenbach,
Description:
Make sin-cos test case compatible with --always-osr.
[email protected]
Please review this at https://codereview.chromium.org/98893002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+16, -11 lines):
M test/mjsunit/sin-cos.js
Index: test/mjsunit/sin-cos.js
diff --git a/test/mjsunit/sin-cos.js b/test/mjsunit/sin-cos.js
index
b63c15e13c2e29151e1311032d85a3cff64c4dd6..02ae57ba2773529d20e683eb63fc7b10d135bd26
100644
--- a/test/mjsunit/sin-cos.js
+++ b/test/mjsunit/sin-cos.js
@@ -29,6 +29,22 @@
// Flags: --allow-natives-syntax
+assertEquals("-Infinity", String(1/Math.sin(-0)));
+assertEquals(1, Math.cos(-0));
+assertEquals("-Infinity", String(1/Math.tan(-0)));
+
+// Assert that minus zero does not cause deopt.
+function no_deopt_on_minus_zero(x) {
+ return Math.sin(x) + Math.cos(x) + Math.tan(x);
+}
+
+no_deopt_on_minus_zero(1);
+no_deopt_on_minus_zero(1);
+%OptimizeFunctionOnNextCall(no_deopt_on_minus_zero);
+no_deopt_on_minus_zero(-0);
+assertOptimized(no_deopt_on_minus_zero);
+
+
function sinTest() {
assertEquals(0, Math.sin(0));
assertEquals(1, Math.sin(Math.PI / 2));
@@ -169,14 +185,3 @@ for (var i = -1024; i < 1024; i++) {
assertFalse(isNaN(Math.cos(1.57079632679489700)));
assertFalse(isNaN(Math.cos(-1e-100)));
assertFalse(isNaN(Math.cos(-1e-323)));
-
-
-function no_deopt_on_minus_zero(x) {
- return Math.sin(x) + Math.cos(x) + Math.tan(x);
-}
-
-no_deopt_on_minus_zero(1);
-no_deopt_on_minus_zero(1);
-%OptimizeFunctionOnNextCall(no_deopt_on_minus_zero);
-no_deopt_on_minus_zero(-0);
-assertOptimized(no_deopt_on_minus_zero);
--
--
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.