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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_integrity.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/cps_ir/cps_ir_builder_task.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_integrity.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart
index e7a7d14284d2dbcf6d1829ace3bfaafa4c9c2085..0d7c066ce0b6a7dec44d17c2310d8ab34d15cff4 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart
@@ -26,7 +26,7 @@ const bool ENABLE_DUMP = tracer.TRACE_FILTER_PATTERN != null;
///
class CheckCpsIntegrity extends RecursiveVisitor {
- RootNode topLevelNode;
+ FunctionDefinition topLevelNode;
Set<Definition> seenDefinitions = new Set<Definition>();
Map<Definition, Set<Reference>> seenReferences =
@@ -78,15 +78,6 @@ class CheckCpsIntegrity extends RecursiveVisitor {
}
@override
- visitBody(Body node) {
- markAsSeen(node.returnContinuation);
- if (!node.returnContinuation.isReturnContinuation) {
- error('Return continuation with a body', node);
- }
- doInScope([node.returnContinuation], node, () => visit(node.body));
- }
-
- @override
visitLetPrim(LetPrim node) {
markAsSeen(node.primitive);
visit(node.primitive);
@@ -106,24 +97,14 @@ class CheckCpsIntegrity extends RecursiveVisitor {
markAsSeen(node.thisParameter);
}
node.parameters.forEach(markAsSeen);
- if (node.body != null) {
- doInOptionalScope(node.thisParameter, node,
- () => doInScope(node.parameters, node, () => visit(node.body)));
- }
- }
-
- @override
- visitConstructorDefinition(ConstructorDefinition node) {
- if (node.thisParameter != null) {
- markAsSeen(node.thisParameter);
+ markAsSeen(node.returnContinuation);
+ if (!node.returnContinuation.isReturnContinuation) {
+ error('Return continuation with a body', node);
}
- node.parameters.forEach(markAsSeen);
- doInScope(node.parameters, node, () {
- if (node.initializers != null) node.initializers.forEach(visit);
- if (node.body != null) {
- doInOptionalScope(node.thisParameter, node, () => visit(node.body));
- }
- });
+ doInOptionalScope(node.thisParameter, node,
+ () => doInScope(node.parameters, node,
+ () => doInScope([node.returnContinuation], node,
+ () => visit(node.body))));
}
doInOptionalScope(Parameter parameter, Node node, action) {
@@ -133,15 +114,6 @@ class CheckCpsIntegrity extends RecursiveVisitor {
}
@override
- visitDeclareFunction(DeclareFunction node) {
- markAsSeen(node.variable);
- doInScope([node.variable], node, () {
- visit(node.definition);
- visit(node.body);
- });
- }
-
- @override
processReference(Reference reference) {
if (!bindings.containsKey(reference.definition)) {
error('Referenced out of scope: ${reference.definition}', reference);
@@ -209,7 +181,7 @@ class CheckCpsIntegrity extends RecursiveVisitor {
'$sexpr\n';
}
- void check(RootNode node) {
+ void check(FunctionDefinition node) {
topLevelNode = node;
visit(node);
« 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.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698