Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Side by Side Diff: src/heap/heap.h

Issue 2578233003: [heap] Explicitly clear mark bits when writing filler for left and right trimming. (Closed)
Patch Set: turn off for landing Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_HEAP_H_ 5 #ifndef V8_HEAP_HEAP_H_
6 #define V8_HEAP_HEAP_H_ 6 #define V8_HEAP_HEAP_H_
7 7
8 #include <cmath> 8 #include <cmath>
9 #include <map> 9 #include <map>
10 10
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 344
345 typedef void (*ObjectSlotCallback)(HeapObject** from, HeapObject* to); 345 typedef void (*ObjectSlotCallback)(HeapObject** from, HeapObject* to);
346 346
347 enum ArrayStorageAllocationMode { 347 enum ArrayStorageAllocationMode {
348 DONT_INITIALIZE_ARRAY_ELEMENTS, 348 DONT_INITIALIZE_ARRAY_ELEMENTS,
349 INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE 349 INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE
350 }; 350 };
351 351
352 enum class ClearRecordedSlots { kYes, kNo }; 352 enum class ClearRecordedSlots { kYes, kNo };
353 353
354 enum class ClearBlackArea { kYes, kNo };
355
356 enum class GarbageCollectionReason { 354 enum class GarbageCollectionReason {
357 kUnknown = 0, 355 kUnknown = 0,
358 kAllocationFailure = 1, 356 kAllocationFailure = 1,
359 kAllocationLimit = 2, 357 kAllocationLimit = 2,
360 kContextDisposal = 3, 358 kContextDisposal = 3,
361 kCountersExtension = 4, 359 kCountersExtension = 4,
362 kDebugger = 5, 360 kDebugger = 5,
363 kDeserializer = 6, 361 kDeserializer = 6,
364 kExternalMemoryPressure = 7, 362 kExternalMemoryPressure = 7,
365 kFinalizeMarkingViaStackGuard = 8, 363 kFinalizeMarkingViaStackGuard = 8,
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 // FreeSpace objects have a null map after deserialization. Update the map. 730 // FreeSpace objects have a null map after deserialization. Update the map.
733 void RepairFreeListsAfterDeserialization(); 731 void RepairFreeListsAfterDeserialization();
734 732
735 // Move len elements within a given array from src_index index to dst_index 733 // Move len elements within a given array from src_index index to dst_index
736 // index. 734 // index.
737 void MoveElements(FixedArray* array, int dst_index, int src_index, int len); 735 void MoveElements(FixedArray* array, int dst_index, int src_index, int len);
738 736
739 // Initialize a filler object to keep the ability to iterate over the heap 737 // Initialize a filler object to keep the ability to iterate over the heap
740 // when introducing gaps within pages. If slots could have been recorded in 738 // when introducing gaps within pages. If slots could have been recorded in
741 // the freed area, then pass ClearRecordedSlots::kYes as the mode. Otherwise, 739 // the freed area, then pass ClearRecordedSlots::kYes as the mode. Otherwise,
742 // pass ClearRecordedSlots::kNo. If the filler was created in a black area 740 // pass ClearRecordedSlots::kNo.
743 // we may want to clear the corresponding mark bits with ClearBlackArea::kYes, 741 void CreateFillerObjectAt(Address addr, int size, ClearRecordedSlots mode);
744 // which is the default. ClearBlackArea::kNo does not clear the mark bits.
745 void CreateFillerObjectAt(
746 Address addr, int size, ClearRecordedSlots mode,
747 ClearBlackArea black_area_mode = ClearBlackArea::kYes);
748 742
749 bool CanMoveObjectStart(HeapObject* object); 743 bool CanMoveObjectStart(HeapObject* object);
750 744
751 // Maintain consistency of live bytes during incremental marking. 745 // Maintain consistency of live bytes during incremental marking.
752 void AdjustLiveBytes(HeapObject* object, int by); 746 void AdjustLiveBytes(HeapObject* object, int by);
753 747
754 // Trim the given array from the left. Note that this relocates the object 748 // Trim the given array from the left. Note that this relocates the object
755 // start and hence is only valid if there is only a single reference to it. 749 // start and hence is only valid if there is only a single reference to it.
756 FixedArrayBase* LeftTrimFixedArray(FixedArrayBase* obj, int elements_to_trim); 750 FixedArrayBase* LeftTrimFixedArray(FixedArrayBase* obj, int elements_to_trim);
757 751
(...skipping 1908 matching lines...) Expand 10 before | Expand all | Expand 10 after
2666 friend class LargeObjectSpace; 2660 friend class LargeObjectSpace;
2667 friend class NewSpace; 2661 friend class NewSpace;
2668 friend class PagedSpace; 2662 friend class PagedSpace;
2669 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); 2663 DISALLOW_COPY_AND_ASSIGN(AllocationObserver);
2670 }; 2664 };
2671 2665
2672 } // namespace internal 2666 } // namespace internal
2673 } // namespace v8 2667 } // namespace v8
2674 2668
2675 #endif // V8_HEAP_HEAP_H_ 2669 #endif // V8_HEAP_HEAP_H_
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698