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

Unified Diff: sdk/lib/_internal/compiler/implementation/dart_backend/tree_tracer.dart

Issue 348053002: dart2dart: Support for all constants in new backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Formatting stuff Created 6 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
Index: sdk/lib/_internal/compiler/implementation/dart_backend/tree_tracer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/tree_tracer.dart b/sdk/lib/_internal/compiler/implementation/dart_backend/tree_tracer.dart
index 6bd8ff4522b289f42248763b2339204b3c93569b..07886f8be2cb7b1734bef58d416c06513d792099 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_backend/tree_tracer.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_backend/tree_tracer.dart
@@ -61,7 +61,6 @@ class BlockCollector extends Visitor {
visitConcatenateStrings(ConcatenateStrings node) {}
visitLiteralList(LiteralList node) {}
visitLiteralMap(LiteralMap node) {}
- visitInvokeConstConstructor(InvokeConstConstructor node) {}
visitConstant(Constant node) {}
visitConditional(Conditional node) {}
visitLogicalOperator(LogicalOperator node) {}
@@ -312,7 +311,8 @@ class SubexpressionVisitor extends ExpressionVisitor<String> {
callName = '${node.type}.${node.target.name}';
}
String args = formatArguments(node);
- return "new $callName($args)";
+ String keyword = node.constant != null ? 'const' : 'new';
+ return "$keyword $callName($args)";
}
String visitConcatenateStrings(ConcatenateStrings node) {
@@ -335,17 +335,6 @@ class SubexpressionVisitor extends ExpressionVisitor<String> {
return "map [${entries.join(', ')}]";
}
- String visitInvokeConstConstructor(InvokeConstConstructor node) {
- String callName;
- if (node.target.name.isEmpty) {
- callName = '${node.type}';
- } else {
- callName = '${node.type}.${node.target.name}';
- }
- String arguments = node.arguments.map(visitExpression).join(', ');
- return "const $callName($arguments)";
- }
-
String visitConstant(Constant node) {
return "${node.value}";
}

Powered by Google App Engine
This is Rietveld 408576698