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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart

Issue 1088933004: Use CallStructure instead of Selector in SemanticSendVisitor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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: pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
index 57fa001633d7e0b748f7b1c66d37d6158dce8cd4..3d715c4bb7378ed7579d3c77eb787b414a906d76 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
@@ -12,6 +12,7 @@ import '../elements/elements.dart';
import '../io/source_information.dart';
import '../tree/tree.dart' as ast;
import '../closure.dart' hide ClosureScope;
+import '../universe/universe.dart' show SelectorKind;
import 'cps_ir_nodes.dart' as ir;
import 'cps_ir_builder_task.dart' show DartCapturedVariables,
GlobalProgramInformation;
@@ -647,11 +648,11 @@ abstract class IrBuilder {
}
ir.Primitive _buildInvokeCall(ir.Primitive target,
- Selector selector,
+ CallStructure callStructure,
List<ir.Definition> arguments,
{SourceInformation sourceInformation}) {
- Selector callSelector = new Selector.callClosureFrom(selector);
- return _buildInvokeDynamic(target, callSelector, arguments,
+ Selector selector = callStructure.callSelector;
+ return _buildInvokeDynamic(target, selector, arguments,
sourceInformation: sourceInformation);
}
@@ -868,24 +869,26 @@ abstract class IrBuilder {
}
/// Create a invocation of the [method] on the super class where the call
- /// structure is defined [selector] and the argument values are defined by
- /// [arguments].
+ /// structure is defined [callStructure] and the argument values are defined
+ /// by [arguments].
ir.Primitive buildSuperMethodInvocation(MethodElement method,
- Selector selector,
+ CallStructure callStructure,
List<ir.Primitive> arguments) {
+ Selector selector =
+ new Selector(SelectorKind.CALL, method.memberName, callStructure);
return _buildInvokeSuper(method, selector, arguments);
}
/// Create a call invocation on the value of [field] on the super class where
- /// the call structure is defined [selector] and the argument values are
+ /// the call structure is defined [callStructure] and the argument values are
/// defined by [arguments].
ir.Primitive buildSuperFieldInvocation(FieldElement field,
- Selector selector,
+ CallStructure callStructure,
List<ir.Primitive> arguments) {
// TODO(johnniwinther): Maybe this should have its own ir node.
return buildCallInvocation(
buildSuperFieldGet(field),
- selector,
+ callStructure,
arguments);
}
@@ -893,12 +896,12 @@ abstract class IrBuilder {
/// super class where the call structure is defined [selector] and the
/// argument values are defined by [arguments].
ir.Primitive buildSuperGetterInvocation(MethodElement getter,
- Selector selector,
+ CallStructure callStructure,
List<ir.Primitive> arguments) {
// TODO(johnniwinther): Maybe this should have its own ir node.
return buildCallInvocation(
buildSuperGetterGet(getter),
- selector,
+ callStructure,
arguments);
}
@@ -1018,64 +1021,69 @@ abstract class IrBuilder {
ir.Primitive buildLocalVariableSet(LocalElement local, ir.Primitive value);
/// Create an invocation of the the [local] variable or parameter where
- /// argument structure is defined by [selector] and the argument values are
- /// defined by [arguments].
+ /// argument structure is defined by [callStructure] and the argument values
+ /// are defined by [arguments].
ir.Primitive buildLocalVariableInvocation(LocalVariableElement local,
- Selector selector,
+ CallStructure callStructure,
List<ir.Primitive> arguments) {
return buildCallInvocation(
- buildLocalVariableGet(local), selector, arguments);
+ buildLocalVariableGet(local), callStructure, arguments);
}
/// Create an invocation of the local [function] where argument structure is
- /// defined by [selector] and the argument values are defined by [arguments].
+ /// defined by [callStructure] and the argument values are defined by
+ /// [arguments].
ir.Primitive buildLocalFunctionInvocation(
LocalFunctionElement function,
- Selector selector,
+ CallStructure callStructure,
List<ir.Primitive> arguments) {
// TODO(johnniwinther): Maybe this should have its own ir node.
return buildCallInvocation(
- buildLocalFunctionGet(function), selector, arguments);
+ buildLocalFunctionGet(function), callStructure, arguments);
}
/// Create a static invocation of [function] where argument structure is
- /// defined by [selector] and the argument values are defined by [arguments].
+ /// defined by [callStructure] and the argument values are defined by
+ /// [arguments].
ir.Primitive buildStaticFunctionInvocation(
MethodElement function,
- Selector selector,
+ CallStructure callStructure,
List<ir.Primitive> arguments,
{SourceInformation sourceInformation}) {
- return _buildInvokeStatic(function, selector, arguments, sourceInformation);
+ Selector selector =
+ new Selector(SelectorKind.CALL, function.memberName, callStructure);
+ return _buildInvokeStatic(
+ function, selector, arguments, sourceInformation);
}
/// Create a call invocation of the value of the static [field] where argument
- /// structure is defined by [selector] and the argument values are defined by
- /// [arguments].
+ /// structure is defined by [callStructure] and the argument values are
+ /// defined by [arguments].
ir.Primitive buildStaticFieldInvocation(
FieldElement field,
- Selector selector,
+ CallStructure callStructure,
List<ir.Primitive> arguments,
{SourceInformation sourceInformation}) {
// TODO(johnniwinther): Maybe this should have its own node.
return buildCallInvocation(
buildStaticFieldGet(field),
- selector,
+ callStructure,
arguments,
sourceInformation: sourceInformation);
}
/// Create a call invocation of the result of calling the static [getter]
- /// where argument structure is defined by [selector] and the argument values
- /// are defined by [arguments].
+ /// where argument structure is defined by [callStructure] and the argument
+ /// values are defined by [arguments].
ir.Primitive buildStaticGetterInvocation(
MethodElement getter,
- Selector selector,
+ CallStructure callStructure,
List<ir.Primitive> arguments,
{SourceInformation sourceInformation}) {
// TODO(johnniwinther): Maybe this should have its own node.
return buildCallInvocation(
buildStaticGetterGet(getter),
- selector,
+ callStructure,
arguments,
sourceInformation: sourceInformation);
}
@@ -1139,14 +1147,14 @@ abstract class IrBuilder {
Selector selector,
List<ir.Primitive> arguments) {
// TODO(johnniwinther): This should have its own ir node.
- return _buildInvokeStatic( element, selector, arguments, null);
+ return _buildInvokeStatic(element, selector, arguments, null);
}
/// Create a constructor invocation of [element] on [type] where the
- /// constructor name and argument structure are defined by [selector] and the
- /// argument values are defined by [arguments].
+ /// constructor name and argument structure are defined by [callStructure] and
+ /// the argument values are defined by [arguments].
ir.Primitive buildConstructorInvocation(FunctionElement element,
- Selector selector,
+ CallStructure callStructure,
DartType type,
List<ir.Primitive> arguments);
@@ -1158,13 +1166,13 @@ abstract class IrBuilder {
}
/// Create an invocation of the `call` method of [functionExpression], where
- /// the named arguments are given by [selector].
+ /// the structure of arguments are given by [callStructure].
ir.Primitive buildCallInvocation(
ir.Primitive functionExpression,
- Selector selector,
+ CallStructure callStructure,
List<ir.Definition> arguments,
{SourceInformation sourceInformation}) {
- return _buildInvokeCall(functionExpression, selector, arguments,
+ return _buildInvokeCall(functionExpression, callStructure, arguments,
sourceInformation: sourceInformation);
}
@@ -2265,11 +2273,13 @@ class DartIrBuilder extends IrBuilder {
}
@override
- ir.Primitive buildConstructorInvocation(FunctionElement element,
- Selector selector,
+ ir.Primitive buildConstructorInvocation(ConstructorElement element,
+ CallStructure callStructure,
DartType type,
List<ir.Primitive> arguments) {
assert(isOpen);
+ Selector selector =
+ new Selector(SelectorKind.CALL, element.memberName, callStructure);
return _continueWithExpression(
(k) => new ir.InvokeConstructor(type, element, selector, k,
arguments));
@@ -2548,11 +2558,12 @@ class JsIrBuilder extends IrBuilder {
@override
ir.Primitive buildConstructorInvocation(ConstructorElement element,
- Selector selector,
+ CallStructure callStructure,
DartType type,
List<ir.Primitive> arguments) {
assert(isOpen);
-
+ Selector selector =
+ new Selector(SelectorKind.CALL, element.memberName, callStructure);
ClassElement cls = element.enclosingClass;
if (program.requiresRuntimeTypesFor(cls)) {
InterfaceType interface = type;

Powered by Google App Engine
This is Rietveld 408576698