OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_STATE_VALUES_UTILS_H_ | 5 #ifndef V8_COMPILER_STATE_VALUES_UTILS_H_ |
6 #define V8_COMPILER_STATE_VALUES_UTILS_H_ | 6 #define V8_COMPILER_STATE_VALUES_UTILS_H_ |
7 | 7 |
8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
| 9 #include "src/globals.h" |
9 | 10 |
10 namespace v8 { | 11 namespace v8 { |
11 namespace internal { | 12 namespace internal { |
12 | 13 |
13 namespace compiler { | 14 namespace compiler { |
14 | 15 |
15 class Graph; | 16 class Graph; |
16 | 17 |
17 class StateValuesCache { | 18 class V8_EXPORT_PRIVATE StateValuesCache { |
18 public: | 19 public: |
19 explicit StateValuesCache(JSGraph* js_graph); | 20 explicit StateValuesCache(JSGraph* js_graph); |
20 | 21 |
21 Node* GetNodeForValues(Node** values, size_t count); | 22 Node* GetNodeForValues(Node** values, size_t count); |
22 | 23 |
23 private: | 24 private: |
24 static const size_t kMaxInputCount = 8; | 25 static const size_t kMaxInputCount = 8; |
25 | 26 |
26 struct NodeKey { | 27 struct NodeKey { |
27 Node* node; | 28 Node* node; |
(...skipping 25 matching lines...) Expand all Loading... |
53 CommonOperatorBuilder* common() { return js_graph_->common(); } | 54 CommonOperatorBuilder* common() { return js_graph_->common(); } |
54 | 55 |
55 Zone* zone() { return graph()->zone(); } | 56 Zone* zone() { return graph()->zone(); } |
56 | 57 |
57 JSGraph* js_graph_; | 58 JSGraph* js_graph_; |
58 CustomMatcherZoneHashMap hash_map_; | 59 CustomMatcherZoneHashMap hash_map_; |
59 ZoneVector<NodeVector*> working_space_; // One working space per level. | 60 ZoneVector<NodeVector*> working_space_; // One working space per level. |
60 Node* empty_state_values_; | 61 Node* empty_state_values_; |
61 }; | 62 }; |
62 | 63 |
63 class StateValuesAccess { | 64 class V8_EXPORT_PRIVATE StateValuesAccess { |
64 public: | 65 public: |
65 struct TypedNode { | 66 struct TypedNode { |
66 Node* node; | 67 Node* node; |
67 MachineType type; | 68 MachineType type; |
68 TypedNode(Node* node, MachineType type) : node(node), type(type) {} | 69 TypedNode(Node* node, MachineType type) : node(node), type(type) {} |
69 }; | 70 }; |
70 | 71 |
71 class iterator { | 72 class V8_EXPORT_PRIVATE iterator { |
72 public: | 73 public: |
73 // Bare minimum of operators needed for range iteration. | 74 // Bare minimum of operators needed for range iteration. |
74 bool operator!=(iterator& other); | 75 bool operator!=(iterator& other); |
75 iterator& operator++(); | 76 iterator& operator++(); |
76 TypedNode operator*(); | 77 TypedNode operator*(); |
77 | 78 |
78 private: | 79 private: |
79 friend class StateValuesAccess; | 80 friend class StateValuesAccess; |
80 | 81 |
81 iterator() : current_depth_(-1) {} | 82 iterator() : current_depth_(-1) {} |
(...skipping 29 matching lines...) Expand all Loading... |
111 | 112 |
112 private: | 113 private: |
113 Node* node_; | 114 Node* node_; |
114 }; | 115 }; |
115 | 116 |
116 } // namespace compiler | 117 } // namespace compiler |
117 } // namespace internal | 118 } // namespace internal |
118 } // namespace v8 | 119 } // namespace v8 |
119 | 120 |
120 #endif // V8_COMPILER_STATE_VALUES_UTILS_H_ | 121 #endif // V8_COMPILER_STATE_VALUES_UTILS_H_ |
OLD | NEW |