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

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

Issue 12330135: Make instance methods whose names collide with intercepted methods have the interceptor calling con… (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/nodes.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/nodes.dart (revision 19306)
+++ sdk/lib/_internal/compiler/implementation/ssa/nodes.dart (working copy)
@@ -1316,6 +1316,9 @@
toString() => 'invoke dynamic: $selector';
HInstruction get receiver => inputs[0];
+ /**
+ * Returns whether this call is on an intercepted method.
+ */
bool get isInterceptorCall {
// We know it's a selector call if it follows the interceptor
// calling convention, which adds the actual receiver as a
@@ -1323,6 +1326,18 @@
return inputs.length - 2 == selector.argumentCount;
}
+ /**
+ * Returns whether this call is on an interceptor object.
+ */
+ bool get isCallOnInterceptor {
+ // When the optimizers know this call does not need an
+ // interceptor, they udpate the receiver of the call to be the
+ // actual receiver.
+ // TODO(ngeoffray): This is very fragile and we should inspect the
+ // receiver instead.
+ return isInterceptorCall && inputs[0] != inputs[1];
+ }
+
int typeCode() => HInstruction.INVOKE_DYNAMIC_TYPECODE;
bool typeEquals(other) => other is HInvokeDynamic;
bool dataEquals(HInvokeDynamic other) {

Powered by Google App Engine
This is Rietveld 408576698