Commit 6475ae20 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

Remove left-over handling for StaticVisitors

Bug: chromium:738368
Change-Id: I4867b90c639d8d5315e0caa22285e7ddbdab44f9
Reviewed-on: https://chromium-review.googlesource.com/632682
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47580}
parent f6a83e36
...@@ -179,24 +179,6 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) { ...@@ -179,24 +179,6 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
} }
} }
template<typename StaticVisitor>
void RelocInfo::Visit(Heap* heap) {
RelocInfo::Mode mode = rmode();
if (mode == RelocInfo::EMBEDDED_OBJECT) {
StaticVisitor::VisitEmbeddedPointer(heap, this);
} else if (RelocInfo::IsCodeTarget(mode)) {
StaticVisitor::VisitCodeTarget(heap, this);
} else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
StaticVisitor::VisitExternalReference(this);
} else if (mode == RelocInfo::INTERNAL_REFERENCE) {
StaticVisitor::VisitInternalReference(this);
} else if (RelocInfo::IsRuntimeEntry(mode)) {
StaticVisitor::VisitRuntimeEntry(this);
}
}
Operand::Operand(int32_t immediate, RelocInfo::Mode rmode) { Operand::Operand(int32_t immediate, RelocInfo::Mode rmode) {
rm_ = no_reg; rm_ = no_reg;
value_.immediate = immediate; value_.immediate = immediate;
......
...@@ -837,24 +837,6 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) { ...@@ -837,24 +837,6 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
} }
} }
template<typename StaticVisitor>
void RelocInfo::Visit(Heap* heap) {
RelocInfo::Mode mode = rmode();
if (mode == RelocInfo::EMBEDDED_OBJECT) {
StaticVisitor::VisitEmbeddedPointer(heap, this);
} else if (RelocInfo::IsCodeTarget(mode)) {
StaticVisitor::VisitCodeTarget(heap, this);
} else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
StaticVisitor::VisitExternalReference(this);
} else if (mode == RelocInfo::INTERNAL_REFERENCE) {
StaticVisitor::VisitInternalReference(this);
} else if (RelocInfo::IsRuntimeEntry(mode)) {
StaticVisitor::VisitRuntimeEntry(this);
}
}
LoadStoreOp Assembler::LoadOpFor(const CPURegister& rt) { LoadStoreOp Assembler::LoadOpFor(const CPURegister& rt) {
DCHECK(rt.IsValid()); DCHECK(rt.IsValid());
if (rt.IsRegister()) { if (rt.IsRegister()) {
......
...@@ -596,8 +596,6 @@ class RelocInfo { ...@@ -596,8 +596,6 @@ class RelocInfo {
// reproducible. // reproducible.
INLINE(void WipeOut(Isolate* isolate)); INLINE(void WipeOut(Isolate* isolate));
template<typename StaticVisitor> inline void Visit(Heap* heap);
template <typename ObjectVisitor> template <typename ObjectVisitor>
inline void Visit(Isolate* isolate, ObjectVisitor* v); inline void Visit(Isolate* isolate, ObjectVisitor* v);
......
...@@ -177,26 +177,6 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) { ...@@ -177,26 +177,6 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
} }
} }
template<typename StaticVisitor>
void RelocInfo::Visit(Heap* heap) {
RelocInfo::Mode mode = rmode();
if (mode == RelocInfo::EMBEDDED_OBJECT) {
StaticVisitor::VisitEmbeddedPointer(heap, this);
Assembler::FlushICache(heap->isolate(), pc_, sizeof(Address));
} else if (RelocInfo::IsCodeTarget(mode)) {
StaticVisitor::VisitCodeTarget(heap, this);
} else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
StaticVisitor::VisitExternalReference(this);
} else if (mode == RelocInfo::INTERNAL_REFERENCE) {
StaticVisitor::VisitInternalReference(this);
} else if (IsRuntimeEntry(mode)) {
StaticVisitor::VisitRuntimeEntry(this);
}
}
Immediate::Immediate(int x) { Immediate::Immediate(int x) {
value_.immediate = x; value_.immediate = x;
rmode_ = RelocInfo::NONE32; rmode_ = RelocInfo::NONE32;
......
...@@ -308,25 +308,6 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) { ...@@ -308,25 +308,6 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
} }
} }
template<typename StaticVisitor>
void RelocInfo::Visit(Heap* heap) {
RelocInfo::Mode mode = rmode();
if (mode == RelocInfo::EMBEDDED_OBJECT) {
StaticVisitor::VisitEmbeddedPointer(heap, this);
} else if (RelocInfo::IsCodeTarget(mode)) {
StaticVisitor::VisitCodeTarget(heap, this);
} else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
StaticVisitor::VisitExternalReference(this);
} else if (mode == RelocInfo::INTERNAL_REFERENCE ||
mode == RelocInfo::INTERNAL_REFERENCE_ENCODED) {
StaticVisitor::VisitInternalReference(this);
} else if (RelocInfo::IsRuntimeEntry(mode)) {
StaticVisitor::VisitRuntimeEntry(this);
}
}
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Assembler. // Assembler.
......
...@@ -283,25 +283,6 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) { ...@@ -283,25 +283,6 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
} }
} }
template<typename StaticVisitor>
void RelocInfo::Visit(Heap* heap) {
RelocInfo::Mode mode = rmode();
if (mode == RelocInfo::EMBEDDED_OBJECT) {
StaticVisitor::VisitEmbeddedPointer(heap, this);
} else if (RelocInfo::IsCodeTarget(mode)) {
StaticVisitor::VisitCodeTarget(heap, this);
} else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
StaticVisitor::VisitExternalReference(this);
} else if (mode == RelocInfo::INTERNAL_REFERENCE ||
mode == RelocInfo::INTERNAL_REFERENCE_ENCODED) {
StaticVisitor::VisitInternalReference(this);
} else if (RelocInfo::IsRuntimeEntry(mode)) {
StaticVisitor::VisitRuntimeEntry(this);
}
}
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Assembler. // Assembler.
......
...@@ -54,28 +54,6 @@ void BodyDescriptorBase::IterateBodyImpl(HeapObject* obj, int start_offset, ...@@ -54,28 +54,6 @@ void BodyDescriptorBase::IterateBodyImpl(HeapObject* obj, int start_offset,
} }
} }
template <typename StaticVisitor>
void BodyDescriptorBase::IterateBodyImpl(Heap* heap, HeapObject* obj,
int start_offset, int end_offset) {
if (!FLAG_unbox_double_fields || obj->map()->HasFastPointerLayout()) {
IteratePointers<StaticVisitor>(heap, obj, start_offset, end_offset);
} else {
DCHECK(FLAG_unbox_double_fields);
DCHECK(IsAligned(start_offset, kPointerSize) &&
IsAligned(end_offset, kPointerSize));
LayoutDescriptorHelper helper(obj->map());
DCHECK(!helper.all_fields_tagged());
for (int offset = start_offset; offset < end_offset;) {
int end_of_region_offset;
if (helper.IsTagged(offset, end_offset, &end_of_region_offset)) {
IteratePointers<StaticVisitor>(heap, obj, offset, end_of_region_offset);
}
offset = end_of_region_offset;
}
}
}
template <typename ObjectVisitor> template <typename ObjectVisitor>
DISABLE_CFI_PERF void BodyDescriptorBase::IteratePointers(HeapObject* obj, DISABLE_CFI_PERF void BodyDescriptorBase::IteratePointers(HeapObject* obj,
int start_offset, int start_offset,
...@@ -85,28 +63,12 @@ DISABLE_CFI_PERF void BodyDescriptorBase::IteratePointers(HeapObject* obj, ...@@ -85,28 +63,12 @@ DISABLE_CFI_PERF void BodyDescriptorBase::IteratePointers(HeapObject* obj,
HeapObject::RawField(obj, end_offset)); HeapObject::RawField(obj, end_offset));
} }
template <typename StaticVisitor>
DISABLE_CFI_PERF void BodyDescriptorBase::IteratePointers(Heap* heap,
HeapObject* obj,
int start_offset,
int end_offset) {
StaticVisitor::VisitPointers(heap, obj,
HeapObject::RawField(obj, start_offset),
HeapObject::RawField(obj, end_offset));
}
template <typename ObjectVisitor> template <typename ObjectVisitor>
void BodyDescriptorBase::IteratePointer(HeapObject* obj, int offset, void BodyDescriptorBase::IteratePointer(HeapObject* obj, int offset,
ObjectVisitor* v) { ObjectVisitor* v) {
v->VisitPointer(obj, HeapObject::RawField(obj, offset)); v->VisitPointer(obj, HeapObject::RawField(obj, offset));
} }
template <typename StaticVisitor>
void BodyDescriptorBase::IteratePointer(Heap* heap, HeapObject* obj,
int offset) {
StaticVisitor::VisitPointer(heap, obj, HeapObject::RawField(obj, offset));
}
class JSObject::BodyDescriptor final : public BodyDescriptorBase { class JSObject::BodyDescriptor final : public BodyDescriptorBase {
public: public:
static const int kStartOffset = JSReceiver::kPropertiesOrHashOffset; static const int kStartOffset = JSReceiver::kPropertiesOrHashOffset;
...@@ -122,12 +84,6 @@ class JSObject::BodyDescriptor final : public BodyDescriptorBase { ...@@ -122,12 +84,6 @@ class JSObject::BodyDescriptor final : public BodyDescriptorBase {
IterateBodyImpl(obj, kStartOffset, object_size, v); IterateBodyImpl(obj, kStartOffset, object_size, v);
} }
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj, int object_size) {
Heap* heap = obj->GetHeap();
IterateBodyImpl<StaticVisitor>(heap, obj, kStartOffset, object_size);
}
static inline int SizeOf(Map* map, HeapObject* object) { static inline int SizeOf(Map* map, HeapObject* object) {
return map->instance_size(); return map->instance_size();
} }
...@@ -147,12 +103,6 @@ class JSObject::FastBodyDescriptor final : public BodyDescriptorBase { ...@@ -147,12 +103,6 @@ class JSObject::FastBodyDescriptor final : public BodyDescriptorBase {
IteratePointers(obj, kStartOffset, object_size, v); IteratePointers(obj, kStartOffset, object_size, v);
} }
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj, int object_size) {
Heap* heap = obj->GetHeap();
IteratePointers<StaticVisitor>(heap, obj, kStartOffset, object_size);
}
static inline int SizeOf(Map* map, HeapObject* object) { static inline int SizeOf(Map* map, HeapObject* object) {
return map->instance_size(); return map->instance_size();
} }
...@@ -180,17 +130,6 @@ class JSFunction::BodyDescriptorImpl final : public BodyDescriptorBase { ...@@ -180,17 +130,6 @@ class JSFunction::BodyDescriptorImpl final : public BodyDescriptorBase {
IterateBodyImpl(obj, kSize, object_size, v); IterateBodyImpl(obj, kSize, object_size, v);
} }
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj, int object_size) {
Heap* heap = obj->GetHeap();
IteratePointers<StaticVisitor>(heap, obj, kPropertiesOrHashOffset,
kNonWeakFieldsEndOffset);
if (body_visiting_policy == kIgnoreWeakness) {
IteratePointers<StaticVisitor>(heap, obj, kNextFunctionLinkOffset, kSize);
}
IterateBodyImpl<StaticVisitor>(heap, obj, kSize, object_size);
}
static inline int SizeOf(Map* map, HeapObject* object) { static inline int SizeOf(Map* map, HeapObject* object) {
return map->instance_size(); return map->instance_size();
} }
...@@ -218,17 +157,6 @@ class JSArrayBuffer::BodyDescriptor final : public BodyDescriptorBase { ...@@ -218,17 +157,6 @@ class JSArrayBuffer::BodyDescriptor final : public BodyDescriptorBase {
IterateBodyImpl(obj, kSize, object_size, v); IterateBodyImpl(obj, kSize, object_size, v);
} }
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj, int object_size) {
Heap* heap = obj->GetHeap();
// Array buffers contain raw pointers that the GC does not know about. These
// are stored at kBackStoreOffset and later, so we do not iterate over
// those.
IteratePointers<StaticVisitor>(heap, obj, kPropertiesOrHashOffset,
kBackingStoreOffset);
IterateBodyImpl<StaticVisitor>(heap, obj, kSize, object_size);
}
static inline int SizeOf(Map* map, HeapObject* object) { static inline int SizeOf(Map* map, HeapObject* object) {
return map->instance_size(); return map->instance_size();
} }
...@@ -254,16 +182,6 @@ class SmallOrderedHashTable<Derived>::BodyDescriptor final ...@@ -254,16 +182,6 @@ class SmallOrderedHashTable<Derived>::BodyDescriptor final
} }
} }
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj, int object_size) {
Heap* heap = obj->GetHeap();
Derived* table = reinterpret_cast<Derived*>(obj);
int start = table->GetDataTableStartOffset();
for (int i = 0; i < table->Capacity(); i++) {
IteratePointer<StaticVisitor>(heap, obj, start + (i * kPointerSize));
}
}
static inline int SizeOf(Map* map, HeapObject* obj) { static inline int SizeOf(Map* map, HeapObject* obj) {
Derived* table = reinterpret_cast<Derived*>(obj); Derived* table = reinterpret_cast<Derived*>(obj);
return table->Size(); return table->Size();
...@@ -278,9 +196,6 @@ class ByteArray::BodyDescriptor final : public BodyDescriptorBase { ...@@ -278,9 +196,6 @@ class ByteArray::BodyDescriptor final : public BodyDescriptorBase {
static inline void IterateBody(HeapObject* obj, int object_size, static inline void IterateBody(HeapObject* obj, int object_size,
ObjectVisitor* v) {} ObjectVisitor* v) {}
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj, int object_size) {}
static inline int SizeOf(Map* map, HeapObject* obj) { static inline int SizeOf(Map* map, HeapObject* obj) {
return ByteArray::SizeFor(ByteArray::cast(obj)->synchronized_length()); return ByteArray::SizeFor(ByteArray::cast(obj)->synchronized_length());
} }
...@@ -301,14 +216,6 @@ class BytecodeArray::BodyDescriptor final : public BodyDescriptorBase { ...@@ -301,14 +216,6 @@ class BytecodeArray::BodyDescriptor final : public BodyDescriptorBase {
IteratePointer(obj, kSourcePositionTableOffset, v); IteratePointer(obj, kSourcePositionTableOffset, v);
} }
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj, int object_size) {
Heap* heap = obj->GetHeap();
IteratePointer<StaticVisitor>(heap, obj, kConstantPoolOffset);
IteratePointer<StaticVisitor>(heap, obj, kHandlerTableOffset);
IteratePointer<StaticVisitor>(heap, obj, kSourcePositionTableOffset);
}
static inline int SizeOf(Map* map, HeapObject* obj) { static inline int SizeOf(Map* map, HeapObject* obj) {
return BytecodeArray::SizeFor( return BytecodeArray::SizeFor(
BytecodeArray::cast(obj)->synchronized_length()); BytecodeArray::cast(obj)->synchronized_length());
...@@ -323,9 +230,6 @@ class FixedDoubleArray::BodyDescriptor final : public BodyDescriptorBase { ...@@ -323,9 +230,6 @@ class FixedDoubleArray::BodyDescriptor final : public BodyDescriptorBase {
static inline void IterateBody(HeapObject* obj, int object_size, static inline void IterateBody(HeapObject* obj, int object_size,
ObjectVisitor* v) {} ObjectVisitor* v) {}
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj, int object_size) {}
static inline int SizeOf(Map* map, HeapObject* obj) { static inline int SizeOf(Map* map, HeapObject* obj) {
return FixedDoubleArray::SizeFor( return FixedDoubleArray::SizeFor(
FixedDoubleArray::cast(obj)->synchronized_length()); FixedDoubleArray::cast(obj)->synchronized_length());
...@@ -344,12 +248,6 @@ class FixedTypedArrayBase::BodyDescriptor final : public BodyDescriptorBase { ...@@ -344,12 +248,6 @@ class FixedTypedArrayBase::BodyDescriptor final : public BodyDescriptorBase {
IteratePointer(obj, kBasePointerOffset, v); IteratePointer(obj, kBasePointerOffset, v);
} }
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj, int object_size) {
Heap* heap = obj->GetHeap();
IteratePointer<StaticVisitor>(heap, obj, kBasePointerOffset);
}
static inline int SizeOf(Map* map, HeapObject* object) { static inline int SizeOf(Map* map, HeapObject* object) {
return FixedTypedArrayBase::cast(object)->size(); return FixedTypedArrayBase::cast(object)->size();
} }
...@@ -370,15 +268,6 @@ class FeedbackVector::BodyDescriptor final : public BodyDescriptorBase { ...@@ -370,15 +268,6 @@ class FeedbackVector::BodyDescriptor final : public BodyDescriptorBase {
IteratePointers(obj, kFeedbackSlotsOffset, object_size, v); IteratePointers(obj, kFeedbackSlotsOffset, object_size, v);
} }
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj, int object_size) {
Heap* heap = obj->GetHeap();
IteratePointer<StaticVisitor>(heap, obj, kSharedFunctionInfoOffset);
IteratePointer<StaticVisitor>(heap, obj, kOptimizedCodeOffset);
IteratePointers<StaticVisitor>(heap, obj, kFeedbackSlotsOffset,
object_size);
}
static inline int SizeOf(Map* map, HeapObject* obj) { static inline int SizeOf(Map* map, HeapObject* obj) {
return FeedbackVector::SizeFor(FeedbackVector::cast(obj)->length()); return FeedbackVector::SizeFor(FeedbackVector::cast(obj)->length());
} }
...@@ -405,19 +294,6 @@ class JSWeakCollection::BodyDescriptorImpl final : public BodyDescriptorBase { ...@@ -405,19 +294,6 @@ class JSWeakCollection::BodyDescriptorImpl final : public BodyDescriptorBase {
} }
} }
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj, int object_size) {
Heap* heap = obj->GetHeap();
if (body_visiting_policy == kIgnoreWeakness) {
IterateBodyImpl<StaticVisitor>(heap, obj, kPropertiesOrHashOffset,
object_size);
} else {
IteratePointers<StaticVisitor>(heap, obj, kPropertiesOrHashOffset,
kTableOffset);
IterateBodyImpl<StaticVisitor>(heap, obj, kSize, object_size);
}
}
static inline int SizeOf(Map* map, HeapObject* object) { static inline int SizeOf(Map* map, HeapObject* object) {
return map->instance_size(); return map->instance_size();
} }
...@@ -435,12 +311,6 @@ class Foreign::BodyDescriptor final : public BodyDescriptorBase { ...@@ -435,12 +311,6 @@ class Foreign::BodyDescriptor final : public BodyDescriptorBase {
obj, kForeignAddressOffset))); obj, kForeignAddressOffset)));
} }
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj, int object_size) {
StaticVisitor::VisitExternalReference(reinterpret_cast<Address*>(
HeapObject::RawField(obj, kForeignAddressOffset)));
}
static inline int SizeOf(Map* map, HeapObject* object) { return kSize; } static inline int SizeOf(Map* map, HeapObject* object) { return kSize; }
}; };
...@@ -453,10 +323,6 @@ class ExternalOneByteString::BodyDescriptor final : public BodyDescriptorBase { ...@@ -453,10 +323,6 @@ class ExternalOneByteString::BodyDescriptor final : public BodyDescriptorBase {
ObjectVisitor* v) { ObjectVisitor* v) {
} }
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj, int object_size) {
}
static inline int SizeOf(Map* map, HeapObject* object) { return kSize; } static inline int SizeOf(Map* map, HeapObject* object) { return kSize; }
}; };
...@@ -469,10 +335,6 @@ class ExternalTwoByteString::BodyDescriptor final : public BodyDescriptorBase { ...@@ -469,10 +335,6 @@ class ExternalTwoByteString::BodyDescriptor final : public BodyDescriptorBase {
ObjectVisitor* v) { ObjectVisitor* v) {
} }
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj, int object_size) {
}
static inline int SizeOf(Map* map, HeapObject* object) { return kSize; } static inline int SizeOf(Map* map, HeapObject* object) { return kSize; }
}; };
...@@ -519,32 +381,6 @@ class Code::BodyDescriptor final : public BodyDescriptorBase { ...@@ -519,32 +381,6 @@ class Code::BodyDescriptor final : public BodyDescriptorBase {
IterateBody(obj, v); IterateBody(obj, v);
} }
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj) {
int mode_mask = RelocInfo::kCodeTargetMask |
RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) |
RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE) |
RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE_ENCODED) |
RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY);
Heap* heap = obj->GetHeap();
IteratePointers<StaticVisitor>(heap, obj, kRelocationInfoOffset,
kNextCodeLinkOffset);
StaticVisitor::VisitNextCodeLink(
heap, HeapObject::RawField(obj, kNextCodeLinkOffset));
RelocIterator it(Code::cast(obj), mode_mask);
for (; !it.done(); it.next()) {
it.rinfo()->template Visit<StaticVisitor>(heap);
}
}
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj, int object_size) {
IterateBody<StaticVisitor>(obj);
}
static inline int SizeOf(Map* map, HeapObject* object) { static inline int SizeOf(Map* map, HeapObject* object) {
return reinterpret_cast<Code*>(object)->CodeSize(); return reinterpret_cast<Code*>(object)->CodeSize();
} }
...@@ -558,9 +394,6 @@ class SeqOneByteString::BodyDescriptor final : public BodyDescriptorBase { ...@@ -558,9 +394,6 @@ class SeqOneByteString::BodyDescriptor final : public BodyDescriptorBase {
static inline void IterateBody(HeapObject* obj, int object_size, static inline void IterateBody(HeapObject* obj, int object_size,
ObjectVisitor* v) {} ObjectVisitor* v) {}
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj, int object_size) {}
static inline int SizeOf(Map* map, HeapObject* obj) { static inline int SizeOf(Map* map, HeapObject* obj) {
SeqOneByteString* string = SeqOneByteString::cast(obj); SeqOneByteString* string = SeqOneByteString::cast(obj);
return string->SizeFor(string->synchronized_length()); return string->SizeFor(string->synchronized_length());
...@@ -575,9 +408,6 @@ class SeqTwoByteString::BodyDescriptor final : public BodyDescriptorBase { ...@@ -575,9 +408,6 @@ class SeqTwoByteString::BodyDescriptor final : public BodyDescriptorBase {
static inline void IterateBody(HeapObject* obj, int object_size, static inline void IterateBody(HeapObject* obj, int object_size,
ObjectVisitor* v) {} ObjectVisitor* v) {}
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj, int object_size) {}
static inline int SizeOf(Map* map, HeapObject* obj) { static inline int SizeOf(Map* map, HeapObject* obj) {
SeqTwoByteString* string = SeqTwoByteString::cast(obj); SeqTwoByteString* string = SeqTwoByteString::cast(obj);
return string->SizeFor(string->synchronized_length()); return string->SizeFor(string->synchronized_length());
......
...@@ -26,30 +26,16 @@ namespace internal { ...@@ -26,30 +26,16 @@ namespace internal {
// template <typename ObjectVisitor> // template <typename ObjectVisitor>
// static inline void IterateBody(HeapObject* obj, int object_size, // static inline void IterateBody(HeapObject* obj, int object_size,
// ObjectVisitor* v); // ObjectVisitor* v);
//
//
// 3) Iterate object's body using stateless object visitor.
//
// template <typename StaticVisitor>
// static inline void IterateBody(HeapObject* obj, int object_size);
//
class BodyDescriptorBase BASE_EMBEDDED { class BodyDescriptorBase BASE_EMBEDDED {
public: public:
template <typename ObjectVisitor> template <typename ObjectVisitor>
static inline void IteratePointers(HeapObject* obj, int start_offset, static inline void IteratePointers(HeapObject* obj, int start_offset,
int end_offset, ObjectVisitor* v); int end_offset, ObjectVisitor* v);
template <typename StaticVisitor>
static inline void IteratePointers(Heap* heap, HeapObject* obj,
int start_offset, int end_offset);
template <typename ObjectVisitor> template <typename ObjectVisitor>
static inline void IteratePointer(HeapObject* obj, int offset, static inline void IteratePointer(HeapObject* obj, int offset,
ObjectVisitor* v); ObjectVisitor* v);
template <typename StaticVisitor>
static inline void IteratePointer(Heap* heap, HeapObject* obj, int offset);
protected: protected:
// Returns true for all header and embedder fields. // Returns true for all header and embedder fields.
static inline bool IsValidSlotImpl(HeapObject* obj, int offset); static inline bool IsValidSlotImpl(HeapObject* obj, int offset);
...@@ -58,11 +44,6 @@ class BodyDescriptorBase BASE_EMBEDDED { ...@@ -58,11 +44,6 @@ class BodyDescriptorBase BASE_EMBEDDED {
template <typename ObjectVisitor> template <typename ObjectVisitor>
static inline void IterateBodyImpl(HeapObject* obj, int start_offset, static inline void IterateBodyImpl(HeapObject* obj, int start_offset,
int end_offset, ObjectVisitor* v); int end_offset, ObjectVisitor* v);
// Treats all header and embedder fields in the range as tagged.
template <typename StaticVisitor>
static inline void IterateBodyImpl(Heap* heap, HeapObject* obj,
int start_offset, int end_offset);
}; };
...@@ -91,17 +72,6 @@ class FixedBodyDescriptor final : public BodyDescriptorBase { ...@@ -91,17 +72,6 @@ class FixedBodyDescriptor final : public BodyDescriptorBase {
IterateBody(obj, v); IterateBody(obj, v);
} }
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj) {
Heap* heap = obj->GetHeap();
IteratePointers<StaticVisitor>(heap, obj, start_offset, end_offset);
}
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj, int object_size) {
IterateBody<StaticVisitor>(obj);
}
static inline int SizeOf(Map* map, HeapObject* object) { return kSize; } static inline int SizeOf(Map* map, HeapObject* object) { return kSize; }
}; };
...@@ -124,12 +94,6 @@ class FlexibleBodyDescriptor final : public BodyDescriptorBase { ...@@ -124,12 +94,6 @@ class FlexibleBodyDescriptor final : public BodyDescriptorBase {
IteratePointers(obj, start_offset, object_size, v); IteratePointers(obj, start_offset, object_size, v);
} }
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj, int object_size) {
Heap* heap = obj->GetHeap();
IteratePointers<StaticVisitor>(heap, obj, start_offset, object_size);
}
static inline int SizeOf(Map* map, HeapObject* object); static inline int SizeOf(Map* map, HeapObject* object);
}; };
......
...@@ -254,24 +254,6 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) { ...@@ -254,24 +254,6 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
} }
} }
template <typename StaticVisitor>
void RelocInfo::Visit(Heap* heap) {
RelocInfo::Mode mode = rmode();
if (mode == RelocInfo::EMBEDDED_OBJECT) {
StaticVisitor::VisitEmbeddedPointer(heap, this);
} else if (RelocInfo::IsCodeTarget(mode)) {
StaticVisitor::VisitCodeTarget(heap, this);
} else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
StaticVisitor::VisitExternalReference(this);
} else if (mode == RelocInfo::INTERNAL_REFERENCE ||
mode == RelocInfo::INTERNAL_REFERENCE_ENCODED) {
StaticVisitor::VisitInternalReference(this);
} else if (IsRuntimeEntry(mode)) {
StaticVisitor::VisitRuntimeEntry(this);
}
}
Operand::Operand(intptr_t immediate, RelocInfo::Mode rmode) { Operand::Operand(intptr_t immediate, RelocInfo::Mode rmode) {
rm_ = no_reg; rm_ = no_reg;
value_.immediate = immediate; value_.immediate = immediate;
......
...@@ -1320,7 +1320,7 @@ void V8HeapExplorer::ExtractAllocationSiteReferences(int entry, ...@@ -1320,7 +1320,7 @@ void V8HeapExplorer::ExtractAllocationSiteReferences(int entry,
TagObject(site->dependent_code(), "(dependent code)"); TagObject(site->dependent_code(), "(dependent code)");
SetInternalReference(site, entry, "dependent_code", site->dependent_code(), SetInternalReference(site, entry, "dependent_code", site->dependent_code(),
AllocationSite::kDependentCodeOffset); AllocationSite::kDependentCodeOffset);
// Do not visit weak_next as it is not visited by the StaticVisitor, // Do not visit weak_next as it is not visited by the ObjectVisitor,
// and we're not very interested in weak_next field here. // and we're not very interested in weak_next field here.
STATIC_ASSERT(AllocationSite::kWeakNextOffset >= STATIC_ASSERT(AllocationSite::kWeakNextOffset >=
AllocationSite::kPointerFieldsEndOffset); AllocationSite::kPointerFieldsEndOffset);
......
...@@ -232,22 +232,6 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) { ...@@ -232,22 +232,6 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
} }
} }
template <typename StaticVisitor>
void RelocInfo::Visit(Heap* heap) {
RelocInfo::Mode mode = rmode();
if (mode == RelocInfo::EMBEDDED_OBJECT) {
StaticVisitor::VisitEmbeddedPointer(heap, this);
} else if (RelocInfo::IsCodeTarget(mode)) {
StaticVisitor::VisitCodeTarget(heap, this);
} else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
StaticVisitor::VisitExternalReference(this);
} else if (mode == RelocInfo::INTERNAL_REFERENCE) {
StaticVisitor::VisitInternalReference(this);
} else if (IsRuntimeEntry(mode)) {
StaticVisitor::VisitRuntimeEntry(this);
}
}
// Operand constructors // Operand constructors
Operand::Operand(intptr_t immediate, RelocInfo::Mode rmode) { Operand::Operand(intptr_t immediate, RelocInfo::Mode rmode) {
rm_ = no_reg; rm_ = no_reg;
......
...@@ -446,25 +446,6 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) { ...@@ -446,25 +446,6 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
} }
} }
template<typename StaticVisitor>
void RelocInfo::Visit(Heap* heap) {
RelocInfo::Mode mode = rmode();
if (mode == RelocInfo::EMBEDDED_OBJECT) {
StaticVisitor::VisitEmbeddedPointer(heap, this);
Assembler::FlushICache(heap->isolate(), pc_, sizeof(Address));
} else if (RelocInfo::IsCodeTarget(mode)) {
StaticVisitor::VisitCodeTarget(heap, this);
} else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
StaticVisitor::VisitExternalReference(this);
} else if (mode == RelocInfo::INTERNAL_REFERENCE) {
StaticVisitor::VisitInternalReference(this);
} else if (RelocInfo::IsRuntimeEntry(mode)) {
StaticVisitor::VisitRuntimeEntry(this);
}
}
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Implementation of Operand // Implementation of Operand
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment