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

Unified Diff: dart/frog/leg/ssa/builder.dart

Issue 9753007: Implement super-send to non-function. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 8 years, 9 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
« no previous file with comments | « no previous file | dart/frog/leg/ssa/codegen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/ssa/builder.dart
diff --git a/dart/frog/leg/ssa/builder.dart b/dart/frog/leg/ssa/builder.dart
index 086bc88312d503b6c231df69ca385656e088d155..5d3b4376e0285a715ddf9333f4971b4ed2f3da79 100644
--- a/dart/frog/leg/ssa/builder.dart
+++ b/dart/frog/leg/ssa/builder.dart
@@ -1902,17 +1902,21 @@ class SsaBuilder implements Visitor {
// Example: co19/Language/10_Expressions/25_Unary_Expressions_A06_t01
compiler.unimplemented('unresolved super-send', node: node);
}
- if (element.kind.category != ElementCategory.FUNCTION) {
- // Example:
- // co19/Language/10_Expressions/14_Method_Invocation/3_Super_Invocation_A03_t04
- compiler.unimplemented('super-send to non-function', node: node);
- }
HStatic target = new HStatic(element);
HInstruction context = localsHandler.readThis();
add(target);
var inputs = <HInstruction>[target, context];
- addStaticSendArgumentsToList(node, element, inputs);
- push(new HInvokeSuper(selector, inputs));
+ if (element.kind == ElementKind.FUNCTION ||
+ element.kind == ElementKind.GENERATIVE_CONSTRUCTOR) {
+ addStaticSendArgumentsToList(node, element, inputs);
+ push(new HInvokeSuper(selector, inputs));
+ } else {
+ target = new HInvokeSuper(Selector.GETTER, inputs);
+ add(target);
+ inputs = <HInstruction>[target];
+ addDynamicSendArgumentsToList(node, inputs);
+ push(new HInvokeClosure(selector, inputs));
+ }
}
visitStaticSend(Send node) {
« no previous file with comments | « no previous file | dart/frog/leg/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698