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

Unified Diff: src/heap/objects-visiting.h

Issue 1844413002: Use EmbedderHeapTracer instead of object grouping when trace_embedder_heap flag is set (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Move logic from heap to mark compact Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/heap/objects-visiting.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/objects-visiting.h
diff --git a/src/heap/objects-visiting.h b/src/heap/objects-visiting.h
index 1fe8a1749adc1cae356e2c6d30c6943a471142c0..4be40cd03fe6b7372de03672f1acb717a7a048a0 100644
--- a/src/heap/objects-visiting.h
+++ b/src/heap/objects-visiting.h
@@ -58,6 +58,15 @@ class StaticVisitorBase : public AllStatic {
V(JSObject8) \
V(JSObject9) \
V(JSObjectGeneric) \
+ V(JSApiObject2) \
+ V(JSApiObject3) \
+ V(JSApiObject4) \
+ V(JSApiObject5) \
+ V(JSApiObject6) \
+ V(JSApiObject7) \
+ V(JSApiObject8) \
+ V(JSApiObject9) \
+ V(JSApiObjectGeneric) \
V(Struct2) \
V(Struct3) \
V(Struct4) \
@@ -96,9 +105,10 @@ class StaticVisitorBase : public AllStatic {
#define VISITOR_ID_ENUM_DECL(id) kVisit##id,
VISITOR_ID_LIST(VISITOR_ID_ENUM_DECL)
#undef VISITOR_ID_ENUM_DECL
- kVisitorIdCount,
+ kVisitorIdCount,
kVisitDataObject = kVisitDataObject2,
kVisitJSObject = kVisitJSObject2,
+ kVisitJSApiObject = kVisitJSApiObject2,
kVisitStruct = kVisitStruct2,
};
@@ -119,11 +129,12 @@ class StaticVisitorBase : public AllStatic {
int object_size,
bool has_unboxed_fields) {
DCHECK((base == kVisitDataObject) || (base == kVisitStruct) ||
- (base == kVisitJSObject));
+ (base == kVisitJSObject) || (base == kVisitJSApiObject));
DCHECK(IsAligned(object_size, kPointerSize));
DCHECK(Heap::kMinObjectSizeInWords * kPointerSize <= object_size);
DCHECK(object_size <= Page::kMaxRegularHeapObjectSize);
- DCHECK(!has_unboxed_fields || (base == kVisitJSObject));
+ DCHECK(!has_unboxed_fields || (base == kVisitJSObject) ||
+ (base == kVisitJSApiObject));
if (has_unboxed_fields) return generic;
@@ -400,6 +411,28 @@ class StaticMarkingVisitor : public StaticVisitorBase {
typedef FlexibleBodyVisitor<StaticVisitor, JSObject::BodyDescriptor, void>
JSObjectVisitor;
+ class JSApiObjectVisitor : AllStatic {
+ public:
+ template <int size>
+ static inline void VisitSpecialized(Map* map, HeapObject* object) {
+ TracePossibleWrapper(object);
+ JSObjectVisitor::template VisitSpecialized<size>(map, object);
+ }
+
+ INLINE(static void Visit(Map* map, HeapObject* object)) {
+ TracePossibleWrapper(object);
+ JSObjectVisitor::Visit(map, object);
+ }
+
+ private:
+ INLINE(static void TracePossibleWrapper(HeapObject* object)) {
+ if (object->GetHeap()->UsingEmbedderHeapTracer()) {
+ DCHECK(object->IsJSObject());
+ object->GetHeap()->TracePossibleWrapper(JSObject::cast(object));
+ }
+ }
+ };
+
typedef FlexibleBodyVisitor<StaticVisitor, StructBodyDescriptor, void>
StructObjectVisitor;
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/heap/objects-visiting.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698