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

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

Issue 1175973005: dart2js cps: Introduce some built-in operators in type propagation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Status files 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/cps_ir/builtin_operator.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_nodes.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 b7d0985b251e59240065c02a389c84c77ab9699c..395f45594ba95731a008995de43a63319e9d7615 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
@@ -762,10 +762,13 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
return irBuilder.buildNegation(check);
}
- ir.Primitive translateBinary(ast.Node left,
+ ir.Primitive translateBinary(ast.Send node,
+ ast.Node left,
op.BinaryOperator operator,
ast.Node right) {
- Selector selector = new Selector.binaryOperator(operator.selectorName);
+ Selector selector = useSelectorTypeOfNode(
+ new Selector.binaryOperator(operator.selectorName),
+ node);
ir.Primitive receiver = visit(left);
List<ir.Primitive> arguments = <ir.Primitive>[visit(right)];
arguments = normalizeDynamicArguments(selector.callStructure, arguments);
@@ -777,14 +780,14 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
ast.Node left,
op.BinaryOperator operator,
ast.Node right, _) {
- return translateBinary(left, operator, right);
+ return translateBinary(node, left, operator, right);
}
@override
ir.Primitive visitIndex(ast.Send node,
ast.Node receiver,
ast.Node index, _) {
- Selector selector = new Selector.index();
+ Selector selector = useSelectorTypeOfNode(new Selector.index(), node);
ir.Primitive target = visit(receiver);
List<ir.Primitive> arguments = <ir.Primitive>[visit(index)];
arguments = normalizeDynamicArguments(selector.callStructure, arguments);
@@ -826,7 +829,7 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
ast.Node left,
ast.Node right,
_) {
- return translateBinary(left, op.BinaryOperator.EQ, right);
+ return translateBinary(node, left, op.BinaryOperator.EQ, right);
}
@override
@@ -853,7 +856,7 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
ast.Node right,
_) {
return irBuilder.buildNegation(
- translateBinary(left, op.BinaryOperator.NOT_EQ, right));
+ translateBinary(node, left, op.BinaryOperator.NOT_EQ, right));
}
@override
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/builtin_operator.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698