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

Unified Diff: src/objects-body-descriptors-inl.h

Issue 2808093003: [heap] Introduce HeapVisitor interface. (Closed)
Patch Set: fix compile error Created 3 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
« src/heap/objects-visiting.h ('K') | « src/objects-body-descriptors.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-body-descriptors-inl.h
diff --git a/src/objects-body-descriptors-inl.h b/src/objects-body-descriptors-inl.h
index e7f9736000e60f032ee9c3d1babf968adc2f9be8..841997d773321d480475886bccdb9892bba317af 100644
--- a/src/objects-body-descriptors-inl.h
+++ b/src/objects-body-descriptors-inl.h
@@ -239,6 +239,22 @@ class JSArrayBuffer::BodyDescriptor final : public BodyDescriptorBase {
}
};
+class ByteArray::BodyDescriptor final : public BodyDescriptorBase {
+ public:
+ static bool IsValidSlot(HeapObject* obj, int offset) { return false; }
+
+ template <typename ObjectVisitor>
+ static inline void IterateBody(HeapObject* obj, int object_size,
+ ObjectVisitor* v) {}
+
+ template <typename StaticVisitor>
+ static inline void IterateBody(HeapObject* obj, int object_size) {}
+
+ static inline int SizeOf(Map* map, HeapObject* obj) {
+ return reinterpret_cast<ByteArray*>(obj)->ByteArraySize();
+ }
+};
+
class BytecodeArray::BodyDescriptor final : public BodyDescriptorBase {
public:
static bool IsValidSlot(HeapObject* obj, int offset) {
@@ -267,6 +283,23 @@ class BytecodeArray::BodyDescriptor final : public BodyDescriptorBase {
}
};
+class FixedDoubleArray::BodyDescriptor final : public BodyDescriptorBase {
+ public:
+ static bool IsValidSlot(HeapObject* obj, int offset) { return false; }
+
+ template <typename ObjectVisitor>
+ static inline void IterateBody(HeapObject* obj, int object_size,
+ ObjectVisitor* v) {}
+
+ template <typename StaticVisitor>
+ static inline void IterateBody(HeapObject* obj, int object_size) {}
+
+ static inline int SizeOf(Map* map, HeapObject* obj) {
+ return FixedDoubleArray::SizeFor(
+ reinterpret_cast<FixedDoubleArray*>(obj)->length());
+ }
+};
+
class FixedTypedArrayBase::BodyDescriptor final : public BodyDescriptorBase {
public:
static bool IsValidSlot(HeapObject* obj, int offset) {
@@ -459,6 +492,39 @@ class Code::BodyDescriptor final : public BodyDescriptorBase {
}
};
+class SeqOneByteString::BodyDescriptor final : public BodyDescriptorBase {
+ public:
+ static bool IsValidSlot(HeapObject* obj, int offset) { return false; }
+
+ template <typename ObjectVisitor>
+ static inline void IterateBody(HeapObject* obj, int object_size,
+ ObjectVisitor* v) {}
+
+ template <typename StaticVisitor>
+ static inline void IterateBody(HeapObject* obj, int object_size) {}
+
+ static inline int SizeOf(Map* map, HeapObject* obj) {
+ SeqOneByteString* string = SeqOneByteString::cast(obj);
+ return string->SizeFor(string->length());
+ }
+};
+
+class SeqTwoByteString::BodyDescriptor final : public BodyDescriptorBase {
+ public:
+ static bool IsValidSlot(HeapObject* obj, int offset) { return false; }
+
+ template <typename ObjectVisitor>
+ static inline void IterateBody(HeapObject* obj, int object_size,
+ ObjectVisitor* v) {}
+
+ template <typename StaticVisitor>
+ static inline void IterateBody(HeapObject* obj, int object_size) {}
+
+ static inline int SizeOf(Map* map, HeapObject* obj) {
+ SeqTwoByteString* string = SeqTwoByteString::cast(obj);
+ return string->SizeFor(string->length());
+ }
+};
template <typename Op, typename ReturnType, typename T1, typename T2,
typename T3>
« src/heap/objects-visiting.h ('K') | « src/objects-body-descriptors.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698