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

Side by Side Diff: src/heap/objects-visiting.cc

Issue 890663005: Introduce a flag for tracing retaining path in GC. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 unified diff | Download patch
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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/heap/objects-visiting.h" 7 #include "src/heap/objects-visiting.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 // We don't record weak slots during marking or scavenges. Instead we do it 179 // We don't record weak slots during marking or scavenges. Instead we do it
180 // once when we complete mark-compact cycle. Note that write barrier has no 180 // once when we complete mark-compact cycle. Note that write barrier has no
181 // effect if we are already in the middle of compacting mark-sweep cycle and we 181 // effect if we are already in the middle of compacting mark-sweep cycle and we
182 // have to record slots manually. 182 // have to record slots manually.
183 static bool MustRecordSlots(Heap* heap) { 183 static bool MustRecordSlots(Heap* heap) {
184 return heap->gc_state() == Heap::MARK_COMPACT && 184 return heap->gc_state() == Heap::MARK_COMPACT &&
185 heap->mark_compact_collector()->is_compacting(); 185 heap->mark_compact_collector()->is_compacting();
186 } 186 }
187 187
188 188
189 #ifdef TRACE_RETAINING_PATH
190 void SetCurrentRetainer(HeapObject* obj) {
191 obj->GetHeap()->SetCurrentRetainer(obj);
192 }
193
194
195 void ResetCurrentRetainer(HeapObject* obj) {
196 obj->GetHeap()->SetCurrentRetainer(NULL);
197 }
198 #endif
199
189 template <class T> 200 template <class T>
190 struct WeakListVisitor; 201 struct WeakListVisitor;
191 202
192 203
193 template <class T> 204 template <class T>
194 Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer) { 205 Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer) {
195 Object* undefined = heap->undefined_value(); 206 Object* undefined = heap->undefined_value();
196 Object* head = undefined; 207 Object* head = undefined;
197 T* tail = NULL; 208 T* tail = NULL;
198 MarkCompactCollector* collector = heap->mark_compact_collector(); 209 MarkCompactCollector* collector = heap->mark_compact_collector();
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 423
413 424
414 template Object* VisitWeakList<JSArrayBuffer>(Heap* heap, Object* list, 425 template Object* VisitWeakList<JSArrayBuffer>(Heap* heap, Object* list,
415 WeakObjectRetainer* retainer); 426 WeakObjectRetainer* retainer);
416 427
417 428
418 template Object* VisitWeakList<AllocationSite>(Heap* heap, Object* list, 429 template Object* VisitWeakList<AllocationSite>(Heap* heap, Object* list,
419 WeakObjectRetainer* retainer); 430 WeakObjectRetainer* retainer);
420 } 431 }
421 } // namespace v8::internal 432 } // namespace v8::internal
OLDNEW
« src/heap/heap.cc ('K') | « src/heap/objects-visiting.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698