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

Side by Side Diff: src/heap/incremental-marking-job.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
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/incremental-marking-job.h" 5 #include "src/heap/incremental-marking-job.h"
6 6
7 #include "src/base/platform/time.h" 7 #include "src/base/platform/time.h"
8 #include "src/heap/heap-inl.h" 8 #include "src/heap/heap-inl.h"
9 #include "src/heap/heap.h" 9 #include "src/heap/heap.h"
10 #include "src/heap/incremental-marking.h" 10 #include "src/heap/incremental-marking.h"
(...skipping 24 matching lines...) Expand all
35 double deadline = 35 double deadline =
36 heap->MonotonicallyIncreasingTimeInMs() + kIncrementalMarkingDelayMs; 36 heap->MonotonicallyIncreasingTimeInMs() + kIncrementalMarkingDelayMs;
37 heap->incremental_marking()->AdvanceIncrementalMarking( 37 heap->incremental_marking()->AdvanceIncrementalMarking(
38 deadline, i::IncrementalMarking::NO_GC_VIA_STACK_GUARD, 38 deadline, i::IncrementalMarking::NO_GC_VIA_STACK_GUARD,
39 i::IncrementalMarking::FORCE_COMPLETION, i::StepOrigin::kTask); 39 i::IncrementalMarking::FORCE_COMPLETION, i::StepOrigin::kTask);
40 heap->FinalizeIncrementalMarkingIfComplete( 40 heap->FinalizeIncrementalMarkingIfComplete(
41 GarbageCollectionReason::kFinalizeMarkingViaTask); 41 GarbageCollectionReason::kFinalizeMarkingViaTask);
42 } 42 }
43 43
44 void IncrementalMarkingJob::Task::RunInternal() { 44 void IncrementalMarkingJob::Task::RunInternal() {
45 VMState<GC> state(isolate());
46 RuntimeCallTimerScope(isolate(), &RuntimeCallStats::GC);
47
45 Heap* heap = isolate()->heap(); 48 Heap* heap = isolate()->heap();
46 job_->NotifyTask(); 49 job_->NotifyTask();
47 IncrementalMarking* incremental_marking = heap->incremental_marking(); 50 IncrementalMarking* incremental_marking = heap->incremental_marking();
48 if (incremental_marking->IsStopped()) { 51 if (incremental_marking->IsStopped()) {
49 if (heap->IncrementalMarkingLimitReached() != 52 if (heap->IncrementalMarkingLimitReached() !=
50 Heap::IncrementalMarkingLimit::kNoLimit) { 53 Heap::IncrementalMarkingLimit::kNoLimit) {
51 heap->StartIncrementalMarking(Heap::kNoGCFlags, 54 heap->StartIncrementalMarking(Heap::kNoGCFlags,
52 GarbageCollectionReason::kIdleTask, 55 GarbageCollectionReason::kIdleTask,
53 kNoGCCallbackFlags); 56 kNoGCCallbackFlags);
54 } 57 }
55 } 58 }
56 if (!incremental_marking->IsStopped()) { 59 if (!incremental_marking->IsStopped()) {
57 Step(heap); 60 Step(heap);
58 if (!incremental_marking->IsStopped()) { 61 if (!incremental_marking->IsStopped()) {
59 job_->ScheduleTask(heap); 62 job_->ScheduleTask(heap);
60 } 63 }
61 } 64 }
62 } 65 }
63 66
64 } // namespace internal 67 } // namespace internal
65 } // namespace v8 68 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/spaces.cc » ('j') | src/heap/spaces.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698