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

Unified Diff: dart/lib/compiler/implementation/ssa/builder.dart

Issue 10444138: Implement super store. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update test status Created 8 years, 7 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/lib/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/ssa/builder.dart
diff --git a/dart/lib/compiler/implementation/ssa/builder.dart b/dart/lib/compiler/implementation/ssa/builder.dart
index 0d38ec3cc1b937adb2ebf17c0e87ff87f28db9c8..3db36f015377c3dc81b15ec06f066677f520ac86 100644
--- a/dart/lib/compiler/implementation/ssa/builder.dart
+++ b/dart/lib/compiler/implementation/ssa/builder.dart
@@ -2268,27 +2268,28 @@ class SsaBuilder implements Visitor {
}
}
+ generateSuperNoSuchMethodSend(Send node) {
+ ClassElement cls = work.element.getEnclosingClass();
+ Element element = cls.lookupSuperMember(Compiler.NO_SUCH_METHOD);
+ HStatic target = new HStatic(element);
+ add(target);
+ HInstruction self = localsHandler.readThis();
+ Identifier identifier = node.selector.asIdentifier();
+ String name = identifier.source.slowToString();
+ // TODO(ahe): Add the arguments to this list.
+ push(new HLiteralList([]));
+ var inputs = <HInstruction>[
+ target,
+ self,
+ graph.addConstantString(new DartString.literal(name), node),
+ pop()];
+ push(new HInvokeSuper(Selector.INVOCATION_2, inputs));
+ }
+
visitSuperSend(Send node) {
Selector selector = elements.getSelector(node);
Element element = elements[node];
- if (element === null) {
- ClassElement cls = work.element.getEnclosingClass();
- element = cls.lookupSuperMember(Compiler.NO_SUCH_METHOD);
- HStatic target = new HStatic(element);
- add(target);
- HInstruction self = localsHandler.readThis();
- Identifier identifier = node.selector.asIdentifier();
- String name = identifier.source.slowToString();
- // TODO(ahe): Add the arguments to this list.
- push(new HLiteralList([]));
- var inputs = <HInstruction>[
- target,
- self,
- graph.addConstantString(new DartString.literal(name), node),
- pop()];
- push(new HInvokeSuper(Selector.INVOCATION_2, inputs));
- return;
- }
+ if (element === null) return generateSuperNoSuchMethodSend(node);
HInstruction target = new HStatic(element);
HInstruction context = localsHandler.readThis();
add(target);
@@ -2462,7 +2463,15 @@ class SsaBuilder implements Visitor {
visitSendSet(SendSet node) {
Operator op = node.assignmentOperator;
if (node.isSuperCall) {
- compiler.unimplemented('super property store', node: node);
+ Selector selector = elements.getSelector(node);
+ Element element = elements[node];
+ if (element === null) return generateSuperNoSuchMethodSend(node);
+ HInstruction target = new HStatic(element);
+ HInstruction context = localsHandler.readThis();
+ add(target);
+ var inputs = <HInstruction>[target, context];
+ addDynamicSendArgumentsToList(node, inputs);
+ push(new HInvokeSuper(selector, inputs));
} else if (node.isIndex) {
if (!methodInterceptionEnabled) {
assert(op.source.stringValue === '=');
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698