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