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

Unified Diff: sdk/lib/_internal/compiler/implementation/dart_backend/dart_codegen.dart

Issue 349923004: Add support for superSend to the new IR and dart backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Also handle sendSet Created 6 years, 6 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/dart_backend/dart_codegen.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/dart_codegen.dart b/sdk/lib/_internal/compiler/implementation/dart_backend/dart_codegen.dart
index 8ebc4794298f3b4445ddd9f70c006988c3cc0c8d..9db2de3f3fa30debaa545f731c1fe4dacb9e0332 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_backend/dart_codegen.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_backend/dart_codegen.dart
@@ -165,7 +165,7 @@ class ASTEmitter extends tree.Visitor<dynamic, Expression> {
}
/// True if the two expressions are a reference to the same variable.
- bool isSameVariable(Expression e1, Expression e2) {
+ bool isSameVariable(Receiver e1, Receiver e2) {
// TODO(asgerf): Using the annotated element isn't the best way to do this
// since elements are supposed to go away from codegen when we discard the
// old backend.
@@ -451,8 +451,7 @@ class ASTEmitter extends tree.Visitor<dynamic, Expression> {
}
}
- Expression visitInvokeMethod(tree.InvokeMethod exp) {
- Expression receiver = visitExpression(exp.receiver);
+ Expression emitMethodCall(tree.Invoke exp, Receiver receiver) {
List<Argument> args = emitArguments(exp);
switch (exp.selector.kind) {
case SelectorKind.CALL:
@@ -491,6 +490,15 @@ class ASTEmitter extends tree.Visitor<dynamic, Expression> {
}
}
+ Expression visitInvokeMethod(tree.InvokeMethod exp) {
+ Expression receiver = visitExpression(exp.receiver);
+ return emitMethodCall(exp, receiver);
+ }
+
+ Expression visitInvokeSuperMethod(tree.InvokeSuperMethod exp) {
+ return emitMethodCall(exp, new SuperReceiver());
+ }
+
Expression visitInvokeConstructor(tree.InvokeConstructor exp) {
List args = emitArguments(exp);
FunctionElement constructor = exp.target;

Powered by Google App Engine
This is Rietveld 408576698