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

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

Issue 11358217: Add a getter interceptor to the new interceptor scheme. Also cleanup the "this" that turns into a r… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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/codegen.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (revision 14875)
+++ sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (working copy)
@@ -1526,7 +1526,7 @@
// on an interceptor by checking if the arguments in the inputs list
// is one more than the arguments in the selector. The extra
// argument in an interceptor call is the actual receiver.
- bool isInterceptorCall(HInvokeDynamicMethod node) {
+ bool isInterceptorCall(HInvokeDynamic node) {
return node.inputs.length - 1 != node.selector.argumentCount;
}
@@ -1558,6 +1558,8 @@
// [registerDynamicInvocation].
if (!isInterceptorCall(node)) {
backend.registerDynamicInvocation(node, selector, types);
+ } else {
+ backend.addInterceptedSelector(selector);
}
// If we don't know what we're calling or if we are calling a getter,
@@ -1588,6 +1590,8 @@
Selector defaultSelector) {
// TODO(4434): For private members we need to use the untyped selector.
if (defaultSelector.name.isPrivate()) return defaultSelector;
+ // TODO(ngeoffray): Type intercepted calls.
+ if (isInterceptorCall(node)) return defaultSelector;
// If [JSInvocationMirror.invokeOn] has been called, we must not create a
// typed selector based on the receiver type.
if (node.element == null && // Invocation is not exact.
@@ -1620,6 +1624,9 @@
push(jsPropertyCall(pop(), name, visitArguments(node.inputs)), node);
world.registerDynamicGetter(
getter.name, getOptimizedSelectorFor(node, getter));
+ if (isInterceptorCall(node)) {
+ backend.addInterceptedSelector(getter);
+ }
}
visitInvokeClosure(HInvokeClosure node) {
@@ -1983,11 +1990,7 @@
}
visitThis(HThis node) {
- if (backend.isInterceptorClass(work.element.getEnclosingClass())){
- push(new js.VariableUse(variableNames.getName(node)), node);
- } else {
- push(new js.This());
- }
+ push(new js.This());
}
visitThrow(HThrow node) {

Powered by Google App Engine
This is Rietveld 408576698