| 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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 INLINE(static void VisitCell(Heap* heap, RelocInfo* rinfo)); | 363 INLINE(static void VisitCell(Heap* heap, RelocInfo* rinfo)); |
| 364 INLINE(static void VisitDebugTarget(Heap* heap, RelocInfo* rinfo)); | 364 INLINE(static void VisitDebugTarget(Heap* heap, RelocInfo* rinfo)); |
| 365 INLINE(static void VisitCodeTarget(Heap* heap, RelocInfo* rinfo)); | 365 INLINE(static void VisitCodeTarget(Heap* heap, RelocInfo* rinfo)); |
| 366 INLINE(static void VisitCodeAgeSequence(Heap* heap, RelocInfo* rinfo)); | 366 INLINE(static void VisitCodeAgeSequence(Heap* heap, RelocInfo* rinfo)); |
| 367 INLINE(static void VisitExternalReference(RelocInfo* rinfo)) {} | 367 INLINE(static void VisitExternalReference(RelocInfo* rinfo)) {} |
| 368 INLINE(static void VisitInternalReference(RelocInfo* rinfo)) {} | 368 INLINE(static void VisitInternalReference(RelocInfo* rinfo)) {} |
| 369 INLINE(static void VisitRuntimeEntry(RelocInfo* rinfo)) {} | 369 INLINE(static void VisitRuntimeEntry(RelocInfo* rinfo)) {} |
| 370 // Skip the weak next code link in a code object. | 370 // Skip the weak next code link in a code object. |
| 371 INLINE(static void VisitNextCodeLink(Heap* heap, Object** slot)) {} | 371 INLINE(static void VisitNextCodeLink(Heap* heap, Object** slot)) {} |
| 372 | 372 |
| 373 // Mark non-optimize code for functions inlined into the given optimized | |
| 374 // code. This will prevent it from being flushed. | |
| 375 static void MarkInlinedFunctionsCode(Heap* heap, Code* code); | |
| 376 | |
| 377 protected: | 373 protected: |
| 378 INLINE(static void VisitMap(Map* map, HeapObject* object)); | 374 INLINE(static void VisitMap(Map* map, HeapObject* object)); |
| 379 INLINE(static void VisitCode(Map* map, HeapObject* object)); | 375 INLINE(static void VisitCode(Map* map, HeapObject* object)); |
| 380 INLINE(static void VisitSharedFunctionInfo(Map* map, HeapObject* object)); | 376 INLINE(static void VisitSharedFunctionInfo(Map* map, HeapObject* object)); |
| 381 INLINE(static void VisitAllocationSite(Map* map, HeapObject* object)); | 377 INLINE(static void VisitAllocationSite(Map* map, HeapObject* object)); |
| 382 INLINE(static void VisitWeakCollection(Map* map, HeapObject* object)); | 378 INLINE(static void VisitWeakCollection(Map* map, HeapObject* object)); |
| 383 INLINE(static void VisitJSFunction(Map* map, HeapObject* object)); | 379 INLINE(static void VisitJSFunction(Map* map, HeapObject* object)); |
| 384 INLINE(static void VisitJSRegExp(Map* map, HeapObject* object)); | 380 INLINE(static void VisitJSRegExp(Map* map, HeapObject* object)); |
| 385 INLINE(static void VisitJSArrayBuffer(Map* map, HeapObject* object)); | 381 INLINE(static void VisitJSArrayBuffer(Map* map, HeapObject* object)); |
| 386 INLINE(static void VisitJSTypedArray(Map* map, HeapObject* object)); | 382 INLINE(static void VisitJSTypedArray(Map* map, HeapObject* object)); |
| 387 INLINE(static void VisitJSDataView(Map* map, HeapObject* object)); | 383 INLINE(static void VisitJSDataView(Map* map, HeapObject* object)); |
| 388 INLINE(static void VisitNativeContext(Map* map, HeapObject* object)); | 384 INLINE(static void VisitNativeContext(Map* map, HeapObject* object)); |
| 389 INLINE(static void VisitBytecodeArray(Map* map, HeapObject* object)); | 385 INLINE(static void VisitBytecodeArray(Map* map, HeapObject* object)); |
| 390 | 386 |
| 391 // Mark pointers in a Map and its TransitionArray together, possibly | 387 // Mark pointers in a Map and its TransitionArray together, possibly |
| 392 // treating transitions or back pointers weak. | 388 // treating transitions or back pointers weak. |
| 393 static void MarkMapContents(Heap* heap, Map* map); | 389 static void MarkMapContents(Heap* heap, Map* map); |
| 394 static void MarkTransitionArray(Heap* heap, TransitionArray* transitions); | 390 static void MarkTransitionArray(Heap* heap, TransitionArray* transitions); |
| 395 | 391 |
| 396 // Mark pointers in the optimized code map that should act as strong | 392 // Mark pointers in the optimized code map that should act as strong |
| 397 // references, possibly treating some entries weak. | 393 // references, possibly treating some entries weak. |
| 398 static void MarkOptimizedCodeMap(Heap* heap, FixedArray* code_map); | 394 static void MarkOptimizedCodeMap(Heap* heap, FixedArray* code_map); |
| 399 | 395 |
| 396 // Mark non-optimized code for functions inlined into the given optimized |
| 397 // code. This will prevent it from being flushed. |
| 398 static void MarkInlinedFunctionsCode(Heap* heap, Code* code); |
| 399 |
| 400 // Code flushing support. | 400 // Code flushing support. |
| 401 INLINE(static bool IsFlushable(Heap* heap, JSFunction* function)); | 401 INLINE(static bool IsFlushable(Heap* heap, JSFunction* function)); |
| 402 INLINE(static bool IsFlushable(Heap* heap, SharedFunctionInfo* shared_info)); | 402 INLINE(static bool IsFlushable(Heap* heap, SharedFunctionInfo* shared_info)); |
| 403 | 403 |
| 404 // Helpers used by code flushing support that visit pointer fields and treat | 404 // Helpers used by code flushing support that visit pointer fields and treat |
| 405 // references to code objects either strongly or weakly. | 405 // references to code objects either strongly or weakly. |
| 406 static void VisitSharedFunctionInfoStrongCode(Heap* heap, HeapObject* object); | 406 static void VisitSharedFunctionInfoStrongCode(Heap* heap, HeapObject* object); |
| 407 static void VisitSharedFunctionInfoWeakCode(Heap* heap, HeapObject* object); | 407 static void VisitSharedFunctionInfoWeakCode(Heap* heap, HeapObject* object); |
| 408 static void VisitJSFunctionStrongCode(Heap* heap, HeapObject* object); | 408 static void VisitJSFunctionStrongCode(Heap* heap, HeapObject* object); |
| 409 static void VisitJSFunctionWeakCode(Heap* heap, HeapObject* object); | 409 static void VisitJSFunctionWeakCode(Heap* heap, HeapObject* object); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 // the next element. Given the head of the list, this function removes dead | 443 // the next element. Given the head of the list, this function removes dead |
| 444 // elements from the list and if requested records slots for next-element | 444 // elements from the list and if requested records slots for next-element |
| 445 // pointers. The template parameter T is a WeakListVisitor that defines how to | 445 // pointers. The template parameter T is a WeakListVisitor that defines how to |
| 446 // access the next-element pointers. | 446 // access the next-element pointers. |
| 447 template <class T> | 447 template <class T> |
| 448 Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer); | 448 Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer); |
| 449 } // namespace internal | 449 } // namespace internal |
| 450 } // namespace v8 | 450 } // namespace v8 |
| 451 | 451 |
| 452 #endif // V8_OBJECTS_VISITING_H_ | 452 #endif // V8_OBJECTS_VISITING_H_ |
| OLD | NEW |