Chromium Code Reviews

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

Issue 2453673003: [heap] Concurrent store buffer processing. (Closed)
Patch Set: cleanup Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « no previous file | src/heap/mark-compact.cc » ('j') | src/heap/mark-compact.cc » ('J')
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 #include "src/heap/heap.h" 5 #include "src/heap/heap.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/ast/context-slot-cache.h" 9 #include "src/ast/context-slot-cache.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 422 matching lines...)
433 ReportStatisticsBeforeGC(); 433 ReportStatisticsBeforeGC();
434 #endif // DEBUG 434 #endif // DEBUG
435 435
436 if (new_space_->IsAtMaximumCapacity()) { 436 if (new_space_->IsAtMaximumCapacity()) {
437 maximum_size_scavenges_++; 437 maximum_size_scavenges_++;
438 } else { 438 } else {
439 maximum_size_scavenges_ = 0; 439 maximum_size_scavenges_ = 0;
440 } 440 }
441 CheckNewSpaceExpansionCriteria(); 441 CheckNewSpaceExpansionCriteria();
442 UpdateNewSpaceAllocationCounter(); 442 UpdateNewSpaceAllocationCounter();
443 store_buffer()->MoveEntriesToRememberedSet(); 443 store_buffer()->MoveAllEntriesToRememberedSet();
444 } 444 }
445 445
446 446
447 intptr_t Heap::SizeOfObjects() { 447 intptr_t Heap::SizeOfObjects() {
448 intptr_t total = 0; 448 intptr_t total = 0;
449 AllSpaces spaces(this); 449 AllSpaces spaces(this);
450 for (Space* space = spaces.next(); space != NULL; space = spaces.next()) { 450 for (Space* space = spaces.next(); space != NULL; space = spaces.next()) {
451 total += space->SizeOfObjects(); 451 total += space->SizeOfObjects();
452 } 452 }
453 return total; 453 return total;
(...skipping 5445 matching lines...)
5899 }; 5899 };
5900 5900
5901 5901
5902 void Heap::CheckHandleCount() { 5902 void Heap::CheckHandleCount() {
5903 CheckHandleCountVisitor v; 5903 CheckHandleCountVisitor v;
5904 isolate_->handle_scope_implementer()->Iterate(&v); 5904 isolate_->handle_scope_implementer()->Iterate(&v);
5905 } 5905 }
5906 5906
5907 void Heap::ClearRecordedSlot(HeapObject* object, Object** slot) { 5907 void Heap::ClearRecordedSlot(HeapObject* object, Object** slot) {
5908 if (!InNewSpace(object)) { 5908 if (!InNewSpace(object)) {
5909 store_buffer()->MoveEntriesToRememberedSet();
5910 Address slot_addr = reinterpret_cast<Address>(slot); 5909 Address slot_addr = reinterpret_cast<Address>(slot);
5911 Page* page = Page::FromAddress(slot_addr); 5910 Page* page = Page::FromAddress(slot_addr);
5912 DCHECK_EQ(page->owner()->identity(), OLD_SPACE); 5911 DCHECK_EQ(page->owner()->identity(), OLD_SPACE);
5913 RememberedSet<OLD_TO_NEW>::Remove(page, slot_addr); 5912 store_buffer()->DeleteEntry(slot_addr);
5914 RememberedSet<OLD_TO_OLD>::Remove(page, slot_addr); 5913 RememberedSet<OLD_TO_OLD>::Remove(page, slot_addr);
5915 } 5914 }
5916 } 5915 }
5917 5916
5918 void Heap::ClearRecordedSlotRange(Address start, Address end) { 5917 void Heap::ClearRecordedSlotRange(Address start, Address end) {
5919 Page* page = Page::FromAddress(start); 5918 Page* page = Page::FromAddress(start);
5920 if (!page->InNewSpace()) { 5919 if (!page->InNewSpace()) {
5921 store_buffer()->MoveEntriesToRememberedSet();
5922 DCHECK_EQ(page->owner()->identity(), OLD_SPACE); 5920 DCHECK_EQ(page->owner()->identity(), OLD_SPACE);
5923 RememberedSet<OLD_TO_NEW>::RemoveRange(page, start, end, 5921 store_buffer()->DeleteEntry(start, end);
5924 SlotSet::PREFREE_EMPTY_BUCKETS);
5925 RememberedSet<OLD_TO_OLD>::RemoveRange(page, start, end, 5922 RememberedSet<OLD_TO_OLD>::RemoveRange(page, start, end,
5926 SlotSet::FREE_EMPTY_BUCKETS); 5923 SlotSet::FREE_EMPTY_BUCKETS);
5927 } 5924 }
5928 } 5925 }
5929 5926
5930 void Heap::RecordWriteIntoCodeSlow(Code* host, RelocInfo* rinfo, 5927 void Heap::RecordWriteIntoCodeSlow(Code* host, RelocInfo* rinfo,
5931 Object* value) { 5928 Object* value) {
5932 DCHECK(InNewSpace(value)); 5929 DCHECK(InNewSpace(value));
5933 Page* source_page = Page::FromAddress(reinterpret_cast<Address>(host)); 5930 Page* source_page = Page::FromAddress(reinterpret_cast<Address>(host));
5934 RelocInfo::Mode rmode = rinfo->rmode(); 5931 RelocInfo::Mode rmode = rinfo->rmode();
(...skipping 552 matching lines...)
6487 } 6484 }
6488 6485
6489 6486
6490 // static 6487 // static
6491 int Heap::GetStaticVisitorIdForMap(Map* map) { 6488 int Heap::GetStaticVisitorIdForMap(Map* map) {
6492 return StaticVisitorBase::GetVisitorId(map); 6489 return StaticVisitorBase::GetVisitorId(map);
6493 } 6490 }
6494 6491
6495 } // namespace internal 6492 } // namespace internal
6496 } // namespace v8 6493 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/heap/mark-compact.cc » ('j') | src/heap/mark-compact.cc » ('J')

Powered by Google App Engine