Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Unified Diff: src/heap-snapshot-generator.cc

Issue 980573002: Simplify and compact transitions storage (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix -Werror=pedantic ( rebase Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap-snapshot-generator.cc
diff --git a/src/heap-snapshot-generator.cc b/src/heap-snapshot-generator.cc
index 6fb68702fdc2a28ca2e02a783c1b2b6f3a19b58c..2809072c9c9521aa21a96666d17da24cfd94ed3c 100644
--- a/src/heap-snapshot-generator.cc
+++ b/src/heap-snapshot-generator.cc
@@ -1286,28 +1286,31 @@ void V8HeapExplorer::ExtractContextReferences(int entry, Context* context) {
void V8HeapExplorer::ExtractMapReferences(int entry, Map* map) {
- if (map->HasTransitionArray()) {
- TransitionArray* transitions = map->transitions();
+ Object* raw_transitions = map->raw_transitions();
+ if (TransitionArray::IsFullTransitionArray(raw_transitions)) {
+ TransitionArray* transitions = TransitionArray::cast(raw_transitions);
int transitions_entry = GetEntry(transitions)->index();
if (FLAG_collect_maps && map->CanTransition()) {
- if (!transitions->IsSimpleTransition()) {
- if (transitions->HasPrototypeTransitions()) {
- FixedArray* prototype_transitions =
- transitions->GetPrototypeTransitions();
- MarkAsWeakContainer(prototype_transitions);
- TagObject(prototype_transitions, "(prototype transitions");
- SetInternalReference(transitions, transitions_entry,
- "prototype_transitions", prototype_transitions);
- }
- // TODO(alph): transitions keys are strong links.
- MarkAsWeakContainer(transitions);
+ if (transitions->HasPrototypeTransitions()) {
+ FixedArray* prototype_transitions =
+ transitions->GetPrototypeTransitions();
+ MarkAsWeakContainer(prototype_transitions);
+ TagObject(prototype_transitions, "(prototype transitions");
+ SetInternalReference(transitions, transitions_entry,
+ "prototype_transitions", prototype_transitions);
}
+ // TODO(alph): transitions keys are strong links.
+ MarkAsWeakContainer(transitions);
}
TagObject(transitions, "(transition array)");
SetInternalReference(map, entry, "transitions", transitions,
Map::kTransitionsOffset);
+ } else if (TransitionArray::IsSimpleTransition(raw_transitions)) {
+ TagObject(raw_transitions, "(transition)");
+ SetInternalReference(map, entry, "transition", raw_transitions,
+ Map::kTransitionsOffset);
}
DescriptorArray* descriptors = map->instance_descriptors();
TagObject(descriptors, "(map descriptors)");
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698