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

Unified Diff: src/heap/spaces.h

Issue 2773093002: Revert "[heap] Make SlotSet allocation thread-safe and refactor code." (Closed)
Patch Set: Created 3 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/remembered-set.h ('k') | src/heap/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.h
diff --git a/src/heap/spaces.h b/src/heap/spaces.h
index 903a3a48824bef4e07bd1711bfbd39c72aa43cdd..0a526e16be255427f5e71d6724b01fb9e65a8ba0 100644
--- a/src/heap/spaces.h
+++ b/src/heap/spaces.h
@@ -131,12 +131,6 @@ enum FreeListCategoryType {
enum FreeMode { kLinkCategory, kDoNotLinkCategory };
-enum RememberedSetType {
- OLD_TO_NEW,
- OLD_TO_OLD,
- NUMBER_OF_REMEMBERED_SET_TYPES = OLD_TO_OLD + 1
-};
-
// A free list category maintains a linked list of free memory blocks.
class FreeListCategory {
public:
@@ -344,15 +338,17 @@ class MemoryChunk {
+ kPointerSize // Heap* heap_
+ kIntptrSize // intptr_t progress_bar_
+ kIntptrSize // intptr_t live_byte_count_
- + kPointerSize * NUMBER_OF_REMEMBERED_SET_TYPES // SlotSet* array
- + kPointerSize * NUMBER_OF_REMEMBERED_SET_TYPES // TypedSlotSet* array
- + kPointerSize // SkipList* skip_list_
- + kPointerSize // AtomicValue high_water_mark_
- + kPointerSize // base::Mutex* mutex_
- + kPointerSize // base::AtomicWord concurrent_sweeping_
- + 2 * kSizetSize // AtomicNumber free-list statistics
- + kPointerSize // AtomicValue next_chunk_
- + kPointerSize // AtomicValue prev_chunk_
+ + kPointerSize // SlotSet* old_to_new_slots_
+ + kPointerSize // SlotSet* old_to_old_slots_
+ + kPointerSize // TypedSlotSet* typed_old_to_new_slots_
+ + kPointerSize // TypedSlotSet* typed_old_to_old_slots_
+ + kPointerSize // SkipList* skip_list_
+ + kPointerSize // AtomicValue high_water_mark_
+ + kPointerSize // base::Mutex* mutex_
+ + kPointerSize // base::AtomicWord concurrent_sweeping_
+ + 2 * kSizetSize // AtomicNumber free-list statistics
+ + kPointerSize // AtomicValue next_chunk_
+ + kPointerSize // AtomicValue prev_chunk_
+ FreeListCategory::kSize * kNumberOfCategories
// FreeListCategory categories_[kNumberOfCategories]
+ kPointerSize // LocalArrayBufferTracker* local_tracker_
@@ -467,26 +463,24 @@ class MemoryChunk {
inline void set_skip_list(SkipList* skip_list) { skip_list_ = skip_list; }
- template <RememberedSetType type>
- SlotSet* slot_set() {
- return slot_set_[type].Value();
+ inline SlotSet* old_to_new_slots() { return old_to_new_slots_.Value(); }
+ inline SlotSet* old_to_old_slots() { return old_to_old_slots_; }
+ inline TypedSlotSet* typed_old_to_new_slots() {
+ return typed_old_to_new_slots_.Value();
}
-
- template <RememberedSetType type>
- TypedSlotSet* typed_slot_set() {
- return typed_slot_set_[type].Value();
+ inline TypedSlotSet* typed_old_to_old_slots() {
+ return typed_old_to_old_slots_;
}
-
inline LocalArrayBufferTracker* local_tracker() { return local_tracker_; }
- template <RememberedSetType type>
- SlotSet* AllocateSlotSet();
- template <RememberedSetType type>
- void ReleaseSlotSet();
- template <RememberedSetType type>
- TypedSlotSet* AllocateTypedSlotSet();
- template <RememberedSetType type>
- void ReleaseTypedSlotSet();
+ V8_EXPORT_PRIVATE void AllocateOldToNewSlots();
+ void ReleaseOldToNewSlots();
+ V8_EXPORT_PRIVATE void AllocateOldToOldSlots();
+ void ReleaseOldToOldSlots();
+ void AllocateTypedOldToNewSlots();
+ void ReleaseTypedOldToNewSlots();
+ void AllocateTypedOldToOldSlots();
+ void ReleaseTypedOldToOldSlots();
void AllocateLocalTracker();
void ReleaseLocalTracker();
void AllocateYoungGenerationBitmap();
@@ -658,9 +652,10 @@ class MemoryChunk {
// A single slot set for small pages (of size kPageSize) or an array of slot
// set for large pages. In the latter case the number of entries in the array
// is ceil(size() / kPageSize).
- base::AtomicValue<SlotSet*> slot_set_[NUMBER_OF_REMEMBERED_SET_TYPES];
- base::AtomicValue<TypedSlotSet*>
- typed_slot_set_[NUMBER_OF_REMEMBERED_SET_TYPES];
+ base::AtomicValue<SlotSet*> old_to_new_slots_;
+ SlotSet* old_to_old_slots_;
+ base::AtomicValue<TypedSlotSet*> typed_old_to_new_slots_;
+ TypedSlotSet* typed_old_to_old_slots_;
SkipList* skip_list_;
« no previous file with comments | « src/heap/remembered-set.h ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698