OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // Dart test program to test cid guessing optimizations. | 4 // Dart test program to test cid guessing optimizations. |
5 // VMOptions=--optimization-counter-threshold=10 --no-background-compilation | 5 // VMOptions=--optimization-counter-threshold=10 --no-background-compilation |
6 | 6 |
7 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
8 | 8 |
9 main() { | 9 main() { |
10 // Warmup optimizes methods. | 10 // Warmup optimizes methods. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 for (int i = 0; i < N; ++i) { | 79 for (int i = 0; i < N; ++i) { |
80 // Will trigger OSR. Operation in loop below will use guessed cids. | 80 // Will trigger OSR. Operation in loop below will use guessed cids. |
81 } | 81 } |
82 int sum = 0; | 82 int sum = 0; |
83 for (int i = 0; i < N; ++i) { | 83 for (int i = 0; i < N; ++i) { |
84 // Guess 'x' is Smi, but is actually Bigint: deoptimize. | 84 // Guess 'x' is Smi, but is actually Bigint: deoptimize. |
85 sum += x + 2; | 85 sum += x + 2; |
86 } | 86 } |
87 return sum; | 87 return sum; |
88 } | 88 } |
OLD | NEW |