OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_AST_AST_H_ | 5 #ifndef V8_AST_AST_H_ |
6 #define V8_AST_AST_H_ | 6 #define V8_AST_AST_H_ |
7 | 7 |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/ast/ast-value-factory.h" | 9 #include "src/ast/ast-value-factory.h" |
10 #include "src/ast/modules.h" | 10 #include "src/ast/modules.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 #define DECLARE_NODE_TYPE(type) \ | 123 #define DECLARE_NODE_TYPE(type) \ |
124 void Accept(AstVisitor* v) override; \ | 124 void Accept(AstVisitor* v) override; \ |
125 AstNode::NodeType node_type() const final { return AstNode::k##type; } \ | 125 AstNode::NodeType node_type() const final { return AstNode::k##type; } \ |
126 friend class AstNodeFactory; | 126 friend class AstNodeFactory; |
127 | 127 |
128 | 128 |
129 class FeedbackVectorSlotCache { | 129 class FeedbackVectorSlotCache { |
130 public: | 130 public: |
131 explicit FeedbackVectorSlotCache(Zone* zone) | 131 explicit FeedbackVectorSlotCache(Zone* zone) |
132 : zone_(zone), | 132 : zone_(zone), |
133 hash_map_(HashMap::PointersMatch, ZoneHashMap::kDefaultHashMapCapacity, | 133 hash_map_(base::HashMap::PointersMatch, |
| 134 ZoneHashMap::kDefaultHashMapCapacity, |
134 ZoneAllocationPolicy(zone)) {} | 135 ZoneAllocationPolicy(zone)) {} |
135 | 136 |
136 void Put(Variable* variable, FeedbackVectorSlot slot) { | 137 void Put(Variable* variable, FeedbackVectorSlot slot) { |
137 ZoneHashMap::Entry* entry = hash_map_.LookupOrInsert( | 138 ZoneHashMap::Entry* entry = hash_map_.LookupOrInsert( |
138 variable, ComputePointerHash(variable), ZoneAllocationPolicy(zone_)); | 139 variable, ComputePointerHash(variable), ZoneAllocationPolicy(zone_)); |
139 entry->value = reinterpret_cast<void*>(slot.ToInt()); | 140 entry->value = reinterpret_cast<void*>(slot.ToInt()); |
140 } | 141 } |
141 | 142 |
142 ZoneHashMap::Entry* Get(Variable* variable) const { | 143 ZoneHashMap::Entry* Get(Variable* variable) const { |
143 return hash_map_.Lookup(variable, ComputePointerHash(variable)); | 144 return hash_map_.Lookup(variable, ComputePointerHash(variable)); |
(...skipping 3433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3577 : NULL; \ | 3578 : NULL; \ |
3578 } | 3579 } |
3579 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3580 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
3580 #undef DECLARE_NODE_FUNCTIONS | 3581 #undef DECLARE_NODE_FUNCTIONS |
3581 | 3582 |
3582 | 3583 |
3583 } // namespace internal | 3584 } // namespace internal |
3584 } // namespace v8 | 3585 } // namespace v8 |
3585 | 3586 |
3586 #endif // V8_AST_AST_H_ | 3587 #endif // V8_AST_AST_H_ |
OLD | NEW |