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/layout-descriptor.h" | 9 #include "src/layout-descriptor.h" |
10 | 10 |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 INLINE(static void VisitCell(Heap* heap, RelocInfo* rinfo)); | 410 INLINE(static void VisitCell(Heap* heap, RelocInfo* rinfo)); |
411 INLINE(static void VisitDebugTarget(Heap* heap, RelocInfo* rinfo)); | 411 INLINE(static void VisitDebugTarget(Heap* heap, RelocInfo* rinfo)); |
412 INLINE(static void VisitCodeTarget(Heap* heap, RelocInfo* rinfo)); | 412 INLINE(static void VisitCodeTarget(Heap* heap, RelocInfo* rinfo)); |
413 INLINE(static void VisitCodeAgeSequence(Heap* heap, RelocInfo* rinfo)); | 413 INLINE(static void VisitCodeAgeSequence(Heap* heap, RelocInfo* rinfo)); |
414 INLINE(static void VisitExternalReference(RelocInfo* rinfo)) {} | 414 INLINE(static void VisitExternalReference(RelocInfo* rinfo)) {} |
415 INLINE(static void VisitInternalReference(RelocInfo* rinfo)) {} | 415 INLINE(static void VisitInternalReference(RelocInfo* rinfo)) {} |
416 INLINE(static void VisitRuntimeEntry(RelocInfo* rinfo)) {} | 416 INLINE(static void VisitRuntimeEntry(RelocInfo* rinfo)) {} |
417 // Skip the weak next code link in a code object. | 417 // Skip the weak next code link in a code object. |
418 INLINE(static void VisitNextCodeLink(Heap* heap, Object** slot)) {} | 418 INLINE(static void VisitNextCodeLink(Heap* heap, Object** slot)) {} |
419 | 419 |
420 // TODO(mstarzinger): This should be made protected once refactoring is done. | |
421 // Mark non-optimize code for functions inlined into the given optimized | 420 // Mark non-optimize code for functions inlined into the given optimized |
422 // code. This will prevent it from being flushed. | 421 // code. This will prevent it from being flushed. |
423 static void MarkInlinedFunctionsCode(Heap* heap, Code* code); | 422 static void MarkInlinedFunctionsCode(Heap* heap, Code* code); |
424 | 423 |
425 protected: | 424 protected: |
426 INLINE(static void VisitMap(Map* map, HeapObject* object)); | 425 INLINE(static void VisitMap(Map* map, HeapObject* object)); |
427 INLINE(static void VisitCode(Map* map, HeapObject* object)); | 426 INLINE(static void VisitCode(Map* map, HeapObject* object)); |
428 INLINE(static void VisitSharedFunctionInfo(Map* map, HeapObject* object)); | 427 INLINE(static void VisitSharedFunctionInfo(Map* map, HeapObject* object)); |
429 INLINE(static void VisitAllocationSite(Map* map, HeapObject* object)); | 428 INLINE(static void VisitAllocationSite(Map* map, HeapObject* object)); |
430 INLINE(static void VisitWeakCollection(Map* map, HeapObject* object)); | 429 INLINE(static void VisitWeakCollection(Map* map, HeapObject* object)); |
431 INLINE(static void VisitJSFunction(Map* map, HeapObject* object)); | 430 INLINE(static void VisitJSFunction(Map* map, HeapObject* object)); |
432 INLINE(static void VisitJSRegExp(Map* map, HeapObject* object)); | 431 INLINE(static void VisitJSRegExp(Map* map, HeapObject* object)); |
433 INLINE(static void VisitJSArrayBuffer(Map* map, HeapObject* object)); | 432 INLINE(static void VisitJSArrayBuffer(Map* map, HeapObject* object)); |
434 INLINE(static void VisitJSTypedArray(Map* map, HeapObject* object)); | 433 INLINE(static void VisitJSTypedArray(Map* map, HeapObject* object)); |
435 INLINE(static void VisitJSDataView(Map* map, HeapObject* object)); | 434 INLINE(static void VisitJSDataView(Map* map, HeapObject* object)); |
436 INLINE(static void VisitNativeContext(Map* map, HeapObject* object)); | 435 INLINE(static void VisitNativeContext(Map* map, HeapObject* object)); |
437 | 436 |
438 // Mark pointers in a Map and its TransitionArray together, possibly | 437 // Mark pointers in a Map and its TransitionArray together, possibly |
439 // treating transitions or back pointers weak. | 438 // treating transitions or back pointers weak. |
440 static void MarkMapContents(Heap* heap, Map* map); | 439 static void MarkMapContents(Heap* heap, Map* map); |
441 static void MarkTransitionArray(Heap* heap, TransitionArray* transitions); | 440 static void MarkTransitionArray(Heap* heap, TransitionArray* transitions); |
442 | 441 |
| 442 // Mark pointers in the optimized code map that should act as strong |
| 443 // references, possibly treating some entries weak. |
| 444 static void MarkOptimizedCodeMap(Heap* heap, FixedArray* code_map); |
| 445 |
443 // Code flushing support. | 446 // Code flushing support. |
444 INLINE(static bool IsFlushable(Heap* heap, JSFunction* function)); | 447 INLINE(static bool IsFlushable(Heap* heap, JSFunction* function)); |
445 INLINE(static bool IsFlushable(Heap* heap, SharedFunctionInfo* shared_info)); | 448 INLINE(static bool IsFlushable(Heap* heap, SharedFunctionInfo* shared_info)); |
446 | 449 |
447 // Helpers used by code flushing support that visit pointer fields and treat | 450 // Helpers used by code flushing support that visit pointer fields and treat |
448 // references to code objects either strongly or weakly. | 451 // references to code objects either strongly or weakly. |
449 static void VisitSharedFunctionInfoStrongCode(Heap* heap, HeapObject* object); | 452 static void VisitSharedFunctionInfoStrongCode(Heap* heap, HeapObject* object); |
450 static void VisitSharedFunctionInfoWeakCode(Heap* heap, HeapObject* object); | 453 static void VisitSharedFunctionInfoWeakCode(Heap* heap, HeapObject* object); |
451 static void VisitJSFunctionStrongCode(Heap* heap, HeapObject* object); | 454 static void VisitJSFunctionStrongCode(Heap* heap, HeapObject* object); |
452 static void VisitJSFunctionWeakCode(Heap* heap, HeapObject* object); | 455 static void VisitJSFunctionWeakCode(Heap* heap, HeapObject* object); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 // the next element. Given the head of the list, this function removes dead | 489 // the next element. Given the head of the list, this function removes dead |
487 // elements from the list and if requested records slots for next-element | 490 // elements from the list and if requested records slots for next-element |
488 // pointers. The template parameter T is a WeakListVisitor that defines how to | 491 // pointers. The template parameter T is a WeakListVisitor that defines how to |
489 // access the next-element pointers. | 492 // access the next-element pointers. |
490 template <class T> | 493 template <class T> |
491 Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer); | 494 Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer); |
492 } | 495 } |
493 } // namespace v8::internal | 496 } // namespace v8::internal |
494 | 497 |
495 #endif // V8_OBJECTS_VISITING_H_ | 498 #endif // V8_OBJECTS_VISITING_H_ |
OLD | NEW |