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

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

Issue 2576453002: [heap] Create a thin wrapper around wrapper tracing in V8 to avoid misuse (Closed)
Patch Set: Include Created 4 years 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/mark-compact.cc ('k') | src/v8.gyp » ('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 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 #ifndef V8_OBJECTS_VISITING_H_ 5 #ifndef V8_OBJECTS_VISITING_H_
6 #define V8_OBJECTS_VISITING_H_ 6 #define V8_OBJECTS_VISITING_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/heap/embedder-tracing.h"
9 #include "src/heap/heap.h" 10 #include "src/heap/heap.h"
10 #include "src/heap/spaces.h" 11 #include "src/heap/spaces.h"
11 #include "src/layout-descriptor.h" 12 #include "src/layout-descriptor.h"
12 #include "src/objects-body-descriptors.h" 13 #include "src/objects-body-descriptors.h"
13 14
14 // This file provides base classes and auxiliary methods for defining 15 // This file provides base classes and auxiliary methods for defining
15 // static object visitors used during GC. 16 // static object visitors used during GC.
16 // Visiting HeapObject body with a normal ObjectVisitor requires performing 17 // Visiting HeapObject body with a normal ObjectVisitor requires performing
17 // two switches on object's instance type to determine object size and layout 18 // two switches on object's instance type to determine object size and layout
18 // and one or more virtual method calls on visitor itself. 19 // and one or more virtual method calls on visitor itself.
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 JSObjectVisitor::template VisitSpecialized<size>(map, object); 418 JSObjectVisitor::template VisitSpecialized<size>(map, object);
418 } 419 }
419 420
420 INLINE(static void Visit(Map* map, HeapObject* object)) { 421 INLINE(static void Visit(Map* map, HeapObject* object)) {
421 TracePossibleWrapper(object); 422 TracePossibleWrapper(object);
422 JSObjectVisitor::Visit(map, object); 423 JSObjectVisitor::Visit(map, object);
423 } 424 }
424 425
425 private: 426 private:
426 INLINE(static void TracePossibleWrapper(HeapObject* object)) { 427 INLINE(static void TracePossibleWrapper(HeapObject* object)) {
427 if (object->GetHeap()->UsingEmbedderHeapTracer()) { 428 if (object->GetHeap()->local_embedder_heap_tracer()->InUse()) {
428 DCHECK(object->IsJSObject()); 429 DCHECK(object->IsJSObject());
429 object->GetHeap()->TracePossibleWrapper(JSObject::cast(object)); 430 object->GetHeap()->TracePossibleWrapper(JSObject::cast(object));
430 } 431 }
431 } 432 }
432 }; 433 };
433 434
434 typedef FlexibleBodyVisitor<StaticVisitor, StructBodyDescriptor, void> 435 typedef FlexibleBodyVisitor<StaticVisitor, StructBodyDescriptor, void>
435 StructObjectVisitor; 436 StructObjectVisitor;
436 437
437 typedef void (*Callback)(Map* map, HeapObject* object); 438 typedef void (*Callback)(Map* map, HeapObject* object);
(...skipping 14 matching lines...) Expand all
452 // the next element. Given the head of the list, this function removes dead 453 // the next element. Given the head of the list, this function removes dead
453 // elements from the list and if requested records slots for next-element 454 // elements from the list and if requested records slots for next-element
454 // pointers. The template parameter T is a WeakListVisitor that defines how to 455 // pointers. The template parameter T is a WeakListVisitor that defines how to
455 // access the next-element pointers. 456 // access the next-element pointers.
456 template <class T> 457 template <class T>
457 Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer); 458 Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer);
458 } // namespace internal 459 } // namespace internal
459 } // namespace v8 460 } // namespace v8
460 461
461 #endif // V8_OBJECTS_VISITING_H_ 462 #endif // V8_OBJECTS_VISITING_H_
OLDNEW
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698