OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 | 28 |
29 // Flags: --nodead-code-elimination --fold-constants --allow-natives-syntax | 29 // Flags: --nodead-code-elimination --fold-constants --allow-natives-syntax |
30 | 30 |
31 function test(f) { | 31 function test(f) { |
32 f(); | 32 f(); |
33 f(); | 33 f(); |
34 %OptimizeFunctionOnNextCall(f); | 34 %OptimizeFunctionOnNextCall(f); |
35 f(); | 35 f(); |
36 // Assert that there has been no deopt. | 36 // Assert that there has been no deopt. |
37 assertTrue(%GetOptimizationStatus(f) != 2); | 37 assertOptimized(f); |
38 } | 38 } |
39 | 39 |
40 test(function add() { | 40 test(function add() { |
41 assertEquals(2, 1 + 1); | 41 assertEquals(2, 1 + 1); |
42 assertEquals(2.5, 1.25 + 1.25); | 42 assertEquals(2.5, 1.25 + 1.25); |
43 assertEquals("Infinity", String(Infinity + Infinity)); | 43 assertEquals("Infinity", String(Infinity + Infinity)); |
44 assertEquals("Infinity", String(Infinity + 3)); | 44 assertEquals("Infinity", String(Infinity + 3)); |
45 assertEquals("NaN", String(Infinity + (-Infinity))); | 45 assertEquals("NaN", String(Infinity + (-Infinity))); |
46 assertEquals("NaN", String(NaN + 2)); | 46 assertEquals("NaN", String(NaN + 2)); |
47 assertEquals("-Infinity", String(1 / (-0.0 + (-0.0)))); | 47 assertEquals("-Infinity", String(1 / (-0.0 + (-0.0)))); |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 }); | 258 }); |
259 | 259 |
260 | 260 |
261 test(function int32Mod() { | 261 test(function int32Mod() { |
262 assertEquals(-0, -2147483648 % (-1)); | 262 assertEquals(-0, -2147483648 % (-1)); |
263 }); | 263 }); |
264 | 264 |
265 test(function int32Div() { | 265 test(function int32Div() { |
266 assertEquals(2147483648, -2147483648 / (-1)); | 266 assertEquals(2147483648, -2147483648 / (-1)); |
267 }); | 267 }); |
OLD | NEW |