| 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 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 Zone* zone() { return graph()->zone(); } | 55 Zone* zone() { return graph()->zone(); } |
| 56 | 56 |
| 57 JSGraph* js_graph_; | 57 JSGraph* js_graph_; |
| 58 ZoneHashMap hash_map_; | 58 ZoneHashMap hash_map_; |
| 59 ZoneVector<NodeVector*> working_space_; // One working space per level. | 59 ZoneVector<NodeVector*> working_space_; // One working space per level. |
| 60 Node* empty_state_values_; | 60 Node* empty_state_values_; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 class StateValuesAccess { | 63 class StateValuesAccess { |
| 64 public: | 64 public: |
| 65 struct TypedNode { |
| 66 Node* node; |
| 67 MachineType type; |
| 68 TypedNode(Node* node, MachineType type) : node(node), type(type) {} |
| 69 }; |
| 70 |
| 65 class iterator { | 71 class iterator { |
| 66 public: | 72 public: |
| 67 // Bare minimum of operators needed for range iteration. | 73 // Bare minimum of operators needed for range iteration. |
| 68 bool operator!=(iterator& other); | 74 bool operator!=(iterator& other); |
| 69 iterator& operator++(); | 75 iterator& operator++(); |
| 70 Node* operator*(); | 76 TypedNode operator*(); |
| 71 | 77 |
| 72 private: | 78 private: |
| 73 friend class StateValuesAccess; | 79 friend class StateValuesAccess; |
| 74 | 80 |
| 75 iterator() : current_depth_(-1) {} | 81 iterator() : current_depth_(-1) {} |
| 76 explicit iterator(Node* node); | 82 explicit iterator(Node* node); |
| 77 | 83 |
| 78 Node* node(); | 84 Node* node(); |
| 85 MachineType type(); |
| 79 bool done(); | 86 bool done(); |
| 80 void Advance(); | 87 void Advance(); |
| 81 | 88 |
| 82 struct StatePos { | 89 struct StatePos { |
| 83 Node* node; | 90 Node* node; |
| 84 int index; | 91 int index; |
| 85 | 92 |
| 86 explicit StatePos(Node* node) : node(node), index(0) {} | 93 explicit StatePos(Node* node) : node(node), index(0) {} |
| 87 StatePos() {} | 94 StatePos() {} |
| 88 }; | 95 }; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 104 | 111 |
| 105 private: | 112 private: |
| 106 Node* node_; | 113 Node* node_; |
| 107 }; | 114 }; |
| 108 | 115 |
| 109 } // namespace compiler | 116 } // namespace compiler |
| 110 } // namespace internal | 117 } // namespace internal |
| 111 } // namespace v8 | 118 } // namespace v8 |
| 112 | 119 |
| 113 #endif // V8_COMPILER_STATE_VALUES_UTILS_H_ | 120 #endif // V8_COMPILER_STATE_VALUES_UTILS_H_ |
| OLD | NEW |