SetInternalReference(map, entry,
"constructor", map->constructor(),
Map::kConstructorOffset);
- if (!map->instance_descriptors()->IsEmpty()) {
- TagObject(map->instance_descriptors(), "(map descriptors)");
- // TODO(verwaest): Check what to do here.
+ if (map->HasTransitionArray()) {
+ TransitionArray* transitions = map->transitions();
+ if (!transitions->descriptors()->IsEmpty()) {
+ DescriptorArray* descriptors = transitions->descriptors();
+ TagObject(descriptors, "(map descriptors)");
+ SetInternalReference(transitions, entry,
+ "descriptors", descriptors,
+ TransitionArray::kDescriptorsOffset);
+ IndexedReferencesExtractor refs_extractor(
+ this, transitions, entry);
+ transitions->Iterate(&refs_extractor);
+ }
+ TagObject(transitions, "(transition array)");
SetInternalReference(map, entry,
- "descriptors", map->instance_descriptors(),
+ "transitions", transitions,
Map::kTransitionsOrBackPointerOffset);
}
SetInternalReference(map, entry,
GetProperty(global_object, v8::HeapGraphEdge::kInternal, "elements");
CHECK_EQ(NULL, elements);
}
+
+
+TEST(MapHasDescriptorsAndTransitions) {
+ v8::HandleScope scope;
+ LocalContext env;
+ CompileRun("obj = { a: 10 };\n");
+ const v8::HeapSnapshot* snapshot =
+ v8::HeapProfiler::TakeSnapshot(v8_str("snapshot"));
+ const v8::HeapGraphNode* global = GetGlobalObject(snapshot);
+ const v8::HeapGraphNode* global_object =
+ GetProperty(global, v8::HeapGraphEdge::kProperty, "obj");
+ CHECK_NE(NULL, global_object);
+ const v8::HeapGraphNode* map =
+ GetProperty(global_object, v8::HeapGraphEdge::kInternal, "map");
+ CHECK_NE(NULL, map);
+ const v8::HeapGraphNode* descriptors =
+ GetProperty(map, v8::HeapGraphEdge::kInternal, "descriptors");
+ CHECK_NE(NULL, descriptors);
+ const v8::HeapGraphNode* transitions =
+ GetProperty(map, v8::HeapGraphEdge::kInternal, "transitions");
+ CHECK_NE(NULL, transitions);
+}