Make sin-cos test case compatible with --always-osr.
R=machenbach@chromium.org Review URL: https://codereview.chromium.org/98893002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18188 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
db915fe97e
commit
3d062847a4
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user