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

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

Issue 1182913003: Split TypedSelector into Selector and TypeMask. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 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
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c92471617d0b4cb2bf3e551e5baa3f1d08a71e5e..155831b43420f501edc578f5d8746e372e781438 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
@@ -13,6 +13,7 @@ import '../dart2jslib.dart';
import '../elements/elements.dart';
import '../io/source_information.dart';
import '../tree/tree.dart' as ast;
+import '../types/types.dart' show TypeMask;
import '../closure.dart' hide ClosureScope;
import '../universe/universe.dart' show SelectorKind;
import 'cps_ir_nodes.dart' as ir;
@@ -653,20 +654,22 @@ abstract class IrBuilder {
ir.Primitive _buildInvokeDynamic(ir.Primitive receiver,
Selector selector,
+ TypeMask mask,
List<ir.Primitive> arguments,
{SourceInformation sourceInformation}) {
assert(isOpen);
return _continueWithExpression(
- (k) => new ir.InvokeMethod(receiver, selector, arguments, k,
+ (k) => new ir.InvokeMethod(receiver, selector, mask, arguments, k,
sourceInformation: sourceInformation));
}
ir.Primitive _buildInvokeCall(ir.Primitive target,
CallStructure callStructure,
+ TypeMask mask,
List<ir.Definition> arguments,
{SourceInformation sourceInformation}) {
Selector selector = callStructure.callSelector;
- return _buildInvokeDynamic(target, selector, arguments,
+ return _buildInvokeDynamic(target, selector, mask, arguments,
sourceInformation: sourceInformation);
}
@@ -921,8 +924,9 @@ abstract class IrBuilder {
/// defined by [arguments].
ir.Primitive buildDynamicInvocation(ir.Primitive receiver,
Selector selector,
+ TypeMask mask,
List<ir.Primitive> arguments) {
- return _buildInvokeDynamic(receiver, selector, arguments);
+ return _buildInvokeDynamic(receiver, selector, mask, arguments);
}
/// Create an if-null expression. This is equivalent to a conditional
@@ -940,28 +944,33 @@ abstract class IrBuilder {
/// Create a dynamic getter invocation on [receiver] where the getter name is
/// defined by [selector].
- ir.Primitive buildDynamicGet(ir.Primitive receiver, Selector selector) {
+ ir.Primitive buildDynamicGet(ir.Primitive receiver,
+ Selector selector,
+ TypeMask mask) {
assert(selector.isGetter);
- return _buildInvokeDynamic(receiver, selector, const <ir.Primitive>[]);
+ return _buildInvokeDynamic(
+ receiver, selector, mask, const <ir.Primitive>[]);
}
/// Create a dynamic setter invocation on [receiver] where the setter name and
/// argument are defined by [selector] and [value], respectively.
ir.Primitive buildDynamicSet(ir.Primitive receiver,
Selector selector,
+ TypeMask mask,
ir.Primitive value) {
assert(selector.isSetter);
- _buildInvokeDynamic(receiver, selector, <ir.Primitive>[value]);
+ _buildInvokeDynamic(receiver, selector, mask, <ir.Primitive>[value]);
return value;
}
/// Create a dynamic index set invocation on [receiver] with the provided
/// [index] and [value].
ir.Primitive buildDynamicIndexSet(ir.Primitive receiver,
+ TypeMask mask,
ir.Primitive index,
ir.Primitive value) {
_buildInvokeDynamic(
- receiver, new Selector.indexSet(), <ir.Primitive>[index, value]);
+ receiver, new Selector.indexSet(), mask, <ir.Primitive>[index, value]);
return value;
}
@@ -1095,12 +1104,13 @@ abstract class IrBuilder {
/// Create an invocation of the `call` method of [functionExpression], where
/// the structure of arguments are given by [callStructure].
+ // TODO(johnniwinther): This should take a [TypeMask].
ir.Primitive buildCallInvocation(
ir.Primitive functionExpression,
CallStructure callStructure,
List<ir.Definition> arguments,
{SourceInformation sourceInformation}) {
- return _buildInvokeCall(functionExpression, callStructure, arguments,
+ return _buildInvokeCall(functionExpression, callStructure, null, arguments,
sourceInformation: sourceInformation);
}
@@ -1351,6 +1361,10 @@ abstract class IrBuilder {
SubbuildFunction buildVariableDeclaration,
Element variableElement,
Selector variableSelector,
+ TypeMask variableMask,
+ TypeMask currentMask,
+ TypeMask iteratorMask,
+ TypeMask moveNextMask,
SubbuildFunction buildBody,
JumpTarget target,
ClosureScope closureScope}) {
@@ -1378,6 +1392,7 @@ abstract class IrBuilder {
add(new ir.LetCont(iteratorInvoked,
new ir.InvokeMethod(expressionReceiver,
new Selector.getter("iterator", null),
+ iteratorMask,
emptyArguments,
iteratorInvoked)));
@@ -1394,6 +1409,7 @@ abstract class IrBuilder {
add(new ir.LetCont(moveNextInvoked,
new ir.InvokeMethod(iterator,
new Selector.call("moveNext", null, 0),
+ moveNextMask,
emptyArguments,
moveNextInvoked)));
@@ -1413,7 +1429,10 @@ abstract class IrBuilder {
ir.Parameter currentValue = new ir.Parameter(null);
ir.Continuation currentInvoked = new ir.Continuation([currentValue]);
bodyBuilder.add(new ir.LetCont(currentInvoked,
- new ir.InvokeMethod(iterator, new Selector.getter("current", null),
+ new ir.InvokeMethod(
+ iterator,
+ new Selector.getter("current", null),
+ currentMask,
emptyArguments, currentInvoked)));
// TODO(sra): Does this cover all cases? The general setter case include
// super.
@@ -1433,7 +1452,8 @@ abstract class IrBuilder {
} else {
ir.Primitive receiver = bodyBuilder.buildThis();
assert(receiver != null);
- bodyBuilder.buildDynamicSet(receiver, variableSelector, currentValue);
+ bodyBuilder.buildDynamicSet(
+ receiver, variableSelector, variableMask, currentValue);
}
// Translate the body in the hole in the delimited term above, and add
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698