Commit 6f6b8a6e authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

[in-place weak refs] Remove special casing for JSFunction::BodyDescriptorWeak

It's the same as JSFunction::BodyDescriptor, so the special cases can be
removed.

This is a pre-step for refactoring BodyDescriptorWeak away.

BUG=v8:7308

Change-Id: Id65ce79f044960168d290fbbfdbc2a7aa854230e
Reviewed-on: https://chromium-review.googlesource.com/1226592
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55909}
parent 79cd9ce7
......@@ -191,17 +191,6 @@ class ConcurrentMarkingVisitor final
return 0;
}
int VisitJSFunction(Map* map, JSFunction* object) {
int size = JSFunction::BodyDescriptorWeak::SizeOf(map, object);
int used_size = map->UsedInstanceSize();
DCHECK_LE(used_size, size);
DCHECK_GE(used_size, JSObject::kHeaderSize);
const SlotSnapshot& snapshot = MakeSlotSnapshotWeak(map, object, used_size);
if (!ShouldVisit(object)) return 0;
VisitPointersInSnapshot(object, snapshot);
return size;
}
// ===========================================================================
// Strings with pointers =====================================================
// ===========================================================================
......@@ -466,14 +455,6 @@ class ConcurrentMarkingVisitor final
return slot_snapshot_;
}
template <typename T>
const SlotSnapshot& MakeSlotSnapshotWeak(Map* map, T* object, int size) {
SlotSnapshottingVisitor visitor(&slot_snapshot_);
visitor.VisitPointer(object,
reinterpret_cast<Object**>(object->map_slot()));
T::BodyDescriptorWeak::IterateBody(map, object, size, &visitor);
return slot_snapshot_;
}
ConcurrentMarking::MarkingWorklist::View shared_;
ConcurrentMarking::MarkingWorklist::View bailout_;
WeakObjects* weak_objects_;
......
......@@ -76,16 +76,6 @@ int MarkingVisitor<fixed_array_mode, retaining_path_mode,
return size;
}
template <FixedArrayVisitationMode fixed_array_mode,
TraceRetainingPathMode retaining_path_mode, typename MarkingState>
int MarkingVisitor<fixed_array_mode, retaining_path_mode,
MarkingState>::VisitJSFunction(Map* map,
JSFunction* object) {
int size = JSFunction::BodyDescriptorWeak::SizeOf(map, object);
JSFunction::BodyDescriptorWeak::IterateBody(map, object, size, this);
return size;
}
template <FixedArrayVisitationMode fixed_array_mode,
TraceRetainingPathMode retaining_path_mode, typename MarkingState>
int MarkingVisitor<fixed_array_mode, retaining_path_mode, MarkingState>::
......
......@@ -916,7 +916,6 @@ class MarkingVisitor final
V8_INLINE int VisitEphemeronHashTable(Map* map, EphemeronHashTable* object);
V8_INLINE int VisitFixedArray(Map* map, FixedArray* object);
V8_INLINE int VisitJSApiObject(Map* map, JSObject* object);
V8_INLINE int VisitJSFunction(Map* map, JSFunction* object);
V8_INLINE int VisitMap(Map* map, Map* object);
V8_INLINE int VisitNativeContext(Map* map, Context* object);
V8_INLINE int VisitTransitionArray(Map* map, TransitionArray* object);
......
......@@ -169,15 +169,6 @@ ResultType HeapVisitor<ResultType, ConcreteVisitor>::VisitFreeSpace(
return static_cast<ResultType>(FreeSpace::cast(object)->size());
}
template <typename ConcreteVisitor>
int NewSpaceVisitor<ConcreteVisitor>::VisitJSFunction(Map* map,
JSFunction* object) {
ConcreteVisitor* visitor = static_cast<ConcreteVisitor*>(this);
int size = JSFunction::BodyDescriptorWeak::SizeOf(map, object);
JSFunction::BodyDescriptorWeak::IterateBody(map, object, size, visitor);
return size;
}
template <typename ConcreteVisitor>
int NewSpaceVisitor<ConcreteVisitor>::VisitNativeContext(Map* map,
Context* object) {
......
......@@ -44,7 +44,6 @@ class UncompiledDataWithPreParsedScope;
V(FixedFloat64Array) \
V(FixedTypedArrayBase) \
V(JSArrayBuffer) \
V(JSFunction) \
V(JSObject) \
V(JSWeakCollection) \
V(Map) \
......@@ -119,7 +118,6 @@ class NewSpaceVisitor : public HeapVisitor<int, ConcreteVisitor> {
// Special cases for young generation.
V8_INLINE int VisitJSFunction(Map* map, JSFunction* object);
V8_INLINE int VisitNativeContext(Map* map, Context* object);
V8_INLINE int VisitJSApiObject(Map* map, JSObject* object);
......
......@@ -3192,6 +3192,7 @@ VisitorId Map::GetVisitorId(Map* map) {
case JS_DATE_TYPE:
case JS_ARRAY_ITERATOR_TYPE:
case JS_ARRAY_TYPE:
case JS_FUNCTION_TYPE:
case JS_GLOBAL_PROXY_TYPE:
case JS_GLOBAL_OBJECT_TYPE:
case JS_MESSAGE_OBJECT_TYPE:
......@@ -3229,9 +3230,6 @@ VisitorId Map::GetVisitorId(Map* map) {
case JS_SPECIAL_API_OBJECT_TYPE:
return kVisitJSApiObject;
case JS_FUNCTION_TYPE:
return kVisitJSFunction;
case FILLER_TYPE:
case FOREIGN_TYPE:
case HEAP_NUMBER_TYPE:
......
......@@ -37,7 +37,6 @@ namespace internal {
V(FreeSpace) \
V(JSApiObject) \
V(JSArrayBuffer) \
V(JSFunction) \
V(JSObject) \
V(JSObjectFast) \
V(JSWeakCollection) \
......
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