OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --allow-natives-syntax | 5 // Flags: --allow-natives-syntax --crankshaft |
6 | 6 |
7 (function() { | 7 (function() { |
8 function foo(x) { | 8 function foo(x) { |
9 x = x >>> 0; | 9 x = x >>> 0; |
10 var y = 0 - 2147483648; | 10 var y = 0 - 2147483648; |
11 return x + y; | 11 return x + y; |
12 } | 12 } |
13 | 13 |
14 assertEquals(-2147483648, foo(0)); | 14 assertEquals(-2147483648, foo(0)); |
15 assertEquals(0, foo(2147483648)); | 15 assertEquals(0, foo(2147483648)); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 %BaselineFunctionOnNextCall(foo); | 122 %BaselineFunctionOnNextCall(foo); |
123 assertEquals(2147483647, foo(-1)); | 123 assertEquals(2147483647, foo(-1)); |
124 assertEquals(2147483648, foo(0)); | 124 assertEquals(2147483648, foo(0)); |
125 assertEquals(2147483649, foo(1)); | 125 assertEquals(2147483649, foo(1)); |
126 %OptimizeFunctionOnNextCall(foo); | 126 %OptimizeFunctionOnNextCall(foo); |
127 assertEquals(2147483647, foo(-1)); | 127 assertEquals(2147483647, foo(-1)); |
128 assertEquals(2147483648, foo(0)); | 128 assertEquals(2147483648, foo(0)); |
129 assertEquals(2147483649, foo(1)); | 129 assertEquals(2147483649, foo(1)); |
130 assertOptimized(foo); | 130 assertOptimized(foo); |
131 })(); | 131 })(); |
OLD | NEW |