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

Side by Side Diff: tests/language/instance_incr_deopt_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/inline_value_context_test.dart ('k') | tests/language/instanceof4_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) 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 // VMOptions=--optimization-counter-threshold=10 --no-use-osr
4 5
5 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
6 7
7 // Check correct deoptimization of instance field increment. 8 // Check correct deoptimization of instance field increment.
8 9
9 10
10 main() { 11 main() {
11 var a = new A(); 12 var a = new A();
12 var aa = new A(); 13 var aa = new A();
13 for (int i = 0; i < 2000; i++) { 14 for (int i = 0; i < 20; i++) {
14 a.Incr(); 15 a.Incr();
15 myIncr(aa); 16 myIncr(aa);
16 conditionalIncr(false, a); 17 conditionalIncr(false, a);
17 } 18 }
18 Expect.equals(2000, a.f); 19 Expect.equals(20, a.f);
19 Expect.equals(2000, aa.f); 20 Expect.equals(20, aa.f);
20 a.f = 1.0; 21 a.f = 1.0;
21 // Deoptimize ++ part of instance increment. 22 // Deoptimize ++ part of instance increment.
22 a.Incr(); 23 a.Incr();
23 Expect.equals(2.0, a.f); 24 Expect.equals(2.0, a.f);
24 var b = new B(); 25 var b = new B();
25 // Deoptimize getfield part of instance increment. 26 // Deoptimize getfield part of instance increment.
26 myIncr(b); 27 myIncr(b);
27 Expect.equals(1.0, b.f); 28 Expect.equals(1.0, b.f);
28 // Deoptimize since no type feedback was collected. 29 // Deoptimize since no type feedback was collected.
29 var old = a.f; 30 var old = a.f;
(...skipping 17 matching lines...) Expand all
47 f++; 48 f++;
48 } 49 }
49 var f; 50 var f;
50 } 51 }
51 52
52 class B { 53 class B {
53 B() : f = 0; 54 B() : f = 0;
54 var f; 55 var f;
55 } 56 }
56 57
OLDNEW
« no previous file with comments | « tests/language/inline_value_context_test.dart ('k') | tests/language/instanceof4_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698