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

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

Issue 50243004: Fix bug with guarded fields and deserialization. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
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 // Test correct handling of phis with only environment uses that were inserted 4 // Test correct handling of phis with only environment uses that were inserted
5 // by store to load forwarding. 5 // by store to load forwarding.
6 // VMOptions=--optimization_counter_threshold=10 6 // VMOptions=--optimization_counter_threshold=10
7 7
8 import "package:expect/expect.dart"; 8 import "package:expect/expect.dart";
9 9
10 class A { 10 class A {
(...skipping 14 matching lines...) Expand all
25 test(a); 25 test(a);
26 test(b); 26 test(b);
27 for (var i = 0; i < 20; ++i) test(a); 27 for (var i = 0; i < 20; ++i) test(a);
28 Expect.equals("null", test(a)); 28 Expect.equals("null", test(a));
29 Expect.equals("null", test(b)); 29 Expect.equals("null", test(b));
30 30
31 // Store a non-null object into foo to trigger deoptimization of test. 31 // Store a non-null object into foo to trigger deoptimization of test.
32 a.foo = 123; 32 a.foo = 123;
33 Expect.equals("other", test(a)); 33 Expect.equals("other", test(a));
34 Expect.equals("null", test(b)); 34 Expect.equals("null", test(b));
35
36 // Test guarded fields with allocation sinking and deoptimization.
37 Expect.equals(43, test_deopt(42, 1));
38 for (var i = 0; i < 20; i++) test_deopt(42, 1);
39 Expect.equals(43, test_deopt(42, 1));
40 Expect.equals("aaabbb", test_deopt("aaa", "bbb"));
35 } 41 }
42
43
44 class C {
45 C(this.x, this.y);
46 final x;
47 final y;
48 }
49
50
51 test_deopt(a, b) {
52 var c = new C(a, b);
53 return c.x + c.y;
54 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698