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

Side by Side Diff: src/heap/incremental-marking.cc

Issue 1943423002: Updates incremental marking pass to collect object statistics. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Removed an unnecessary class declaration. Created 4 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.h" 5 #include "src/heap/incremental-marking.h"
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/compilation-cache.h" 8 #include "src/compilation-cache.h"
9 #include "src/conversions.h" 9 #include "src/conversions.h"
10 #include "src/heap/gc-idle-time-handler.h" 10 #include "src/heap/gc-idle-time-handler.h"
11 #include "src/heap/gc-tracer.h" 11 #include "src/heap/gc-tracer.h"
12 #include "src/heap/mark-compact-inl.h" 12 #include "src/heap/mark-compact-inl.h"
13 #include "src/heap/object-stats.h"
14 #include "src/heap/objects-visiting-inl.h"
13 #include "src/heap/objects-visiting.h" 15 #include "src/heap/objects-visiting.h"
14 #include "src/heap/objects-visiting-inl.h"
15 #include "src/tracing/trace-event.h" 16 #include "src/tracing/trace-event.h"
16 #include "src/v8.h" 17 #include "src/v8.h"
17 18
18 namespace v8 { 19 namespace v8 {
19 namespace internal { 20 namespace internal {
20 21
21 IncrementalMarking::StepActions IncrementalMarking::IdleStepActions() { 22 IncrementalMarking::StepActions IncrementalMarking::IdleStepActions() {
22 return StepActions(IncrementalMarking::NO_GC_VIA_STACK_GUARD, 23 return StepActions(IncrementalMarking::NO_GC_VIA_STACK_GUARD,
23 IncrementalMarking::FORCE_MARKING, 24 IncrementalMarking::FORCE_MARKING,
24 IncrementalMarking::DO_NOT_FORCE_COMPLETION); 25 IncrementalMarking::DO_NOT_FORCE_COMPLETION);
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 169
169 170
170 class IncrementalMarkingMarkingVisitor 171 class IncrementalMarkingMarkingVisitor
171 : public StaticMarkingVisitor<IncrementalMarkingMarkingVisitor> { 172 : public StaticMarkingVisitor<IncrementalMarkingMarkingVisitor> {
172 public: 173 public:
173 static void Initialize() { 174 static void Initialize() {
174 StaticMarkingVisitor<IncrementalMarkingMarkingVisitor>::Initialize(); 175 StaticMarkingVisitor<IncrementalMarkingMarkingVisitor>::Initialize();
175 table_.Register(kVisitFixedArray, &VisitFixedArrayIncremental); 176 table_.Register(kVisitFixedArray, &VisitFixedArrayIncremental);
176 table_.Register(kVisitNativeContext, &VisitNativeContextIncremental); 177 table_.Register(kVisitNativeContext, &VisitNativeContextIncremental);
177 table_.Register(kVisitJSRegExp, &VisitJSRegExp); 178 table_.Register(kVisitJSRegExp, &VisitJSRegExp);
179 if (FLAG_track_gc_object_stats) {
180 IncrementalMarkingObjectStatsVisitor::Initialize(&table_);
181 }
178 } 182 }
179 183
180 static const int kProgressBarScanningChunk = 32 * 1024; 184 static const int kProgressBarScanningChunk = 32 * 1024;
181 185
182 static void VisitFixedArrayIncremental(Map* map, HeapObject* object) { 186 static void VisitFixedArrayIncremental(Map* map, HeapObject* object) {
183 MemoryChunk* chunk = MemoryChunk::FromAddress(object->address()); 187 MemoryChunk* chunk = MemoryChunk::FromAddress(object->address());
184 // TODO(mstarzinger): Move setting of the flag to the allocation site of 188 // TODO(mstarzinger): Move setting of the flag to the allocation site of
185 // the array. The visitor should just check the flag. 189 // the array. The visitor should just check the flag.
186 if (FLAG_use_marking_progress_bar && 190 if (FLAG_use_marking_progress_bar &&
187 chunk->owner()->identity() == LO_SPACE) { 191 chunk->owner()->identity() == LO_SPACE) {
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after
1240 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { 1244 void IncrementalMarking::IncrementIdleMarkingDelayCounter() {
1241 idle_marking_delay_counter_++; 1245 idle_marking_delay_counter_++;
1242 } 1246 }
1243 1247
1244 1248
1245 void IncrementalMarking::ClearIdleMarkingDelayCounter() { 1249 void IncrementalMarking::ClearIdleMarkingDelayCounter() {
1246 idle_marking_delay_counter_ = 0; 1250 idle_marking_delay_counter_ = 0;
1247 } 1251 }
1248 } // namespace internal 1252 } // namespace internal
1249 } // namespace v8 1253 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/mark-compact.cc » ('j') | src/heap/mark-compact.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698