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

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

Issue 19034002: Add VMOptions to optimize tests that need to be (Part I). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 months 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 // Test deoptimization caused by running code that did not collect type 4 // Test deoptimization caused by running code that did not collect type
5 // feedback before. 5 // feedback before.
6 // VMOptions=--optimization-counter-threshold=10 --no-use-osr
6 7
7 import "package:expect/expect.dart"; 8 import "package:expect/expect.dart";
8 9
9 testStoreIndexed() { 10 testStoreIndexed() {
10 test(a, i, v, flag) { 11 test(a, i, v, flag) {
11 if (flag) { 12 if (flag) {
12 // No type feedback in first pass 13 // No type feedback in first pass
13 return a[i] = v; 14 return a[i] = v;
14 } else { 15 } else {
15 return a[i] = i; 16 return a[i] = i;
16 } 17 }
17 } 18 }
18 19
19 var a = new List(10); 20 var a = new List(10);
20 for (var i = 0; i < 2000; i++) { 21 for (var i = 0; i < 20; i++) {
21 var r = test(a, 3, 888, false); 22 var r = test(a, 3, 888, false);
22 Expect.equals(3, r); 23 Expect.equals(3, r);
23 Expect.equals(3, a[3]); 24 Expect.equals(3, a[3]);
24 } 25 }
25 // Deopt. 26 // Deopt.
26 var r = test(a, 3, 888, true); 27 var r = test(a, 3, 888, true);
27 Expect.equals(888, r); 28 Expect.equals(888, r);
28 Expect.equals(888, a[3]); 29 Expect.equals(888, a[3]);
29 } 30 }
30 31
31 testIncrLocal() { 32 testIncrLocal() {
32 test(a, flag) { 33 test(a, flag) {
33 if (flag) { 34 if (flag) {
34 a++; 35 a++;
35 return a; 36 return a;
36 } else { 37 } else {
37 return -1; 38 return -1;
38 } 39 }
39 } 40 }
40 41
41 for (var i = 0; i < 2000; i++) { 42 for (var i = 0; i < 20; i++) {
42 var r = test(10, false); 43 var r = test(10, false);
43 Expect.equals(-1, r); 44 Expect.equals(-1, r);
44 } 45 }
45 // Deopt. 46 // Deopt.
46 var r = test(10, true); 47 var r = test(10, true);
47 Expect.equals(11, r); 48 Expect.equals(11, r);
48 } 49 }
49 50
50 51
51 main() { 52 main() {
52 for (var i = 0; i < 2000; i++) {} 53 for (var i = 0; i < 20; i++) {}
53 testStoreIndexed(); 54 testStoreIndexed();
54 testIncrLocal(); 55 testIncrLocal();
55 } 56 }
OLDNEW
« no previous file with comments | « tests/language/deopt_inlined_function_lazy_test.dart ('k') | tests/language/deopt_smi_op_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698