OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // VMOptions=--optimization-counter-threshold=10 |
4 | 5 |
5 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
6 | 7 |
7 constants() { | 8 constants() { |
8 Expect.equals(0, 499 >> 33); | 9 Expect.equals(0, 499 >> 33); |
9 Expect.equals(0, (499 << 33) & 0xFFFFFFFF); | 10 Expect.equals(0, (499 << 33) & 0xFFFFFFFF); |
10 Expect.equals(0, (499 << 32) >> 65); | 11 Expect.equals(0, (499 << 32) >> 65); |
11 Expect.equals(0, ((499 << 32) << 65) & 0xFFFFFFFFFFFFFFFF); | 12 Expect.equals(0, ((499 << 32) << 65) & 0xFFFFFFFFFFFFFFFF); |
12 } | 13 } |
13 | 14 |
(...skipping 28 matching lines...) Expand all Loading... |
42 Expect.equals(0, a >> 33); | 43 Expect.equals(0, a >> 33); |
43 Expect.equals(0, (a << 33) & 0xFFFFFFFF); | 44 Expect.equals(0, (a << 33) & 0xFFFFFFFF); |
44 Expect.equals(0, b >> 65); | 45 Expect.equals(0, b >> 65); |
45 Expect.equals(0, (b << 65) & 0xFFFFFFFFFFFFFFFF); | 46 Expect.equals(0, (b << 65) & 0xFFFFFFFFFFFFFFFF); |
46 } | 47 } |
47 } | 48 } |
48 | 49 |
49 // JavaScript shifts by the amount modulo 32. That is x << y is equivalent to | 50 // JavaScript shifts by the amount modulo 32. That is x << y is equivalent to |
50 // x << (y & 0x1F). Dart does not. | 51 // x << (y & 0x1F). Dart does not. |
51 main() { | 52 main() { |
52 constants(); | 53 for (var i = 0; i < 10; ++i) { |
53 interceptors(); | 54 constants(); |
54 speculative(); | 55 interceptors(); |
| 56 speculative(); |
| 57 } |
55 } | 58 } |
OLD | NEW |