| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 #include "vm/flow_graph_inliner.h" | 5 #include "vm/flow_graph_inliner.h" |
| 6 | 6 |
| 7 #include "vm/block_scheduler.h" | 7 #include "vm/block_scheduler.h" |
| 8 #include "vm/compiler.h" | 8 #include "vm/compiler.h" |
| 9 #include "vm/flags.h" | 9 #include "vm/flags.h" |
| 10 #include "vm/flow_graph.h" | 10 #include "vm/flow_graph.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 | 71 |
| 72 // TODO(zerny): Remove the ChildrenVisitor and SourceLabelResetter once we have | 72 // TODO(zerny): Remove the ChildrenVisitor and SourceLabelResetter once we have |
| 73 // moved the label/join map for control flow out of the AST and into the flow | 73 // moved the label/join map for control flow out of the AST and into the flow |
| 74 // graph builder. | 74 // graph builder. |
| 75 | 75 |
| 76 // Default visitor to traverse child nodes. | 76 // Default visitor to traverse child nodes. |
| 77 class ChildrenVisitor : public AstNodeVisitor { | 77 class ChildrenVisitor : public AstNodeVisitor { |
| 78 public: | 78 public: |
| 79 ChildrenVisitor() { } | 79 ChildrenVisitor() { } |
| 80 #define DEFINE_VISIT(type, name) \ | 80 #define DEFINE_VISIT(BaseName) \ |
| 81 virtual void Visit##type(type* node) { node->VisitChildren(this); } | 81 virtual void Visit##BaseName##Node(BaseName##Node* node) { \ |
| 82 NODE_LIST(DEFINE_VISIT); | 82 node->VisitChildren(this); \ |
| 83 } |
| 84 |
| 85 FOR_EACH_NODE(DEFINE_VISIT); |
| 83 #undef DEFINE_VISIT | 86 #undef DEFINE_VISIT |
| 84 }; | 87 }; |
| 85 | 88 |
| 86 | 89 |
| 87 // Visitor to clear each AST node containing source labels. | 90 // Visitor to clear each AST node containing source labels. |
| 88 class SourceLabelResetter : public ChildrenVisitor { | 91 class SourceLabelResetter : public ChildrenVisitor { |
| 89 public: | 92 public: |
| 90 SourceLabelResetter() { } | 93 SourceLabelResetter() { } |
| 91 virtual void VisitSequenceNode(SequenceNode* node) { | 94 virtual void VisitSequenceNode(SequenceNode* node) { |
| 92 Reset(node, node->label()); | 95 Reset(node, node->label()); |
| (...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1439 OS::Print("After Inlining of %s\n", flow_graph_-> | 1442 OS::Print("After Inlining of %s\n", flow_graph_-> |
| 1440 parsed_function().function().ToFullyQualifiedCString()); | 1443 parsed_function().function().ToFullyQualifiedCString()); |
| 1441 FlowGraphPrinter printer(*flow_graph_); | 1444 FlowGraphPrinter printer(*flow_graph_); |
| 1442 printer.PrintBlocks(); | 1445 printer.PrintBlocks(); |
| 1443 } | 1446 } |
| 1444 } | 1447 } |
| 1445 } | 1448 } |
| 1446 } | 1449 } |
| 1447 | 1450 |
| 1448 } // namespace dart | 1451 } // namespace dart |
| OLD | NEW |