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

Side by Side Diff: pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart

Issue 1285173002: dart2js cps: Rewrite more List operations into JS array operations. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: receiverIsNotNull -> optional param Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library tree_ir_builder; 5 library tree_ir_builder;
6 6
7 import '../diagnostics/invariant.dart' show 7 import '../diagnostics/invariant.dart' show
8 InternalErrorFunction; 8 InternalErrorFunction;
9 import '../diagnostics/spannable.dart' show 9 import '../diagnostics/spannable.dart' show
10 CURRENT_ELEMENT_SPANNABLE; 10 CURRENT_ELEMENT_SPANNABLE;
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 } 633 }
634 634
635 Expression visitApplyBuiltinOperator(cps_ir.ApplyBuiltinOperator node) { 635 Expression visitApplyBuiltinOperator(cps_ir.ApplyBuiltinOperator node) {
636 if (node.operator == BuiltinOperator.IsFalsy) { 636 if (node.operator == BuiltinOperator.IsFalsy) {
637 return new Not(getVariableUse(node.arguments.single)); 637 return new Not(getVariableUse(node.arguments.single));
638 } 638 }
639 return new ApplyBuiltinOperator(node.operator, 639 return new ApplyBuiltinOperator(node.operator,
640 translateArguments(node.arguments)); 640 translateArguments(node.arguments));
641 } 641 }
642 642
643 Expression visitApplyBuiltinMethod(cps_ir.ApplyBuiltinMethod node) {
644 return new ApplyBuiltinMethod(node.method,
645 getVariableUse(node.receiver),
646 translateArguments(node.arguments),
647 receiverIsNotNull: node.receiverIsNotNull);
648 }
649
643 Expression visitGetLength(cps_ir.GetLength node) { 650 Expression visitGetLength(cps_ir.GetLength node) {
644 return new GetLength(getVariableUse(node.object)); 651 return new GetLength(getVariableUse(node.object));
645 } 652 }
646 653
647 Expression visitGetIndex(cps_ir.GetIndex node) { 654 Expression visitGetIndex(cps_ir.GetIndex node) {
648 return new GetIndex(getVariableUse(node.object), 655 return new GetIndex(getVariableUse(node.object),
649 getVariableUse(node.index)); 656 getVariableUse(node.index));
650 } 657 }
651 658
652 Expression visitSetIndex(cps_ir.SetIndex node) { 659 Expression visitSetIndex(cps_ir.SetIndex node) {
(...skipping 16 matching lines...) Expand all
669 676
670 visitFunctionDefinition(cps_ir.FunctionDefinition node) { 677 visitFunctionDefinition(cps_ir.FunctionDefinition node) {
671 unexpectedNode(node); 678 unexpectedNode(node);
672 } 679 }
673 visitParameter(cps_ir.Parameter node) => unexpectedNode(node); 680 visitParameter(cps_ir.Parameter node) => unexpectedNode(node);
674 visitContinuation(cps_ir.Continuation node) => unexpectedNode(node); 681 visitContinuation(cps_ir.Continuation node) => unexpectedNode(node);
675 visitMutableVariable(cps_ir.MutableVariable node) => unexpectedNode(node); 682 visitMutableVariable(cps_ir.MutableVariable node) => unexpectedNode(node);
676 visitIsTrue(cps_ir.IsTrue node) => unexpectedNode(node); 683 visitIsTrue(cps_ir.IsTrue node) => unexpectedNode(node);
677 } 684 }
678 685
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698