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

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

Issue 2861763002: [heap] Add GC accounting to slow allocation and incremental marking job (Closed)
Patch Set: Created 3 years, 7 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/incremental-marking-job.cc ('k') | no next file » | 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 2878 matching lines...) Expand 10 before | Expand all | Expand 10 after
2889 HeapObject* CompactionSpace::SweepAndRetryAllocation(int size_in_bytes) { 2889 HeapObject* CompactionSpace::SweepAndRetryAllocation(int size_in_bytes) {
2890 MarkCompactCollector* collector = heap()->mark_compact_collector(); 2890 MarkCompactCollector* collector = heap()->mark_compact_collector();
2891 if (collector->sweeping_in_progress()) { 2891 if (collector->sweeping_in_progress()) {
2892 collector->SweepAndRefill(this); 2892 collector->SweepAndRefill(this);
2893 return free_list_.Allocate(size_in_bytes); 2893 return free_list_.Allocate(size_in_bytes);
2894 } 2894 }
2895 return nullptr; 2895 return nullptr;
2896 } 2896 }
2897 2897
2898 HeapObject* PagedSpace::SlowAllocateRaw(int size_in_bytes) { 2898 HeapObject* PagedSpace::SlowAllocateRaw(int size_in_bytes) {
2899 // Allocation in this space has failed.
2899 DCHECK_GE(size_in_bytes, 0); 2900 DCHECK_GE(size_in_bytes, 0);
2900 const int kMaxPagesToSweep = 1; 2901 const int kMaxPagesToSweep = 1;
2901 2902
2902 // Allocation in this space has failed. 2903 VMState<GC> state(heap()->isolate());
Michael Lippautz 2017/05/03 15:44:52 I think this is a pretty good estimate here that a
2904 RuntimeCallTimerScope(heap()->isolate(), &RuntimeCallStats::GC);
2903 2905
2904 MarkCompactCollector* collector = heap()->mark_compact_collector(); 2906 MarkCompactCollector* collector = heap()->mark_compact_collector();
2905 // Sweeping is still in progress. 2907 // Sweeping is still in progress.
2906 if (collector->sweeping_in_progress()) { 2908 if (collector->sweeping_in_progress()) {
2907 if (FLAG_concurrent_sweeping && !is_local() && 2909 if (FLAG_concurrent_sweeping && !is_local() &&
2908 !collector->sweeper().AreSweeperTasksRunning()) { 2910 !collector->sweeper().AreSweeperTasksRunning()) {
2909 collector->EnsureSweepingCompleted(); 2911 collector->EnsureSweepingCompleted();
2910 } 2912 }
2911 2913
2912 // First try to refill the free-list, concurrent sweeper threads 2914 // First try to refill the free-list, concurrent sweeper threads
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
3322 PrintF("\n"); 3324 PrintF("\n");
3323 } 3325 }
3324 printf(" --------------------------------------\n"); 3326 printf(" --------------------------------------\n");
3325 printf(" Marked: %x, LiveCount: %" V8PRIdPTR "\n", mark_size, 3327 printf(" Marked: %x, LiveCount: %" V8PRIdPTR "\n", mark_size,
3326 MarkingState::Internal(this).live_bytes()); 3328 MarkingState::Internal(this).live_bytes());
3327 } 3329 }
3328 3330
3329 #endif // DEBUG 3331 #endif // DEBUG
3330 } // namespace internal 3332 } // namespace internal
3331 } // namespace v8 3333 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/incremental-marking-job.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698