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

Unified Diff: pkg/compiler/lib/src/ssa/builder_kernel.dart

Issue 2666803002: Add SuperPropertyGet. (Closed)
Patch Set: . Created 3 years, 11 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 | pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/builder_kernel.dart
diff --git a/pkg/compiler/lib/src/ssa/builder_kernel.dart b/pkg/compiler/lib/src/ssa/builder_kernel.dart
index 84ae3a5f66e08605b46ffa7e2cdf411f66e99769..90c312a68c2b401af50f8866f09180d0dfda127d 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -2627,11 +2627,12 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
return null;
}
- @override
- void visitSuperMethodInvocation(ir.SuperMethodInvocation invocation) {
+ HInstruction _buildInvokeSuper(
+ ir.Expression invocation, List<HInstruction> arguments) {
+ // Invocation is either a method invocation or a property get/set.
+ // TODO(efortuna): Common interface?
+ // TODO(efortuna): Add source information.
Selector selector = astAdapter.getSelector(invocation);
- List<HInstruction> arguments = _visitArgumentsForStaticTarget(
- invocation.interfaceTarget.function, invocation.arguments);
HInstruction receiver = localsHandler.readThis();
ir.Class surroundingClass = _containingClass(invocation);
@@ -2642,17 +2643,34 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
inputs.add(receiver);
inputs.addAll(arguments);
+ ir.Member interfaceTarget = invocation is ir.SuperMethodInvocation ?
+ (invocation as ir.SuperMethodInvocation).interfaceTarget :
+ (invocation as ir.SuperPropertyGet).interfaceTarget;
+
HInstruction instruction = new HInvokeSuper(
- astAdapter.getMethod(invocation.interfaceTarget),
+ astAdapter.getMember(interfaceTarget),
astAdapter.getClass(surroundingClass),
selector,
inputs,
- astAdapter.returnTypeOf(invocation.interfaceTarget),
+ astAdapter.returnTypeOf(interfaceTarget),
null,
isSetter: selector.isSetter || selector.isIndexSet);
instruction.sideEffects =
closedWorld.getSideEffectsOfSelector(selector, null);
push(instruction);
+ return instruction;
+ }
+
+ @override
+ void visitSuperPropertyGet(ir.SuperPropertyGet propertyGet) {
+ _buildInvokeSuper(propertyGet, const <HInstruction>[]);
+ }
+
+ @override
+ void visitSuperMethodInvocation(ir.SuperMethodInvocation invocation) {
+ List<HInstruction> arguments = _visitArgumentsForStaticTarget(
+ invocation.interfaceTarget.function, invocation.arguments);
+ _buildInvokeSuper(invocation, arguments);
}
@override
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698