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

Unified Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 1182913003: Split TypedSelector into Selector and TypeMask. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 6 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: pkg/compiler/lib/src/js_backend/backend.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index e037ff376d1b22f1561d66a128f0f6790b83cff1..c40247a7128b026f3812cfc6547894f7caa73762 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -784,7 +784,7 @@ class JavaScriptBackend extends Backend {
* into an intercepted class. These selectors are not eligible for the 'dummy
* explicit receiver' optimization.
*/
- bool isInterceptedMixinSelector(Selector selector) {
+ bool isInterceptedMixinSelector(Selector selector, TypeMask mask) {
Set<Element> elements = interceptedMixinElements.putIfAbsent(
selector.name,
() {
@@ -799,7 +799,10 @@ class JavaScriptBackend extends Backend {
if (elements == null) return false;
if (elements.isEmpty) return false;
- return elements.any((element) => selector.applies(element, compiler.world));
+ return elements.any((element) {
+ return selector.applies(element, compiler.world) &&
+ (mask == null || mask.canHit(element, selector, compiler.world));
+ });
}
final Map<String, Set<ClassElement>> interceptedClassesCache =
@@ -1278,7 +1281,8 @@ class JavaScriptBackend extends Backend {
void enableNoSuchMethod(Enqueuer world) {
enqueue(world, getCreateInvocationMirror(), compiler.globalDependencies);
- world.registerInvocation(compiler.noSuchMethodSelector);
+ world.registerInvocation(
+ new UniverseSelector(compiler.noSuchMethodSelector, null));
}
void enableIsolateSupport(Enqueuer enqueuer) {
« no previous file with comments | « pkg/compiler/lib/src/inferrer/type_graph_nodes.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698