Commit e5fd9102 authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

[heap] Add detailed object stats for maps.

This introduces new virtual instance types to further diagnose what's
going on in MapSpace, namely:

 - MAP_ABANDONED_PROTOTYPE_TYPE includes all the abandoned (fast-mode)
   prototype maps.
 - MAP_DEPRECATED_TYPE includes all the deprecated (fast-mode) maps.
 - MAP_DICTIONARY_TYPE includes all the dictionary-mode maps.
 - MAP_PROTOTYPE_DICTIONARY_TYPE includes all the prototype maps in
   dictionary-mode.
 - MAP_PROTOTYPE_TYPE includes all the prototype maps in fast-mode.
 - MAP_STABLE_TYPE includes all the (fast-mode) stable (leaf) maps.

Those maps who don't fall into any of the buckets above are categorized
as MAP_TYPE (as before).

The naming was chosen like this to make it possible to filter for the
relevant maps in the object stats via 'MAP_.*_TYPE'.

Bug: v8:7266
Change-Id: I233734e96a390ddb391bfff8a34a8fec842d1f7f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1554685Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60651}
parent 2b7fdbfc
......@@ -776,6 +776,34 @@ bool ObjectStatsCollectorImpl::SameLiveness(HeapObject obj1, HeapObject obj2) {
void ObjectStatsCollectorImpl::RecordVirtualMapDetails(Map map) {
// TODO(mlippautz): map->dependent_code(): DEPENDENT_CODE_TYPE.
// For Map we want to distinguish between various different states
// to get a better picture of what's going on in MapSpace. This
// method computes the virtual instance type to use for a given map,
// using MAP_TYPE for regular maps that aren't special in any way.
if (map->is_prototype_map()) {
if (map->is_dictionary_map()) {
RecordSimpleVirtualObjectStats(
HeapObject(), map, ObjectStats::MAP_PROTOTYPE_DICTIONARY_TYPE);
} else if (map->is_abandoned_prototype_map()) {
RecordSimpleVirtualObjectStats(HeapObject(), map,
ObjectStats::MAP_ABANDONED_PROTOTYPE_TYPE);
} else {
RecordSimpleVirtualObjectStats(HeapObject(), map,
ObjectStats::MAP_PROTOTYPE_TYPE);
}
} else if (map->is_deprecated()) {
RecordSimpleVirtualObjectStats(HeapObject(), map,
ObjectStats::MAP_DEPRECATED_TYPE);
} else if (map->is_dictionary_map()) {
RecordSimpleVirtualObjectStats(HeapObject(), map,
ObjectStats::MAP_DICTIONARY_TYPE);
} else if (map->is_stable()) {
RecordSimpleVirtualObjectStats(HeapObject(), map,
ObjectStats::MAP_STABLE_TYPE);
} else {
// This will be logged as MAP_TYPE in Phase2.
}
DescriptorArray array = map->instance_descriptors();
if (map->owns_descriptors() &&
array != ReadOnlyRoots(heap_).empty_descriptor_array()) {
......
......@@ -45,6 +45,12 @@
V(JS_ARRAY_BOILERPLATE_TYPE) \
V(JS_COLLECTION_TABLE_TYPE) \
V(JS_OBJECT_BOILERPLATE_TYPE) \
V(MAP_ABANDONED_PROTOTYPE_TYPE) \
V(MAP_DEPRECATED_TYPE) \
V(MAP_DICTIONARY_TYPE) \
V(MAP_PROTOTYPE_DICTIONARY_TYPE) \
V(MAP_PROTOTYPE_TYPE) \
V(MAP_STABLE_TYPE) \
V(NOSCRIPT_SHARED_FUNCTION_INFOS_TYPE) \
V(NUMBER_STRING_CACHE_TYPE) \
V(OBJECT_PROPERTY_DICTIONARY_TYPE) \
......
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