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

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

Issue 1197673003: dart2js cps: Get typed selectors for compound operators. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase 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 | « no previous file | tests/compiler/dart2js/js_backend_cps_ir_closures_test.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_task.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
index 868126ddef5b24ec823ca2a03823f9b5b6fc231b..b2cd35a6cf324e01f1d8790eed3cef2942c40595 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
@@ -1169,7 +1169,8 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
ir.Primitive translateCompounds(
{ir.Primitive getValue(),
CompoundRhs rhs,
- void setValue(ir.Primitive value)}) {
+ void setValue(ir.Primitive value),
+ Selector operatorSelector}) {
ir.Primitive value = getValue();
op.BinaryOperator operator = rhs.operator;
if (operator.kind == op.BinaryOperatorKind.IF_NULL) {
@@ -1182,8 +1183,9 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
}));
}
- Selector operatorSelector =
- new Selector.binaryOperator(operator.selectorName);
+ if (operatorSelector == null) {
+ operatorSelector = new Selector.binaryOperator(operator.selectorName);
+ }
ir.Primitive rhsValue;
if (rhs.kind == CompoundKind.ASSIGNMENT) {
rhsValue = visit(rhs.rhs);
@@ -1289,7 +1291,8 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
return translateCompounds(
getValue: () => buildConstantExpression(constant),
rhs: rhs,
- setValue: (value) {}); // The binary operator will throw before this.
+ setValue: (value) {}, // The binary operator will throw before this.
+ operatorSelector: elements.getOperatorSelectorInComplexSendSet(node));
}
@override
@@ -1307,7 +1310,8 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
rhs: rhs,
setValue: (ir.Primitive result) {
irBuilder.buildDynamicSet(target, setterSelector, result);
- });
+ },
+ operatorSelector: elements.getOperatorSelectorInComplexSendSet(node));
}
return node.isConditional
? irBuilder.buildIfNotNullSend(target, nested(helper))
@@ -1341,7 +1345,8 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
} else {
return buildLocalNoSuchSetter(local, result);
}
- });
+ },
+ operatorSelector: elements.getOperatorSelectorInComplexSendSet(node));
}
ir.Primitive buildStaticNoSuchGetter(Element element) {
@@ -1391,7 +1396,8 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
return buildStaticNoSuchSetter(
setter != null ? setter : getter, result);
}
- });
+ },
+ operatorSelector: elements.getOperatorSelectorInComplexSendSet(node));
}
ir.Primitive buildSuperNoSuchGetter(Element element) {
@@ -1439,7 +1445,8 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
case CompoundSetter.INVALID:
return buildSuperNoSuchSetter(setter, result);
}
- });
+ },
+ operatorSelector: elements.getOperatorSelectorInComplexSendSet(node));
}
@override
@@ -1451,7 +1458,8 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
return translateCompounds(
getValue: () => irBuilder.buildReifyTypeVariable(typeVariable.type),
rhs: rhs,
- setValue: (value) {}); // The binary operator will throw before this.
+ setValue: (value) {}, // The binary operator will throw before this.
+ operatorSelector: elements.getOperatorSelectorInComplexSendSet(node));
}
@override
@@ -1474,7 +1482,8 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
rhs: rhs,
setValue: (ir.Primitive result) {
irBuilder.buildDynamicIndexSet(target, indexValue, result);
- });
+ },
+ operatorSelector: elements.getOperatorSelectorInComplexSendSet(node));
}
@override
@@ -1505,7 +1514,8 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
buildInstanceNoSuchMethod(
new Selector.indexSet(), <ir.Primitive>[indexValue, result]);
}
- });
+ },
+ operatorSelector: elements.getOperatorSelectorInComplexSendSet(node));
}
/// Evaluates a string interpolation and appends each part to [accumulator]
« no previous file with comments | « no previous file | tests/compiler/dart2js/js_backend_cps_ir_closures_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698