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

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

Issue 22854016: Native subclasses of a mixin include classes extending native classes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 | « sdk/lib/_internal/compiler/implementation/ssa/interceptor_simplifier.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/subclassing_4_test.dart
diff --git a/tests/compiler/dart2js_native/subclassing_3_test.dart b/tests/compiler/dart2js_native/subclassing_4_test.dart
similarity index 57%
copy from tests/compiler/dart2js_native/subclassing_3_test.dart
copy to tests/compiler/dart2js_native/subclassing_4_test.dart
index d73f0c82d0de09626ce85484fccfaddd7ae39013..9d25e1a448e09543c0c6cf6847a6144ae949c89e 100644
--- a/tests/compiler/dart2js_native/subclassing_3_test.dart
+++ b/tests/compiler/dart2js_native/subclassing_4_test.dart
@@ -6,26 +6,24 @@ import "package:expect/expect.dart";
import 'dart:_js_helper' show Creates, setNativeSubclassDispatchRecord;
import 'dart:_interceptors' show Interceptor, findInterceptorForType;
-// Test calling convention of methods introduced on subclasses of native
-// class of mixin.
-
-doFoo(r, x) => '$x,${r.oof()},${r.miz()}';
+// Test calling convention on subclasses of native classes.
class M {
miz() => 'M';
}
-class N native "N" {
- foo(x) => (doFoo)(this, x);
-}
+class N native "N" {}
class A extends N {}
class B extends A with M {
- // [oof] is introduced only on this subclass of a native class. It should
- // have interceptor calling convention.
- oof() => 'B';
- // [miz] is introduced only on the mixin-application A+M.
+ // The call to [miz] has a know type [B]. The call is in an intercepted
+ // method and to an intercepted method, so the ambient interceptor can be
+ // used. For correct optimization of the interceptor, the compiler needs to
+ // (1) correctly determine that B is an intercepted type (because it extends a
+ // native class) and (2) realize that the intersection of [B] and subclasses
+ // of mixin applications of [M] is non-empty.
+ callMiz() => this.miz();
}
B makeB() native;
@@ -36,7 +34,6 @@ getBPrototype() native;
void setup() native r"""
function B() {}
makeB = function(){return new B;};
-
getBPrototype = function(){return B.prototype;};
""";
@@ -46,5 +43,5 @@ main() {
setNativeSubclassDispatchRecord(getBPrototype(), findInterceptorForType(B));
B b = makeB();
- Expect.equals('1,B,M', b.foo(1));
+ Expect.equals('M', b.callMiz());
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/interceptor_simplifier.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698