diff --git a/src/heap/objects-visiting-inl.h b/src/heap/objects-visiting-inl.h index 0e025b22f2..2d69b9efd3 100644 --- a/src/heap/objects-visiting-inl.h +++ b/src/heap/objects-visiting-inl.h @@ -44,8 +44,15 @@ void StaticNewSpaceVisitor::Initialize() { FixedArray::BodyDescriptor, int>::Visit); table_.Register(kVisitFixedDoubleArray, &VisitFixedDoubleArray); - table_.Register(kVisitFixedTypedArray, &VisitFixedTypedArray); - table_.Register(kVisitFixedFloat64Array, &VisitFixedTypedArray); + table_.Register( + kVisitFixedTypedArray, + &FlexibleBodyVisitor::Visit); + + table_.Register( + kVisitFixedFloat64Array, + &FlexibleBodyVisitor::Visit); table_.Register( kVisitNativeContext, @@ -135,9 +142,15 @@ void StaticMarkingVisitor::Initialize() { table_.Register(kVisitFixedDoubleArray, &DataObjectVisitor::Visit); - table_.Register(kVisitFixedTypedArray, &DataObjectVisitor::Visit); + table_.Register( + kVisitFixedTypedArray, + &FlexibleBodyVisitor::Visit); - table_.Register(kVisitFixedFloat64Array, &DataObjectVisitor::Visit); + table_.Register( + kVisitFixedFloat64Array, + &FlexibleBodyVisitor::Visit); table_.Register(kVisitNativeContext, &VisitNativeContext); diff --git a/src/heap/objects-visiting.h b/src/heap/objects-visiting.h index f0925a71c7..29efc16a7e 100644 --- a/src/heap/objects-visiting.h +++ b/src/heap/objects-visiting.h @@ -248,7 +248,9 @@ class StaticNewSpaceVisitor : public StaticVisitorBase { INLINE(static void VisitPointers(Heap* heap, HeapObject* object, Object** start, Object** end)) { - for (Object** p = start; p < end; p++) StaticVisitor::VisitPointer(heap, p); + for (Object** p = start; p < end; p++) { + StaticVisitor::VisitPointer(heap, object, p); + } } // Although we are using the JSFunction body descriptor which does not @@ -269,10 +271,6 @@ class StaticNewSpaceVisitor : public StaticVisitorBase { return FixedDoubleArray::SizeFor(length); } - INLINE(static int VisitFixedTypedArray(Map* map, HeapObject* object)) { - return reinterpret_cast(object)->size(); - } - INLINE(static int VisitJSObject(Map* map, HeapObject* object)) { return JSObjectVisitor::Visit(map, object); } diff --git a/src/heap/scavenger-inl.h b/src/heap/scavenger-inl.h index 6ac64f2eb6..007c29703d 100644 --- a/src/heap/scavenger-inl.h +++ b/src/heap/scavenger-inl.h @@ -38,7 +38,8 @@ void Scavenger::ScavengeObject(HeapObject** p, HeapObject* object) { // static -void StaticScavengeVisitor::VisitPointer(Heap* heap, Object** p) { +void StaticScavengeVisitor::VisitPointer(Heap* heap, HeapObject* obj, + Object** p) { Object* object = *p; if (!heap->InNewSpace(object)) return; Scavenger::ScavengeObject(reinterpret_cast(p), diff --git a/src/heap/scavenger.cc b/src/heap/scavenger.cc index c68dfe5856..40aeb74aa9 100644 --- a/src/heap/scavenger.cc +++ b/src/heap/scavenger.cc @@ -267,28 +267,16 @@ class ScavengingVisitor : public StaticVisitorBase { static inline void EvacuateFixedTypedArray(Map* map, HeapObject** slot, HeapObject* object) { int object_size = reinterpret_cast(object)->size(); - EvacuateObject(map, slot, object, object_size); - - MapWord map_word = object->map_word(); - DCHECK(map_word.IsForwardingAddress()); - FixedTypedArrayBase* target = - reinterpret_cast(map_word.ToForwardingAddress()); - if (target->base_pointer() != Smi::FromInt(0)) - target->set_base_pointer(target, SKIP_WRITE_BARRIER); + EvacuateObject(map, slot, object, + object_size); } static inline void EvacuateFixedFloat64Array(Map* map, HeapObject** slot, HeapObject* object) { int object_size = reinterpret_cast(object)->size(); - EvacuateObject(map, slot, object, object_size); - - MapWord map_word = object->map_word(); - DCHECK(map_word.IsForwardingAddress()); - FixedTypedArrayBase* target = - reinterpret_cast(map_word.ToForwardingAddress()); - if (target->base_pointer() != Smi::FromInt(0)) - target->set_base_pointer(target, SKIP_WRITE_BARRIER); + EvacuateObject(map, slot, object, + object_size); } diff --git a/src/heap/scavenger.h b/src/heap/scavenger.h index b180879db2..5d0abf49d3 100644 --- a/src/heap/scavenger.h +++ b/src/heap/scavenger.h @@ -63,7 +63,7 @@ class ScavengeVisitor : public ObjectVisitor { class StaticScavengeVisitor : public StaticNewSpaceVisitor { public: - static inline void VisitPointer(Heap* heap, Object** p); + static inline void VisitPointer(Heap* heap, HeapObject* object, Object** p); }; } // namespace internal