Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: tests/language/guess_cid_test.dart

Issue 102973007: Constant propagation in LoadIndexed when inputs are array/string and index constants. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 arithmetic operations. 4 // Dart test program to test cid guessing optimizations.
5 // VMOptions=--optimization-counter-threshold=10 5 // VMOptions=--optimization-counter-threshold=10
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.
11 for (int i = 0; i < 100; i++) { 11 for (int i = 0; i < 100; i++) {
12 Expect.equals(i, compareInt(i)); 12 Expect.equals(i, compareInt(i));
13 Expect.equals(i.toDouble(), compareDouble(i.toDouble())); 13 Expect.equals(i.toDouble(), compareDouble(i.toDouble()));
14 Expect.equals(i, binOpInt(i, i)); 14 Expect.equals(i, binOpInt(i, i));
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698