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

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

Issue 23567019: Change how we generate bound closures to handler boud closures due to super getters: we need to pas… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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/codegen.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (revision 27466)
+++ sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (working copy)
@@ -1639,7 +1639,7 @@
visitInvokeSuper(HInvokeSuper node) {
Element superMethod = node.element;
world.registerStaticUse(superMethod);
- Element superClass = superMethod.getEnclosingClass();
+ ClassElement superClass = superMethod.getEnclosingClass();
if (superMethod.kind == ElementKind.FIELD) {
String fieldName = node.caller.isShadowedByField(superMethod)
? backend.namer.shadowedFieldName(superMethod)
@@ -1654,7 +1654,19 @@
push(access, node);
}
} else {
- String methodName = backend.namer.getName(superMethod);
+ Selector selector = node.selector;
+ String methodName;
+ if (selector.isGetter()) {
+ // If the selector we need to register a typed getter to the
+ // [world]. The emitter needs to know if it needs to emit a
+ // bound closure for a method.
+ TypeMask receiverType = new TypeMask.nonNullExact(superClass.rawType);
+ selector = new TypedSelector(receiverType, selector);
+ world.registerDynamicGetter(selector);
+ methodName = backend.namer.invocationName(selector);
+ } else {
+ methodName = backend.namer.getName(superMethod);
+ }
String className = backend.namer.isolateAccess(superClass);
js.VariableUse classReference = new js.VariableUse(className);
js.PropertyAccess prototype =

Powered by Google App Engine
This is Rietveld 408576698