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

Unified Diff: src/heap/mark-compact.cc

Issue 957273002: Remove slots that point to unboxed doubles from the StoreBuffer/SlotsBuffer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: StoreBuffer issue addressed Created 5 years, 10 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/mark-compact.h ('k') | src/heap/spaces.h » ('j') | src/heap/spaces.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index 77d084266264fbd78f56bc16115818a92b223ff4..be9f9a971c8fdd513f8138b7ef4c9714734bd7f8 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -712,6 +712,7 @@ void MarkCompactCollector::CollectEvacuationCandidates(PagedSpace* space) {
int count = 0;
int fragmentation = 0;
+ int page_number = 0;
Candidate* least = NULL;
PageIterator it(space);
@@ -726,9 +727,16 @@ void MarkCompactCollector::CollectEvacuationCandidates(PagedSpace* space) {
CHECK(p->slots_buffer() == NULL);
if (FLAG_stress_compaction) {
- unsigned int counter = space->heap()->ms_count();
- uintptr_t page_number = reinterpret_cast<uintptr_t>(p) >> kPageSizeBits;
- if ((counter & 1) == (page_number & 1)) fragmentation = 1;
+ if (FLAG_manual_evacuation_candidates_selection) {
+ if (p->IsFlagSet(MemoryChunk::FORCE_EVACUATION_CANDIDATE_FOR_TESTING)) {
+ p->ClearFlag(MemoryChunk::FORCE_EVACUATION_CANDIDATE_FOR_TESTING);
+ fragmentation = 1;
+ }
+ } else {
+ unsigned int counter = space->heap()->ms_count();
+ if ((counter & 1) == (page_number & 1)) fragmentation = 1;
+ page_number++;
+ }
} else if (mode == REDUCE_MEMORY_FOOTPRINT) {
// Don't try to release too many pages.
if (estimated_release >= over_reserved) {
@@ -4281,6 +4289,40 @@ bool SlotsBuffer::AddTo(SlotsBufferAllocator* allocator,
}
+void SlotsBuffer::RemoveSlot(SlotsBuffer* buffer, ObjectSlot slot_to_remove) {
Hannes Payer (out of office) 2015/03/03 09:48:53 I think it would be more efficient to just clear t
Igor Sheludko 2015/03/04 14:54:19 Done.
+ DCHECK(!IsTypedSlot(slot_to_remove));
+ while (buffer != NULL) {
+ intptr_t written = 0;
+ intptr_t length = buffer->idx_;
+
+ ObjectSlot* slots = buffer->slots_;
+ for (int slot_idx = 0; slot_idx < length; ++slot_idx) {
+ ObjectSlot slot = slots[slot_idx];
+ if (!IsTypedSlot(slot)) {
+ if (slot != slot_to_remove) {
+ if (written != slot_idx) slots[written] = slot;
+ ++written;
+ }
+ } else {
+ ++slot_idx;
+ DCHECK(slot_idx < length);
+ ObjectSlot typed_slot = slots[slot_idx];
+ if (typed_slot != slot_to_remove) {
+ if (written != slot_idx - 1) {
+ slots[written++] = slot;
+ slots[written++] = typed_slot;
+ } else {
+ written += 2;
+ }
+ }
+ }
+ }
+ buffer->idx_ = written;
+ buffer = buffer->next_;
+ }
+}
+
+
static inline SlotsBuffer::SlotType SlotTypeForRMode(RelocInfo::Mode rmode) {
if (RelocInfo::IsCodeTarget(rmode)) {
return SlotsBuffer::CODE_TARGET_SLOT;
« no previous file with comments | « src/heap/mark-compact.h ('k') | src/heap/spaces.h » ('j') | src/heap/spaces.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698