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_OBJECTS_VISITING_H_ | 5 #ifndef V8_OBJECTS_VISITING_H_ |
6 #define V8_OBJECTS_VISITING_H_ | 6 #define V8_OBJECTS_VISITING_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/heap/heap.h" | 9 #include "src/heap/heap.h" |
10 #include "src/heap/spaces.h" | 10 #include "src/heap/spaces.h" |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 | 293 |
294 INLINE(static int VisitSeqTwoByteString(Map* map, HeapObject* object)) { | 294 INLINE(static int VisitSeqTwoByteString(Map* map, HeapObject* object)) { |
295 return SeqTwoByteString::cast(object) | 295 return SeqTwoByteString::cast(object) |
296 ->SeqTwoByteStringSize(map->instance_type()); | 296 ->SeqTwoByteStringSize(map->instance_type()); |
297 } | 297 } |
298 | 298 |
299 INLINE(static int VisitFreeSpace(Map* map, HeapObject* object)) { | 299 INLINE(static int VisitFreeSpace(Map* map, HeapObject* object)) { |
300 return FreeSpace::cast(object)->size(); | 300 return FreeSpace::cast(object)->size(); |
301 } | 301 } |
302 | 302 |
| 303 INLINE(static int VisitJSArrayBuffer(Map* map, HeapObject* object)); |
303 INLINE(static int VisitBytecodeArray(Map* map, HeapObject* object)); | 304 INLINE(static int VisitBytecodeArray(Map* map, HeapObject* object)); |
304 | 305 |
305 class DataObjectVisitor { | 306 class DataObjectVisitor { |
306 public: | 307 public: |
307 template <int object_size> | 308 template <int object_size> |
308 static inline int VisitSpecialized(Map* map, HeapObject* object) { | 309 static inline int VisitSpecialized(Map* map, HeapObject* object) { |
309 return object_size; | 310 return object_size; |
310 } | 311 } |
311 | 312 |
312 INLINE(static int Visit(Map* map, HeapObject* object)) { | 313 INLINE(static int Visit(Map* map, HeapObject* object)) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 INLINE(static void VisitNextCodeLink(Heap* heap, Object** slot)) {} | 372 INLINE(static void VisitNextCodeLink(Heap* heap, Object** slot)) {} |
372 | 373 |
373 protected: | 374 protected: |
374 INLINE(static void VisitMap(Map* map, HeapObject* object)); | 375 INLINE(static void VisitMap(Map* map, HeapObject* object)); |
375 INLINE(static void VisitCode(Map* map, HeapObject* object)); | 376 INLINE(static void VisitCode(Map* map, HeapObject* object)); |
376 INLINE(static void VisitSharedFunctionInfo(Map* map, HeapObject* object)); | 377 INLINE(static void VisitSharedFunctionInfo(Map* map, HeapObject* object)); |
377 INLINE(static void VisitAllocationSite(Map* map, HeapObject* object)); | 378 INLINE(static void VisitAllocationSite(Map* map, HeapObject* object)); |
378 INLINE(static void VisitWeakCollection(Map* map, HeapObject* object)); | 379 INLINE(static void VisitWeakCollection(Map* map, HeapObject* object)); |
379 INLINE(static void VisitJSFunction(Map* map, HeapObject* object)); | 380 INLINE(static void VisitJSFunction(Map* map, HeapObject* object)); |
380 INLINE(static void VisitJSRegExp(Map* map, HeapObject* object)); | 381 INLINE(static void VisitJSRegExp(Map* map, HeapObject* object)); |
| 382 INLINE(static void VisitJSArrayBuffer(Map* map, HeapObject* object)); |
381 INLINE(static void VisitNativeContext(Map* map, HeapObject* object)); | 383 INLINE(static void VisitNativeContext(Map* map, HeapObject* object)); |
382 INLINE(static void VisitBytecodeArray(Map* map, HeapObject* object)); | 384 INLINE(static void VisitBytecodeArray(Map* map, HeapObject* object)); |
383 | 385 |
384 // Mark pointers in a Map treating some elements of the descriptor array weak. | 386 // Mark pointers in a Map treating some elements of the descriptor array weak. |
385 static void MarkMapContents(Heap* heap, Map* map); | 387 static void MarkMapContents(Heap* heap, Map* map); |
386 | 388 |
387 // Code flushing support. | 389 // Code flushing support. |
388 INLINE(static bool IsFlushable(Heap* heap, JSFunction* function)); | 390 INLINE(static bool IsFlushable(Heap* heap, JSFunction* function)); |
389 INLINE(static bool IsFlushable(Heap* heap, SharedFunctionInfo* shared_info)); | 391 INLINE(static bool IsFlushable(Heap* heap, SharedFunctionInfo* shared_info)); |
390 | 392 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 // the next element. Given the head of the list, this function removes dead | 454 // the next element. Given the head of the list, this function removes dead |
453 // elements from the list and if requested records slots for next-element | 455 // elements from the list and if requested records slots for next-element |
454 // pointers. The template parameter T is a WeakListVisitor that defines how to | 456 // pointers. The template parameter T is a WeakListVisitor that defines how to |
455 // access the next-element pointers. | 457 // access the next-element pointers. |
456 template <class T> | 458 template <class T> |
457 Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer); | 459 Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer); |
458 } // namespace internal | 460 } // namespace internal |
459 } // namespace v8 | 461 } // namespace v8 |
460 | 462 |
461 #endif // V8_OBJECTS_VISITING_H_ | 463 #endif // V8_OBJECTS_VISITING_H_ |
OLD | NEW |