| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #include "graph-tester.h" | 9 #include "graph-tester.h" |
| 10 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
| 11 #include "src/compiler/generic-node.h" | 11 #include "src/compiler/generic-node.h" |
| 12 #include "src/compiler/generic-node-inl.h" | 12 #include "src/compiler/generic-node-inl.h" |
| 13 #include "src/compiler/graph.h" | 13 #include "src/compiler/graph.h" |
| 14 #include "src/compiler/graph-inl.h" | 14 #include "src/compiler/graph-inl.h" |
| 15 #include "src/compiler/graph-visualizer.h" | 15 #include "src/compiler/graph-visualizer.h" |
| 16 #include "src/compiler/operator.h" | 16 #include "src/compiler/operator.h" |
| 17 | 17 |
| 18 using namespace v8::internal; | 18 using namespace v8::internal; |
| 19 using namespace v8::internal::compiler; | 19 using namespace v8::internal::compiler; |
| 20 | 20 |
| 21 static SimpleOperator dummy_operator(IrOpcode::kParameter, Operator::kNoWrite, | 21 static Operator dummy_operator(IrOpcode::kParameter, Operator::kNoWrite, |
| 22 0, 0, "dummy"); | 22 "dummy", 0, 0, 0, 1, 0, 0); |
| 23 | 23 |
| 24 class PreNodeVisitor : public NullNodeVisitor { | 24 class PreNodeVisitor : public NullNodeVisitor { |
| 25 public: | 25 public: |
| 26 GenericGraphVisit::Control Pre(Node* node) { | 26 GenericGraphVisit::Control Pre(Node* node) { |
| 27 printf("NODE ID: %d\n", node->id()); | 27 printf("NODE ID: %d\n", node->id()); |
| 28 nodes_.push_back(node); | 28 nodes_.push_back(node); |
| 29 return GenericGraphVisit::CONTINUE; | 29 return GenericGraphVisit::CONTINUE; |
| 30 } | 30 } |
| 31 std::vector<Node*> nodes_; | 31 std::vector<Node*> nodes_; |
| 32 }; | 32 }; |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 Node* n9 = graph.NewNode(&dummy_operator, n5); | 321 Node* n9 = graph.NewNode(&dummy_operator, n5); |
| 322 Node* n10 = graph.NewNode(&dummy_operator, n9); | 322 Node* n10 = graph.NewNode(&dummy_operator, n9); |
| 323 Node* n11 = graph.NewNode(&dummy_operator, n9); | 323 Node* n11 = graph.NewNode(&dummy_operator, n9); |
| 324 Node* end_dependencies[6] = {n4, n8, n10, n11, n6, n7}; | 324 Node* end_dependencies[6] = {n4, n8, n10, n11, n6, n7}; |
| 325 Node* n12 = graph.NewNode(&dummy_operator, 6, end_dependencies); | 325 Node* n12 = graph.NewNode(&dummy_operator, 6, end_dependencies); |
| 326 graph.SetEnd(n12); | 326 graph.SetEnd(n12); |
| 327 | 327 |
| 328 OFStream os(stdout); | 328 OFStream os(stdout); |
| 329 os << AsDOT(graph); | 329 os << AsDOT(graph); |
| 330 } | 330 } |
| OLD | NEW |