Chromium Code Reviews| 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_HEAP_MARK_COMPACT_H_ | 5 #ifndef V8_HEAP_MARK_COMPACT_H_ |
| 6 #define V8_HEAP_MARK_COMPACT_H_ | 6 #define V8_HEAP_MARK_COMPACT_H_ |
| 7 | 7 |
| 8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 9 #include "src/heap/spaces.h" | 9 #include "src/heap/spaces.h" |
| 10 | 10 |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 411 static bool AddTo(SlotsBufferAllocator* allocator, | 411 static bool AddTo(SlotsBufferAllocator* allocator, |
| 412 SlotsBuffer** buffer_address, SlotType type, Address addr, | 412 SlotsBuffer** buffer_address, SlotType type, Address addr, |
| 413 AdditionMode mode); | 413 AdditionMode mode); |
| 414 | 414 |
| 415 // Eliminates all stale entries from the slots buffer, i.e., slots that | 415 // Eliminates all stale entries from the slots buffer, i.e., slots that |
| 416 // are not part of live objects anymore. This method must be called after | 416 // are not part of live objects anymore. This method must be called after |
| 417 // marking, when the whole transitive closure is known and must be called | 417 // marking, when the whole transitive closure is known and must be called |
| 418 // before sweeping when mark bits are still intact. | 418 // before sweeping when mark bits are still intact. |
| 419 static void RemoveInvalidSlots(Heap* heap, SlotsBuffer* buffer); | 419 static void RemoveInvalidSlots(Heap* heap, SlotsBuffer* buffer); |
| 420 | 420 |
| 421 // Eliminate all slots that point to the given invalid_object. | 421 // Eliminate all slots that point to the given invalid_object. |
|
Michael Starzinger
2015/07/03 11:24:55
nit: Comment no longer applies.
Hannes Payer (out of office)
2015/07/03 11:26:53
Done.
| |
| 422 static void RemoveObjectSlots(Heap* heap, SlotsBuffer* buffer, | 422 static void RemoveObjectSlots(Heap* heap, SlotsBuffer* buffer, |
| 423 HeapObject* invalid_object); | 423 Address start_slot, Address end_slot); |
| 424 | 424 |
| 425 // Ensures that there are no invalid slots in the chain of slots buffers. | 425 // Ensures that there are no invalid slots in the chain of slots buffers. |
| 426 static void VerifySlots(Heap* heap, SlotsBuffer* buffer); | 426 static void VerifySlots(Heap* heap, SlotsBuffer* buffer); |
| 427 | 427 |
| 428 static const int kNumberOfElements = 1021; | 428 static const int kNumberOfElements = 1021; |
| 429 | 429 |
| 430 private: | 430 private: |
| 431 static const int kChainLengthThreshold = 15; | 431 static const int kChainLengthThreshold = 15; |
| 432 | 432 |
| 433 intptr_t idx_; | 433 intptr_t idx_; |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 735 | 735 |
| 736 // The following four methods can just be called after marking, when the | 736 // The following four methods can just be called after marking, when the |
| 737 // whole transitive closure is known. They must be called before sweeping | 737 // whole transitive closure is known. They must be called before sweeping |
| 738 // when mark bits are still intact. | 738 // when mark bits are still intact. |
| 739 bool IsSlotInBlackObject(Page* p, Address slot, HeapObject** out_object); | 739 bool IsSlotInBlackObject(Page* p, Address slot, HeapObject** out_object); |
| 740 bool IsSlotInBlackObjectSlow(Page* p, Address slot); | 740 bool IsSlotInBlackObjectSlow(Page* p, Address slot); |
| 741 bool IsSlotInLiveObject(Address slot); | 741 bool IsSlotInLiveObject(Address slot); |
| 742 void VerifyIsSlotInLiveObject(Address slot, HeapObject* object); | 742 void VerifyIsSlotInLiveObject(Address slot, HeapObject* object); |
| 743 | 743 |
| 744 // Removes all the slots in the slot buffers that are within the given | 744 // Removes all the slots in the slot buffers that are within the given |
| 745 // invalid_object. | 745 // address range. |
| 746 void RemoveObjectSlots(HeapObject* invalid_object); | 746 void RemoveObjectSlots(Address start_slot, Address end_slot); |
| 747 | 747 |
| 748 private: | 748 private: |
| 749 class SweeperTask; | 749 class SweeperTask; |
| 750 | 750 |
| 751 explicit MarkCompactCollector(Heap* heap); | 751 explicit MarkCompactCollector(Heap* heap); |
| 752 ~MarkCompactCollector(); | 752 ~MarkCompactCollector(); |
| 753 | 753 |
| 754 bool WillBeDeoptimized(Code* code); | 754 bool WillBeDeoptimized(Code* code); |
| 755 void EvictPopularEvacuationCandidate(Page* page); | 755 void EvictPopularEvacuationCandidate(Page* page); |
| 756 void ClearInvalidSlotsBufferEntries(PagedSpace* space); | 756 void ClearInvalidSlotsBufferEntries(PagedSpace* space); |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1029 private: | 1029 private: |
| 1030 MarkCompactCollector* collector_; | 1030 MarkCompactCollector* collector_; |
| 1031 }; | 1031 }; |
| 1032 | 1032 |
| 1033 | 1033 |
| 1034 const char* AllocationSpaceName(AllocationSpace space); | 1034 const char* AllocationSpaceName(AllocationSpace space); |
| 1035 } | 1035 } |
| 1036 } // namespace v8::internal | 1036 } // namespace v8::internal |
| 1037 | 1037 |
| 1038 #endif // V8_HEAP_MARK_COMPACT_H_ | 1038 #endif // V8_HEAP_MARK_COMPACT_H_ |
| OLD | NEW |