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

Unified Diff: pkg/compiler/lib/src/cps_ir/path_based_optimizer.dart

Issue 1761903002: dart2js cps: Keep interceptors in a separate field. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase Created 4 years, 10 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/cps_ir/path_based_optimizer.dart
diff --git a/pkg/compiler/lib/src/cps_ir/path_based_optimizer.dart b/pkg/compiler/lib/src/cps_ir/path_based_optimizer.dart
index aed13e6e34ce748e9d12405cb7513eca09fb6b04..e7c747f63c168469674240417cde8178dcf3132e 100644
--- a/pkg/compiler/lib/src/cps_ir/path_based_optimizer.dart
+++ b/pkg/compiler/lib/src/cps_ir/path_based_optimizer.dart
@@ -157,27 +157,23 @@ class PathBasedOptimizer extends TrampolineRecursiveVisitor
}
void visitInvokeMethod(InvokeMethod node) {
- int receiverValue = valueOf[node.dartReceiver] ?? ANY;
+ int receiverValue = valueOf[node.receiver] ?? ANY;
if (!backend.isInterceptedSelector(node.selector)) {
// Only self-interceptors can respond to a non-intercepted selector.
- valueOf[node.dartReceiver] = receiverValue & SELF_INTERCEPTOR;
+ valueOf[node.receiver] = receiverValue & SELF_INTERCEPTOR;
} else if (receiverValue & ~SELF_INTERCEPTOR == 0 &&
node.callingConvention == CallingConvention.Intercepted) {
// This is an intercepted call whose receiver is definitely a
// self-interceptor.
// TODO(25646): If TypeMasks could represent "any self-interceptor" this
// optimization should be subsumed by type propagation.
- node.receiverRef.changeTo(node.dartReceiver);
+ node.interceptorRef.changeTo(node.receiver);
// Replace the extra receiver argument with a dummy value if the
// target definitely does not use it.
- if (typeSystem.targetIgnoresReceiverArgument(node.dartReceiver.type,
+ if (typeSystem.targetIgnoresReceiverArgument(node.receiver.type,
node.selector)) {
- Constant dummy = new Constant(new IntConstantValue(0))
- ..type = typeSystem.intType;
- new LetPrim(dummy).insertAbove(node.parent);
- node.argumentRefs[0].changeTo(dummy);
- node.callingConvention = CallingConvention.DummyIntercepted;
+ node.makeDummyIntercepted();
}
}
}
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/optimize_interceptors.dart ('k') | pkg/compiler/lib/src/cps_ir/type_propagation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698