Commit b123476b authored by alph's avatar alph Committed by Commit bot

Bring heap snapshot Map iterator up to date.

1. Do not mark code_cache as a weak container.
2. Support layout_descriptor field.

Review-Url: https://codereview.chromium.org/2204133002
Cr-Commit-Position: refs/heads/master@{#38285}
parent a86397d8
...@@ -5424,13 +5424,13 @@ void Map::set_prototype(Object* value, WriteBarrierMode mode) { ...@@ -5424,13 +5424,13 @@ void Map::set_prototype(Object* value, WriteBarrierMode mode) {
LayoutDescriptor* Map::layout_descriptor_gc_safe() { LayoutDescriptor* Map::layout_descriptor_gc_safe() {
Object* layout_desc = READ_FIELD(this, kLayoutDecriptorOffset); Object* layout_desc = READ_FIELD(this, kLayoutDescriptorOffset);
return LayoutDescriptor::cast_gc_safe(layout_desc); return LayoutDescriptor::cast_gc_safe(layout_desc);
} }
bool Map::HasFastPointerLayout() const { bool Map::HasFastPointerLayout() const {
Object* layout_desc = READ_FIELD(this, kLayoutDecriptorOffset); Object* layout_desc = READ_FIELD(this, kLayoutDescriptorOffset);
return LayoutDescriptor::IsFastPointerLayout(layout_desc); return LayoutDescriptor::IsFastPointerLayout(layout_desc);
} }
...@@ -5478,8 +5478,7 @@ void Map::InitializeDescriptors(DescriptorArray* descriptors, ...@@ -5478,8 +5478,7 @@ void Map::InitializeDescriptors(DescriptorArray* descriptors,
ACCESSORS(Map, instance_descriptors, DescriptorArray, kDescriptorsOffset) ACCESSORS(Map, instance_descriptors, DescriptorArray, kDescriptorsOffset)
ACCESSORS(Map, layout_descriptor, LayoutDescriptor, kLayoutDecriptorOffset) ACCESSORS(Map, layout_descriptor, LayoutDescriptor, kLayoutDescriptorOffset)
void Map::set_bit_field3(uint32_t bits) { void Map::set_bit_field3(uint32_t bits) {
if (kInt32Size != kPointerSize) { if (kInt32Size != kPointerSize) {
......
...@@ -6260,10 +6260,10 @@ class Map: public HeapObject { ...@@ -6260,10 +6260,10 @@ class Map: public HeapObject {
static const int kDescriptorsOffset = static const int kDescriptorsOffset =
kTransitionsOrPrototypeInfoOffset + kPointerSize; kTransitionsOrPrototypeInfoOffset + kPointerSize;
#if V8_DOUBLE_FIELDS_UNBOXING #if V8_DOUBLE_FIELDS_UNBOXING
static const int kLayoutDecriptorOffset = kDescriptorsOffset + kPointerSize; static const int kLayoutDescriptorOffset = kDescriptorsOffset + kPointerSize;
static const int kCodeCacheOffset = kLayoutDecriptorOffset + kPointerSize; static const int kCodeCacheOffset = kLayoutDescriptorOffset + kPointerSize;
#else #else
static const int kLayoutDecriptorOffset = 1; // Must not be ever accessed. static const int kLayoutDescriptorOffset = 1; // Must not be ever accessed.
static const int kCodeCacheOffset = kDescriptorsOffset + kPointerSize; static const int kCodeCacheOffset = kDescriptorsOffset + kPointerSize;
#endif #endif
static const int kDependentCodeOffset = kCodeCacheOffset + kPointerSize; static const int kDependentCodeOffset = kCodeCacheOffset + kPointerSize;
......
...@@ -1289,16 +1289,19 @@ void V8HeapExplorer::ExtractMapReferences(int entry, Map* map) { ...@@ -1289,16 +1289,19 @@ void V8HeapExplorer::ExtractMapReferences(int entry, Map* map) {
} }
DescriptorArray* descriptors = map->instance_descriptors(); DescriptorArray* descriptors = map->instance_descriptors();
TagObject(descriptors, "(map descriptors)"); TagObject(descriptors, "(map descriptors)");
SetInternalReference(map, entry, SetInternalReference(map, entry, "descriptors", descriptors,
"descriptors", descriptors,
Map::kDescriptorsOffset); Map::kDescriptorsOffset);
SetInternalReference(map, entry, "code_cache", map->code_cache(),
MarkAsWeakContainer(map->code_cache());
SetInternalReference(map, entry,
"code_cache", map->code_cache(),
Map::kCodeCacheOffset); Map::kCodeCacheOffset);
SetInternalReference(map, entry, SetInternalReference(map, entry, "prototype", map->prototype(),
"prototype", map->prototype(), Map::kPrototypeOffset); Map::kPrototypeOffset);
#if V8_DOUBLE_FIELDS_UNBOXING
if (FLAG_unbox_double_fields) {
SetInternalReference(map, entry, "layout_descriptor",
map->layout_descriptor(),
Map::kLayoutDescriptorOffset);
}
#endif
Object* constructor_or_backpointer = map->constructor_or_backpointer(); Object* constructor_or_backpointer = map->constructor_or_backpointer();
if (constructor_or_backpointer->IsMap()) { if (constructor_or_backpointer->IsMap()) {
TagObject(constructor_or_backpointer, "(back pointer)"); TagObject(constructor_or_backpointer, "(back pointer)");
......
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