Commit bfad25a8 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[heap] Further improve instance-based visitor

Bug: chromium:736641
Change-Id: I93e8c0bbdcc471750073d39b10b18c18ceee7d8a
Reviewed-on: https://chromium-review.googlesource.com/549416Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46234}
parent 301b43fe
......@@ -637,11 +637,6 @@ ResultType HeapVisitor<ResultType, ConcreteVisitor>::Visit(Map* map,
return ResultType();
}
template <typename ResultType, typename ConcreteVisitor>
bool HeapVisitor<ResultType, ConcreteVisitor>::ShouldVisitMapPointer() {
return true;
}
template <typename ResultType, typename ConcreteVisitor>
void HeapVisitor<ResultType, ConcreteVisitor>::VisitMapPointer(
HeapObject* host, HeapObject** map) {
......@@ -649,11 +644,6 @@ void HeapVisitor<ResultType, ConcreteVisitor>::VisitMapPointer(
host, reinterpret_cast<Object**>(map));
}
template <typename ResultType, typename ConcreteVisitor>
bool HeapVisitor<ResultType, ConcreteVisitor>::ShouldVisit(HeapObject* object) {
return true;
}
#define VISIT(type) \
template <typename ResultType, typename ConcreteVisitor> \
ResultType HeapVisitor<ResultType, ConcreteVisitor>::Visit##type( \
......@@ -757,14 +747,12 @@ ResultType HeapVisitor<ResultType, ConcreteVisitor>::VisitFreeSpace(
int NewSpaceVisitor::VisitJSFunction(Map* map, JSFunction* object) {
int size = JSFunction::BodyDescriptorWeak::SizeOf(map, object);
VisitMapPointer(object, object->map_slot());
JSFunction::BodyDescriptorWeak::IterateBody(object, size, this);
return size;
}
int NewSpaceVisitor::VisitNativeContext(Map* map, Context* object) {
int size = Context::BodyDescriptor::SizeOf(map, object);
VisitMapPointer(object, object->map_slot());
Context::BodyDescriptor::IterateBody(object, size, this);
return size;
}
......
......@@ -291,9 +291,9 @@ class HeapVisitor : public ObjectVisitor {
// A guard predicate for visiting the object.
// If it returns false then the default implementations of the Visit*
// functions bailout from iterating the object pointers.
V8_INLINE bool ShouldVisit(HeapObject* object);
V8_INLINE bool ShouldVisit(HeapObject* object) { return true; }
// Guard predicate for visiting the objects map pointer separately.
V8_INLINE bool ShouldVisitMapPointer();
V8_INLINE bool ShouldVisitMapPointer() { return true; }
// A callback for visiting the map pointer in the object header.
V8_INLINE void VisitMapPointer(HeapObject* host, HeapObject** map);
......
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