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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart

Issue 12211013: Allow intercepted calls to have typed selectors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (revision 18140)
+++ sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (working copy)
@@ -279,6 +279,12 @@
HInstruction input = node.inputs[1];
HType type = types[input];
var interceptor = node.inputs[0];
+
+ if (interceptor.isConstant() && selector.isCall()) {
+ DartType type = types[interceptor].computeType(compiler);
+ node.element = type.element.lookupSelector(selector);
+ }
+
if (interceptor is !HThis && !type.canBePrimitive()) {
// If the type can be null, and the intercepted method can be in
// the object class, keep the interceptor.
@@ -331,6 +337,10 @@
}
}
if (target != null) {
+ // There is a strong dependency between codegen and this
kasperl 2013/02/06 07:24:03 Is this a TODO? It's unclear from the comment whet
ngeoffray 2013/02/06 08:11:55 It's kind of a problem. The feature is that we're
+ // optimization that the dynamic invoke does not need an
+ // interceptor. Once we start inlining, the dependency should
+ // go away.
HInvokeDynamicMethod result = new HInvokeDynamicMethod(
node.selector, node.inputs.getRange(1, node.inputs.length - 1));
result.element = target;
@@ -812,6 +822,7 @@
void visitInvokeDynamicMethod(HInvokeDynamicMethod node) {
Element element = node.element;
+ if (node.isInterceptorCall) return;
if (element != backend.jsArrayRemoveLast) return;
if (boundsChecked.contains(node)) return;
insertBoundsCheck(

Powered by Google App Engine
This is Rietveld 408576698