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

Unified Diff: tests/compiler/dart2js_native/load_elim_refinement_test.dart

Issue 1459273002: dart2js load elimination: Look through refinements for locations (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 3 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
« no previous file with comments | « pkg/compiler/lib/src/ssa/optimize.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js_native/load_elim_refinement_test.dart
diff --git a/tests/compiler/dart2js_native/load_elim_refinement_test.dart b/tests/compiler/dart2js_native/load_elim_refinement_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..026b142ac3eab8d90a4118a75522d501466d7a1f
--- /dev/null
+++ b/tests/compiler/dart2js_native/load_elim_refinement_test.dart
@@ -0,0 +1,30 @@
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+import 'dart:_foreign_helper' show JS;
+
+class A {
+ int a;
+}
+
+class B extends A {
+ int b;
+}
+
+@NoInline()
+escape(v) { g = v; }
+var g;
+
+main() {
+ g = new A();
+ var a = JS('returns:A;new:true', '(1,#)', new B());
+
+ a.a = 1;
+ if (a is B) {
+ escape(a); // Here we need to escape 'a' not the refinement of a to B.
+ g.a = 2;
+ Expect.equals(2, a.a);
+ }
+}
« no previous file with comments | « pkg/compiler/lib/src/ssa/optimize.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698