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

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

Issue 2469273002: [heap] Exclude the owner of the linear allocation area from evacuation. (Closed)
Patch Set: Created 4 years, 1 month 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/spaces.h ('k') | test/cctest/heap/heap-utils.h » ('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 #include "src/heap/spaces.h" 5 #include "src/heap/spaces.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 2781 matching lines...) Expand 10 before | Expand all | Expand 10 after
2792 size_t size = page->wasted_memory(); 2792 size_t size = page->wasted_memory();
2793 if (size == 0) continue; 2793 if (size == 0) continue;
2794 DCHECK_GE(static_cast<size_t>(Page::kPageSize), size); 2794 DCHECK_GE(static_cast<size_t>(Page::kPageSize), size);
2795 Address address = page->OffsetToAddress(Page::kPageSize - size); 2795 Address address = page->OffsetToAddress(Page::kPageSize - size);
2796 heap()->CreateFillerObjectAt(address, static_cast<int>(size), 2796 heap()->CreateFillerObjectAt(address, static_cast<int>(size),
2797 ClearRecordedSlots::kNo); 2797 ClearRecordedSlots::kNo);
2798 } 2798 }
2799 } 2799 }
2800 2800
2801 2801
2802 void PagedSpace::EvictEvacuationCandidatesFromLinearAllocationArea() {
2803 if (allocation_info_.top() >= allocation_info_.limit()) return;
2804
2805 if (!Page::FromAllocationAreaAddress(allocation_info_.top())->CanAllocate()) {
2806 // Create filler object to keep page iterable if it was iterable.
2807 int remaining =
2808 static_cast<int>(allocation_info_.limit() - allocation_info_.top());
2809 heap()->CreateFillerObjectAt(allocation_info_.top(), remaining,
2810 ClearRecordedSlots::kNo);
2811 allocation_info_.Reset(nullptr, nullptr);
2812 }
2813 }
2814
2815
2816 HeapObject* PagedSpace::SweepAndRetryAllocation(int size_in_bytes) { 2802 HeapObject* PagedSpace::SweepAndRetryAllocation(int size_in_bytes) {
2817 MarkCompactCollector* collector = heap()->mark_compact_collector(); 2803 MarkCompactCollector* collector = heap()->mark_compact_collector();
2818 if (collector->sweeping_in_progress()) { 2804 if (collector->sweeping_in_progress()) {
2819 // Wait for the sweeper threads here and complete the sweeping phase. 2805 // Wait for the sweeper threads here and complete the sweeping phase.
2820 collector->EnsureSweepingCompleted(); 2806 collector->EnsureSweepingCompleted();
2821 2807
2822 // After waiting for the sweeper threads, there may be new free-list 2808 // After waiting for the sweeper threads, there may be new free-list
2823 // entries. 2809 // entries.
2824 return free_list_.Allocate(size_in_bytes); 2810 return free_list_.Allocate(size_in_bytes);
2825 } 2811 }
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
3245 object->ShortPrint(); 3231 object->ShortPrint();
3246 PrintF("\n"); 3232 PrintF("\n");
3247 } 3233 }
3248 printf(" --------------------------------------\n"); 3234 printf(" --------------------------------------\n");
3249 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 3235 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
3250 } 3236 }
3251 3237
3252 #endif // DEBUG 3238 #endif // DEBUG
3253 } // namespace internal 3239 } // namespace internal
3254 } // namespace v8 3240 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/spaces.h ('k') | test/cctest/heap/heap-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698