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

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

Issue 2826593004: [heap] Reland: Take page lock when scavenging old to new references in Scavenger. (Closed)
Patch Set: Use recursive mutex. Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « src/heap/remembered-set.h ('k') | src/heap/spaces.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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_SPACES_H_ 5 #ifndef V8_HEAP_SPACES_H_
6 #define V8_HEAP_SPACES_H_ 6 #define V8_HEAP_SPACES_H_
7 7
8 #include <list> 8 #include <list>
9 #include <memory> 9 #include <memory>
10 #include <unordered_set> 10 #include <unordered_set>
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 + kPointerSize // Address area_end_ 337 + kPointerSize // Address area_end_
338 + 2 * kPointerSize // base::VirtualMemory reservation_ 338 + 2 * kPointerSize // base::VirtualMemory reservation_
339 + kPointerSize // Address owner_ 339 + kPointerSize // Address owner_
340 + kPointerSize // Heap* heap_ 340 + kPointerSize // Heap* heap_
341 + kIntptrSize // intptr_t progress_bar_ 341 + kIntptrSize // intptr_t progress_bar_
342 + kIntptrSize // intptr_t live_byte_count_ 342 + kIntptrSize // intptr_t live_byte_count_
343 + kPointerSize * NUMBER_OF_REMEMBERED_SET_TYPES // SlotSet* array 343 + kPointerSize * NUMBER_OF_REMEMBERED_SET_TYPES // SlotSet* array
344 + kPointerSize * NUMBER_OF_REMEMBERED_SET_TYPES // TypedSlotSet* array 344 + kPointerSize * NUMBER_OF_REMEMBERED_SET_TYPES // TypedSlotSet* array
345 + kPointerSize // SkipList* skip_list_ 345 + kPointerSize // SkipList* skip_list_
346 + kPointerSize // AtomicValue high_water_mark_ 346 + kPointerSize // AtomicValue high_water_mark_
347 + kPointerSize // base::Mutex* mutex_ 347 + kPointerSize // base::RecursiveMutex* mutex_
348 + kPointerSize // base::AtomicWord concurrent_sweeping_ 348 + kPointerSize // base::AtomicWord concurrent_sweeping_
349 + 2 * kSizetSize // AtomicNumber free-list statistics 349 + 2 * kSizetSize // AtomicNumber free-list statistics
350 + kPointerSize // AtomicValue next_chunk_ 350 + kPointerSize // AtomicValue next_chunk_
351 + kPointerSize // AtomicValue prev_chunk_ 351 + kPointerSize // AtomicValue prev_chunk_
352 + FreeListCategory::kSize * kNumberOfCategories 352 + FreeListCategory::kSize * kNumberOfCategories
353 // FreeListCategory categories_[kNumberOfCategories] 353 // FreeListCategory categories_[kNumberOfCategories]
354 + kPointerSize // LocalArrayBufferTracker* local_tracker_ 354 + kPointerSize // LocalArrayBufferTracker* local_tracker_
355 + kIntptrSize // intptr_t young_generation_live_byte_count_ 355 + kIntptrSize // intptr_t young_generation_live_byte_count_
356 + kPointerSize; // Bitmap* young_generation_bitmap_ 356 + kPointerSize; // Bitmap* young_generation_bitmap_
357 357
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 } while ((new_mark > old_mark) && 397 } while ((new_mark > old_mark) &&
398 !chunk->high_water_mark_.TrySetValue(old_mark, new_mark)); 398 !chunk->high_water_mark_.TrySetValue(old_mark, new_mark));
399 } 399 }
400 400
401 static bool IsValid(MemoryChunk* chunk) { return chunk != nullptr; } 401 static bool IsValid(MemoryChunk* chunk) { return chunk != nullptr; }
402 402
403 Address address() const { 403 Address address() const {
404 return reinterpret_cast<Address>(const_cast<MemoryChunk*>(this)); 404 return reinterpret_cast<Address>(const_cast<MemoryChunk*>(this));
405 } 405 }
406 406
407 base::Mutex* mutex() { return mutex_; } 407 base::RecursiveMutex* mutex() { return mutex_; }
408 408
409 bool Contains(Address addr) { 409 bool Contains(Address addr) {
410 return addr >= area_start() && addr < area_end(); 410 return addr >= area_start() && addr < area_end();
411 } 411 }
412 412
413 // Checks whether |addr| can be a limit of addresses in this page. It's a 413 // Checks whether |addr| can be a limit of addresses in this page. It's a
414 // limit if it's in the page, or if it's just after the last byte of the page. 414 // limit if it's in the page, or if it's just after the last byte of the page.
415 bool ContainsLimit(Address addr) { 415 bool ContainsLimit(Address addr) {
416 return addr >= area_start() && addr <= area_end(); 416 return addr >= area_start() && addr <= area_end();
417 } 417 }
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 base::AtomicValue<SlotSet*> slot_set_[NUMBER_OF_REMEMBERED_SET_TYPES]; 606 base::AtomicValue<SlotSet*> slot_set_[NUMBER_OF_REMEMBERED_SET_TYPES];
607 base::AtomicValue<TypedSlotSet*> 607 base::AtomicValue<TypedSlotSet*>
608 typed_slot_set_[NUMBER_OF_REMEMBERED_SET_TYPES]; 608 typed_slot_set_[NUMBER_OF_REMEMBERED_SET_TYPES];
609 609
610 SkipList* skip_list_; 610 SkipList* skip_list_;
611 611
612 // Assuming the initial allocation on a page is sequential, 612 // Assuming the initial allocation on a page is sequential,
613 // count highest number of bytes ever allocated on the page. 613 // count highest number of bytes ever allocated on the page.
614 base::AtomicValue<intptr_t> high_water_mark_; 614 base::AtomicValue<intptr_t> high_water_mark_;
615 615
616 base::Mutex* mutex_; 616 base::RecursiveMutex* mutex_;
617 617
618 base::AtomicValue<ConcurrentSweepingState> concurrent_sweeping_; 618 base::AtomicValue<ConcurrentSweepingState> concurrent_sweeping_;
619 619
620 // PagedSpace free-list statistics. 620 // PagedSpace free-list statistics.
621 base::AtomicNumber<intptr_t> available_in_free_list_; 621 base::AtomicNumber<intptr_t> available_in_free_list_;
622 base::AtomicNumber<intptr_t> wasted_memory_; 622 base::AtomicNumber<intptr_t> wasted_memory_;
623 623
624 // next_chunk_ holds a pointer of type MemoryChunk 624 // next_chunk_ holds a pointer of type MemoryChunk
625 base::AtomicValue<MemoryChunk*> next_chunk_; 625 base::AtomicValue<MemoryChunk*> next_chunk_;
626 // prev_chunk_ holds a pointer of type MemoryChunk 626 // prev_chunk_ holds a pointer of type MemoryChunk
(...skipping 2324 matching lines...) Expand 10 before | Expand all | Expand 10 after
2951 PageIterator old_iterator_; 2951 PageIterator old_iterator_;
2952 PageIterator code_iterator_; 2952 PageIterator code_iterator_;
2953 PageIterator map_iterator_; 2953 PageIterator map_iterator_;
2954 LargePageIterator lo_iterator_; 2954 LargePageIterator lo_iterator_;
2955 }; 2955 };
2956 2956
2957 } // namespace internal 2957 } // namespace internal
2958 } // namespace v8 2958 } // namespace v8
2959 2959
2960 #endif // V8_HEAP_SPACES_H_ 2960 #endif // V8_HEAP_SPACES_H_
OLDNEW
« 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