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

Unified 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, 2 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 side-by-side diff with in-line comments
Download patch
Index: tests/language/vm/optimized_guarded_field_test.dart
===================================================================
--- tests/language/vm/optimized_guarded_field_test.dart (revision 29540)
+++ tests/language/vm/optimized_guarded_field_test.dart (working copy)
@@ -32,4 +32,23 @@
a.foo = 123;
Expect.equals("other", test(a));
Expect.equals("null", test(b));
+
+ // Test guarded fields with allocation sinking and deoptimization.
+ Expect.equals(43, test_deopt(42, 1));
+ for (var i = 0; i < 20; i++) test_deopt(42, 1);
+ Expect.equals(43, test_deopt(42, 1));
+ Expect.equals("aaabbb", test_deopt("aaa", "bbb"));
}
+
+
+class C {
+ C(this.x, this.y);
+ final x;
+ final y;
+}
+
+
+test_deopt(a, b) {
+ var c = new C(a, b);
+ return c.x + c.y;
+}

Powered by Google App Engine
This is Rietveld 408576698