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

Unified Diff: pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart

Issue 1155463005: dart2js cps: Remove dart2dart from cps pipeline and clean up. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Skip tests specific to the dart backend Created 5 years, 7 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/tree_ir/tree_ir_nodes.dart ('k') | pkg/compiler/lib/src/use_unused_api.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart
diff --git a/pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart b/pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart
index e9e8865ed41026d46fe3c87b5c7505a5a4efe404..acf3133eeb484e4f7d3d76b745543ef7992a788f 100644
--- a/pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart
@@ -61,11 +61,9 @@ class BlockCollector extends StatementVisitor {
blocks.add(block);
}
- void collect(RootNode node) {
- node.forEachBody((Statement body) {
- _addBlock(new Block()..isEntryPoint = true);
- visitStatement(body);
- });
+ void collect(FunctionDefinition node) {
+ _addBlock(new Block()..isEntryPoint = true);
+ visitStatement(node.body);
}
visitLabeledStatement(LabeledStatement node) {
@@ -170,16 +168,6 @@ class BlockCollector extends StatementVisitor {
_addStatement(node);
visitStatement(node.next);
}
-
- visitFunctionDeclaration(FunctionDeclaration node) {
- _addStatement(node);
- visitStatement(node.next);
- }
-
- visitVariableDeclaration(VariableDeclaration node) {
- _addStatement(node);
- visitStatement(node.next);
- }
}
class TreeTracer extends TracerUtil with StatementVisitor {
@@ -194,25 +182,18 @@ class TreeTracer extends TracerUtil with StatementVisitor {
BlockCollector collector;
int statementCounter;
- void traceGraph(String name, RootNode node) {
- if (node.isEmpty) return;
+ void traceGraph(String name, FunctionDefinition node) {
parameters = node.parameters;
tag("cfg", () {
printProperty("name", name);
- printRootNode(node);
+ names = new Names();
+ statementCounter = 0;
+ collector = new BlockCollector();
+ collector.collect(node);
collector.blocks.forEach(printBlock);
});
}
- void printRootNode(RootNode node) {
- collector = new BlockCollector();
- names = new Names();
- statementCounter = 0;
- collector = new BlockCollector();
- collector.collect(node);
- collector.blocks.forEach(printBlock);
- }
-
void printBlock(Block block) {
tag("block", () {
printProperty("name", block.name);
@@ -319,16 +300,6 @@ class TreeTracer extends TracerUtil with StatementVisitor {
printStatement(null, expr(node.expression));
}
- visitFunctionDeclaration(FunctionDeclaration node) {
- printStatement(null, 'function ${node.definition.element.name}');
- }
-
- visitVariableDeclaration(VariableDeclaration node) {
- String variable = names.varName(node.variable);
- String value = expr(node.value);
- printStatement(null, 'declare $variable = $value');
- }
-
visitSetField(SetField node) {
String object = expr(node.object);
String field = node.field.name;
@@ -425,10 +396,6 @@ class SubexpressionVisitor extends ExpressionVisitor<String> {
return "this";
}
- String visitReifyTypeVar(ReifyTypeVar node) {
- return "typevar [${node.typeVariable.name}]";
- }
-
static bool usesInfixNotation(Expression node) {
return node is Conditional ||
node is LogicalOperator ||
@@ -473,14 +440,6 @@ class SubexpressionVisitor extends ExpressionVisitor<String> {
return "function ${node.definition.element.name}";
}
- String visitFieldInitializer(FieldInitializer node) {
- throw "$node should not be visited by $this";
- }
-
- String visitSuperInitializer(SuperInitializer node) {
- throw "$node should not be visited by $this";
- }
-
String visitGetField(GetField node) {
String object = visitExpression(node.object);
String field = node.field.name;
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart ('k') | pkg/compiler/lib/src/use_unused_api.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698