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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 // This is an example of Curiously recurring template pattern. | 347 // This is an example of Curiously recurring template pattern. |
348 template <typename StaticVisitor> | 348 template <typename StaticVisitor> |
349 class StaticMarkingVisitor : public StaticVisitorBase { | 349 class StaticMarkingVisitor : public StaticVisitorBase { |
350 public: | 350 public: |
351 static void Initialize(); | 351 static void Initialize(); |
352 | 352 |
353 INLINE(static void IterateBody(Map* map, HeapObject* obj)) { | 353 INLINE(static void IterateBody(Map* map, HeapObject* obj)) { |
354 table_.GetVisitor(map)(map, obj); | 354 table_.GetVisitor(map)(map, obj); |
355 } | 355 } |
356 | 356 |
357 INLINE(static void VisitPropertyCell(Map* map, HeapObject* object)); | |
358 INLINE(static void VisitWeakCell(Map* map, HeapObject* object)); | 357 INLINE(static void VisitWeakCell(Map* map, HeapObject* object)); |
359 INLINE(static void VisitTransitionArray(Map* map, HeapObject* object)); | 358 INLINE(static void VisitTransitionArray(Map* map, HeapObject* object)); |
360 INLINE(static void VisitCodeEntry(Heap* heap, HeapObject* object, | 359 INLINE(static void VisitCodeEntry(Heap* heap, HeapObject* object, |
361 Address entry_address)); | 360 Address entry_address)); |
362 INLINE(static void VisitEmbeddedPointer(Heap* heap, RelocInfo* rinfo)); | 361 INLINE(static void VisitEmbeddedPointer(Heap* heap, RelocInfo* rinfo)); |
363 INLINE(static void VisitCell(Heap* heap, RelocInfo* rinfo)); | 362 INLINE(static void VisitCell(Heap* heap, RelocInfo* rinfo)); |
364 INLINE(static void VisitDebugTarget(Heap* heap, RelocInfo* rinfo)); | 363 INLINE(static void VisitDebugTarget(Heap* heap, RelocInfo* rinfo)); |
365 INLINE(static void VisitCodeTarget(Heap* heap, RelocInfo* rinfo)); | 364 INLINE(static void VisitCodeTarget(Heap* heap, RelocInfo* rinfo)); |
366 INLINE(static void VisitCodeAgeSequence(Heap* heap, RelocInfo* rinfo)); | 365 INLINE(static void VisitCodeAgeSequence(Heap* heap, RelocInfo* rinfo)); |
367 INLINE(static void VisitExternalReference(RelocInfo* rinfo)) {} | 366 INLINE(static void VisitExternalReference(RelocInfo* rinfo)) {} |
368 INLINE(static void VisitInternalReference(RelocInfo* rinfo)) {} | 367 INLINE(static void VisitInternalReference(RelocInfo* rinfo)) {} |
369 INLINE(static void VisitRuntimeEntry(RelocInfo* rinfo)) {} | 368 INLINE(static void VisitRuntimeEntry(RelocInfo* rinfo)) {} |
370 // Skip the weak next code link in a code object. | 369 // Skip the weak next code link in a code object. |
371 INLINE(static void VisitNextCodeLink(Heap* heap, Object** slot)) {} | 370 INLINE(static void VisitNextCodeLink(Heap* heap, Object** slot)) {} |
372 | 371 |
373 protected: | 372 protected: |
374 INLINE(static void VisitMap(Map* map, HeapObject* object)); | 373 INLINE(static void VisitMap(Map* map, HeapObject* object)); |
375 INLINE(static void VisitCode(Map* map, HeapObject* object)); | 374 INLINE(static void VisitCode(Map* map, HeapObject* object)); |
376 INLINE(static void VisitSharedFunctionInfo(Map* map, HeapObject* object)); | 375 INLINE(static void VisitSharedFunctionInfo(Map* map, HeapObject* object)); |
377 INLINE(static void VisitAllocationSite(Map* map, HeapObject* object)); | |
378 INLINE(static void VisitWeakCollection(Map* map, HeapObject* object)); | 376 INLINE(static void VisitWeakCollection(Map* map, HeapObject* object)); |
379 INLINE(static void VisitJSFunction(Map* map, HeapObject* object)); | 377 INLINE(static void VisitJSFunction(Map* map, HeapObject* object)); |
380 INLINE(static void VisitJSRegExp(Map* map, HeapObject* object)); | |
381 INLINE(static void VisitNativeContext(Map* map, HeapObject* object)); | 378 INLINE(static void VisitNativeContext(Map* map, HeapObject* object)); |
382 INLINE(static void VisitBytecodeArray(Map* map, HeapObject* object)); | |
383 | 379 |
384 // Mark pointers in a Map treating some elements of the descriptor array weak. | 380 // Mark pointers in a Map treating some elements of the descriptor array weak. |
385 static void MarkMapContents(Heap* heap, Map* map); | 381 static void MarkMapContents(Heap* heap, Map* map); |
386 | 382 |
387 // Code flushing support. | 383 // Code flushing support. |
388 INLINE(static bool IsFlushable(Heap* heap, JSFunction* function)); | 384 INLINE(static bool IsFlushable(Heap* heap, JSFunction* function)); |
389 INLINE(static bool IsFlushable(Heap* heap, SharedFunctionInfo* shared_info)); | 385 INLINE(static bool IsFlushable(Heap* heap, SharedFunctionInfo* shared_info)); |
390 | 386 |
391 // Helpers used by code flushing support that visit pointer fields and treat | 387 // Helpers used by code flushing support that visit pointer fields and treat |
392 // references to code objects either strongly or weakly. | 388 // references to code objects either strongly or weakly. |
(...skipping 59 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 | 448 // 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 | 449 // 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 | 450 // pointers. The template parameter T is a WeakListVisitor that defines how to |
455 // access the next-element pointers. | 451 // access the next-element pointers. |
456 template <class T> | 452 template <class T> |
457 Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer); | 453 Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer); |
458 } // namespace internal | 454 } // namespace internal |
459 } // namespace v8 | 455 } // namespace v8 |
460 | 456 |
461 #endif // V8_OBJECTS_VISITING_H_ | 457 #endif // V8_OBJECTS_VISITING_H_ |
OLD | NEW |