OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/heap-snapshot-generator-inl.h" | 7 #include "src/heap-snapshot-generator-inl.h" |
8 | 8 |
9 #include "src/allocation-tracker.h" | 9 #include "src/allocation-tracker.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 Context::FIRST_WEAK_SLOT); | 1279 Context::FIRST_WEAK_SLOT); |
1280 STATIC_ASSERT(Context::NEXT_CONTEXT_LINK + 1 == | 1280 STATIC_ASSERT(Context::NEXT_CONTEXT_LINK + 1 == |
1281 Context::NATIVE_CONTEXT_SLOTS); | 1281 Context::NATIVE_CONTEXT_SLOTS); |
1282 STATIC_ASSERT(Context::FIRST_WEAK_SLOT + 4 == | 1282 STATIC_ASSERT(Context::FIRST_WEAK_SLOT + 4 == |
1283 Context::NATIVE_CONTEXT_SLOTS); | 1283 Context::NATIVE_CONTEXT_SLOTS); |
1284 } | 1284 } |
1285 } | 1285 } |
1286 | 1286 |
1287 | 1287 |
1288 void V8HeapExplorer::ExtractMapReferences(int entry, Map* map) { | 1288 void V8HeapExplorer::ExtractMapReferences(int entry, Map* map) { |
1289 if (map->HasTransitionArray()) { | 1289 Object* raw_transitions = map->raw_transitions(); |
1290 TransitionArray* transitions = map->transitions(); | 1290 if (TransitionArray::IsFullTransitionArray(raw_transitions)) { |
| 1291 TransitionArray* transitions = TransitionArray::cast(raw_transitions); |
1291 int transitions_entry = GetEntry(transitions)->index(); | 1292 int transitions_entry = GetEntry(transitions)->index(); |
1292 | 1293 |
1293 if (FLAG_collect_maps && map->CanTransition()) { | 1294 if (FLAG_collect_maps && map->CanTransition()) { |
1294 if (!transitions->IsSimpleTransition()) { | 1295 if (transitions->HasPrototypeTransitions()) { |
1295 if (transitions->HasPrototypeTransitions()) { | 1296 FixedArray* prototype_transitions = |
1296 FixedArray* prototype_transitions = | 1297 transitions->GetPrototypeTransitions(); |
1297 transitions->GetPrototypeTransitions(); | 1298 MarkAsWeakContainer(prototype_transitions); |
1298 MarkAsWeakContainer(prototype_transitions); | 1299 TagObject(prototype_transitions, "(prototype transitions"); |
1299 TagObject(prototype_transitions, "(prototype transitions"); | 1300 SetInternalReference(transitions, transitions_entry, |
1300 SetInternalReference(transitions, transitions_entry, | 1301 "prototype_transitions", prototype_transitions); |
1301 "prototype_transitions", prototype_transitions); | |
1302 } | |
1303 // TODO(alph): transitions keys are strong links. | |
1304 MarkAsWeakContainer(transitions); | |
1305 } | 1302 } |
| 1303 // TODO(alph): transitions keys are strong links. |
| 1304 MarkAsWeakContainer(transitions); |
1306 } | 1305 } |
1307 | 1306 |
1308 TagObject(transitions, "(transition array)"); | 1307 TagObject(transitions, "(transition array)"); |
1309 SetInternalReference(map, entry, "transitions", transitions, | 1308 SetInternalReference(map, entry, "transitions", transitions, |
1310 Map::kTransitionsOffset); | 1309 Map::kTransitionsOffset); |
| 1310 } else if (TransitionArray::IsSimpleTransition(raw_transitions)) { |
| 1311 TagObject(raw_transitions, "(transition)"); |
| 1312 SetInternalReference(map, entry, "transition", raw_transitions, |
| 1313 Map::kTransitionsOffset); |
1311 } | 1314 } |
1312 DescriptorArray* descriptors = map->instance_descriptors(); | 1315 DescriptorArray* descriptors = map->instance_descriptors(); |
1313 TagObject(descriptors, "(map descriptors)"); | 1316 TagObject(descriptors, "(map descriptors)"); |
1314 SetInternalReference(map, entry, | 1317 SetInternalReference(map, entry, |
1315 "descriptors", descriptors, | 1318 "descriptors", descriptors, |
1316 Map::kDescriptorsOffset); | 1319 Map::kDescriptorsOffset); |
1317 | 1320 |
1318 MarkAsWeakContainer(map->code_cache()); | 1321 MarkAsWeakContainer(map->code_cache()); |
1319 SetInternalReference(map, entry, | 1322 SetInternalReference(map, entry, |
1320 "code_cache", map->code_cache(), | 1323 "code_cache", map->code_cache(), |
(...skipping 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3126 writer_->AddString("\"<dummy>\""); | 3129 writer_->AddString("\"<dummy>\""); |
3127 for (int i = 1; i < sorted_strings.length(); ++i) { | 3130 for (int i = 1; i < sorted_strings.length(); ++i) { |
3128 writer_->AddCharacter(','); | 3131 writer_->AddCharacter(','); |
3129 SerializeString(sorted_strings[i]); | 3132 SerializeString(sorted_strings[i]); |
3130 if (writer_->aborted()) return; | 3133 if (writer_->aborted()) return; |
3131 } | 3134 } |
3132 } | 3135 } |
3133 | 3136 |
3134 | 3137 |
3135 } } // namespace v8::internal | 3138 } } // namespace v8::internal |
OLD | NEW |