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

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

Issue 1616143003: Lower map literals to constructor or function calls in builder (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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_nodes.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
index 13dad911db2459e24afe96d032ac86ef93dcc0f4..f93296217e9243de5df268bd0a6caa9f25d4332e 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
@@ -1596,35 +1596,6 @@ class LiteralList extends Primitive {
}
}
-class LiteralMapEntry {
- final Reference<Primitive> key;
- final Reference<Primitive> value;
-
- LiteralMapEntry(Primitive key, Primitive value)
- : this.key = new Reference<Primitive>(key),
- this.value = new Reference<Primitive>(value);
-}
-
-class LiteralMap extends Primitive {
- final InterfaceType dartType;
- final List<LiteralMapEntry> entries;
-
- LiteralMap(this.dartType, this.entries);
-
- accept(Visitor visitor) => visitor.visitLiteralMap(this);
-
- bool get hasValue => true;
- bool get isSafeForElimination => true;
- bool get isSafeForReordering => true;
-
- void setParentPointers() {
- for (LiteralMapEntry entry in entries) {
- entry.key.parent = this;
- entry.value.parent = this;
- }
- }
-}
-
class Parameter extends Primitive {
Parameter(Entity hint) {
super.hint = hint;
@@ -1965,7 +1936,6 @@ abstract class Visitor<T> implements BlockVisitor<T> {
T visitAwait(Await node);
T visitYield(Yield node);
T visitLiteralList(LiteralList node);
- T visitLiteralMap(LiteralMap node);
T visitConstant(Constant node);
T visitGetMutable(GetMutable node);
T visitParameter(Parameter node);
@@ -2146,15 +2116,6 @@ class DeepRecursiveVisitor implements Visitor {
node.values.forEach(processReference);
}
- processLiteralMap(LiteralMap node) {}
- visitLiteralMap(LiteralMap node) {
- processLiteralMap(node);
- for (LiteralMapEntry entry in node.entries) {
- processReference(entry.key);
- processReference(entry.value);
- }
- }
-
processConstant(Constant node) {}
visitConstant(Constant node) {
processConstant(node);
@@ -2572,13 +2533,6 @@ class DefinitionCopyingVisitor extends Visitor<Definition> {
..allocationSiteType = node.allocationSiteType;
}
- Definition visitLiteralMap(LiteralMap node) {
- List<LiteralMapEntry> entries = node.entries.map((LiteralMapEntry entry) {
- return new LiteralMapEntry(getCopy(entry.key), getCopy(entry.value));
- }).toList();
- return new LiteralMap(node.dartType, entries);
- }
-
Definition visitConstant(Constant node) {
return new Constant(node.value, sourceInformation: node.sourceInformation);
}
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698