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

Side by Side Diff: tests/language/vm/load_elimination_any_use_creates_alias_test.dart

Issue 184523002: Allocation sinking for contexts. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: added new test Created 6 years, 1 month 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
(Empty)
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
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.
4 // Test correctness of side effects tracking used by load to load forwarding.
5
6 // VMOptions=--no-use-osr --optimization-counter-threshold=10 --enable-inlining- annotations
7
8 import "package:expect/expect.dart";
9
10 const alwaysInline = "AlwaysInline";
11 const noInline = "NeverInline";
12
13 B G;
14
15 @noInline
16 modify() {
17 G.bval = 123;
18 }
19
20 class B {
21
22 @alwaysInline
23 poly() {
24 G = this;
25 modify();
26 return bval;
27 }
28 var bval = -1;
29 }
30
31 class C {
32 poly() => null;
33 }
34
35
36 @alwaysInline
37 foo(obj) => obj.poly();
38
39 @noInline
40 test() {
41 var b = new B();
42
43 foo(b);
44 return b.bval;
45 }
46
47 main() {
48 foo(new C());
49 foo(new B());
50 for (var i = 0; i < 100; i++) test();
51 Expect.equals(123, test());
52 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698