| 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 #ifndef V8_COMPILER_GRAPH_H_ | 5 #ifndef V8_COMPILER_GRAPH_H_ |
| 6 #define V8_COMPILER_GRAPH_H_ | 6 #define V8_COMPILER_GRAPH_H_ |
| 7 | 7 |
| 8 #include "src/base/compiler-specific.h" |
| 9 #include "src/globals.h" |
| 8 #include "src/zone/zone-containers.h" | 10 #include "src/zone/zone-containers.h" |
| 9 #include "src/zone/zone.h" | 11 #include "src/zone/zone.h" |
| 10 | 12 |
| 11 namespace v8 { | 13 namespace v8 { |
| 12 namespace internal { | 14 namespace internal { |
| 13 namespace compiler { | 15 namespace compiler { |
| 14 | 16 |
| 15 // Forward declarations. | 17 // Forward declarations. |
| 16 class GraphDecorator; | 18 class GraphDecorator; |
| 17 class Node; | 19 class Node; |
| 18 class Operator; | 20 class Operator; |
| 19 | 21 |
| 20 | 22 |
| 21 // Marks are used during traversal of the graph to distinguish states of nodes. | 23 // Marks are used during traversal of the graph to distinguish states of nodes. |
| 22 // Each node has a mark which is a monotonically increasing integer, and a | 24 // Each node has a mark which is a monotonically increasing integer, and a |
| 23 // {NodeMarker} has a range of values that indicate states of a node. | 25 // {NodeMarker} has a range of values that indicate states of a node. |
| 24 typedef uint32_t Mark; | 26 typedef uint32_t Mark; |
| 25 | 27 |
| 26 | 28 |
| 27 // NodeIds are identifying numbers for nodes that can be used to index auxiliary | 29 // NodeIds are identifying numbers for nodes that can be used to index auxiliary |
| 28 // out-of-line data associated with each node. | 30 // out-of-line data associated with each node. |
| 29 typedef uint32_t NodeId; | 31 typedef uint32_t NodeId; |
| 30 | 32 |
| 31 class Graph final : public ZoneObject { | 33 class V8_EXPORT_PRIVATE Graph final : public NON_EXPORTED_BASE(ZoneObject) { |
| 32 public: | 34 public: |
| 33 explicit Graph(Zone* zone); | 35 explicit Graph(Zone* zone); |
| 34 | 36 |
| 35 // Scope used when creating a subgraph for inlining. Automatically preserves | 37 // Scope used when creating a subgraph for inlining. Automatically preserves |
| 36 // the original start and end nodes of the graph, and resets them when you | 38 // the original start and end nodes of the graph, and resets them when you |
| 37 // leave the scope. | 39 // leave the scope. |
| 38 class SubgraphScope final { | 40 class SubgraphScope final { |
| 39 public: | 41 public: |
| 40 explicit SubgraphScope(Graph* graph) | 42 explicit SubgraphScope(Graph* graph) |
| 41 : graph_(graph), start_(graph->start()), end_(graph->end()) {} | 43 : graph_(graph), start_(graph->start()), end_(graph->end()) {} |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 public: | 143 public: |
| 142 virtual ~GraphDecorator() {} | 144 virtual ~GraphDecorator() {} |
| 143 virtual void Decorate(Node* node) = 0; | 145 virtual void Decorate(Node* node) = 0; |
| 144 }; | 146 }; |
| 145 | 147 |
| 146 } // namespace compiler | 148 } // namespace compiler |
| 147 } // namespace internal | 149 } // namespace internal |
| 148 } // namespace v8 | 150 } // namespace v8 |
| 149 | 151 |
| 150 #endif // V8_COMPILER_GRAPH_H_ | 152 #endif // V8_COMPILER_GRAPH_H_ |
| OLD | NEW |