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_H_ | 5 #ifndef V8_AST_H_ |
6 #define V8_AST_H_ | 6 #define V8_AST_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 SmallMapList(int capacity, Zone* zone) : list_(capacity, zone) {} | 258 SmallMapList(int capacity, Zone* zone) : list_(capacity, zone) {} |
259 | 259 |
260 void Reserve(int capacity, Zone* zone) { list_.Reserve(capacity, zone); } | 260 void Reserve(int capacity, Zone* zone) { list_.Reserve(capacity, zone); } |
261 void Clear() { list_.Clear(); } | 261 void Clear() { list_.Clear(); } |
262 void Sort() { list_.Sort(); } | 262 void Sort() { list_.Sort(); } |
263 | 263 |
264 bool is_empty() const { return list_.is_empty(); } | 264 bool is_empty() const { return list_.is_empty(); } |
265 int length() const { return list_.length(); } | 265 int length() const { return list_.length(); } |
266 | 266 |
267 void AddMapIfMissing(Handle<Map> map, Zone* zone) { | 267 void AddMapIfMissing(Handle<Map> map, Zone* zone) { |
268 if (!Map::CurrentMapForDeprecated(map).ToHandle(&map)) return; | 268 if (!Map::TryUpdate(map).ToHandle(&map)) return; |
269 for (int i = 0; i < length(); ++i) { | 269 for (int i = 0; i < length(); ++i) { |
270 if (at(i).is_identical_to(map)) return; | 270 if (at(i).is_identical_to(map)) return; |
271 } | 271 } |
272 Add(map, zone); | 272 Add(map, zone); |
273 } | 273 } |
274 | 274 |
275 void FilterForPossibleTransitions(Map* root_map) { | 275 void FilterForPossibleTransitions(Map* root_map) { |
276 for (int i = list_.length() - 1; i >= 0; i--) { | 276 for (int i = list_.length() - 1; i >= 0; i--) { |
277 if (at(i)->FindRootMap() != root_map) { | 277 if (at(i)->FindRootMap() != root_map) { |
278 list_.RemoveElement(list_.at(i)); | 278 list_.RemoveElement(list_.at(i)); |
(...skipping 3153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3432 private: | 3432 private: |
3433 Zone* zone_; | 3433 Zone* zone_; |
3434 Visitor visitor_; | 3434 Visitor visitor_; |
3435 AstValueFactory* ast_value_factory_; | 3435 AstValueFactory* ast_value_factory_; |
3436 }; | 3436 }; |
3437 | 3437 |
3438 | 3438 |
3439 } } // namespace v8::internal | 3439 } } // namespace v8::internal |
3440 | 3440 |
3441 #endif // V8_AST_H_ | 3441 #endif // V8_AST_H_ |
OLD | NEW |