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

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

Issue 18563006: More tests updated to optimize code (Part 2). (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
« no previous file with comments | « tests/language/exception_in_increment_test.dart ('k') | tests/language/identical_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // Test that fast method extraction returns correct closure. 4 // Test that fast method extraction returns correct closure.
5 // VMOptions=--optimization-counter-threshold=10 --no-use-osr
5 6
6 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
7 8
8 class A { 9 class A {
9 var f; 10 var f;
10 A(this.f); 11 A(this.f);
11 foo() => 40 + f; 12 foo() => 40 + f;
12 } 13 }
13 14
14 class B { 15 class B {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 } 68 }
68 69
69 extractFromNull() { 70 extractFromNull() {
70 var f = (null).toString; 71 var f = (null).toString;
71 Expect.equals("null", f()); 72 Expect.equals("null", f());
72 } 73 }
73 74
74 main() { 75 main() {
75 var a = new A(2); 76 var a = new A(2);
76 var b = new B(2); 77 var b = new B(2);
77 for (var i = 0; i < 10000; i++) { 78 for (var i = 0; i < 20; i++) {
78 Expect.equals(42, mono(a)); 79 Expect.equals(42, mono(a));
79 } 80 }
80 81
81 for (var i = 0; i < 10000; i++) { 82 for (var i = 0; i < 20; i++) {
82 Expect.equals(42, poly(a)); 83 Expect.equals(42, poly(a));
83 Expect.equals(-42, poly(b)); 84 Expect.equals(-42, poly(b));
84 } 85 }
85 86
86 var c = new C<X>(); 87 var c = new C<X>();
87 var x = new X(); 88 var x = new X();
88 for (var i = 0; i < 10000; i++) { 89 for (var i = 0; i < 20; i++) {
89 types(c, x); 90 types(c, x);
90 } 91 }
91 92
92 var chaA = new ChaA("magicA"); 93 var chaA = new ChaA("magicA");
93 for (var i = 0; i < 10000; i++) { 94 for (var i = 0; i < 20; i++) {
94 Expect.equals("A", cha(chaA)); 95 Expect.equals("A", cha(chaA));
95 } 96 }
96 97
97 var chaB = new ChaB("magicB"); 98 var chaB = new ChaB("magicB");
98 for (var i = 0; i < 10000; i++) { 99 for (var i = 0; i < 20; i++) {
99 Expect.equals("B", cha(chaB)); 100 Expect.equals("B", cha(chaB));
100 } 101 }
101 102
102 for (var i = 0; i < 10000; i++) { 103 for (var i = 0; i < 20; i++) {
103 extractFromNull(); 104 extractFromNull();
104 } 105 }
105 } 106 }
106 107
OLDNEW
« no previous file with comments | « tests/language/exception_in_increment_test.dart ('k') | tests/language/identical_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698