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

Side by Side Diff: src/heap-snapshot-generator.cc

Issue 1033653002: Move prototype metadata from internal properties to prototype maps (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: small fixes Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « src/factory.cc ('k') | src/heap/heap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 Context::FIRST_WEAK_SLOT); 1275 Context::FIRST_WEAK_SLOT);
1276 STATIC_ASSERT(Context::NEXT_CONTEXT_LINK + 1 == 1276 STATIC_ASSERT(Context::NEXT_CONTEXT_LINK + 1 ==
1277 Context::NATIVE_CONTEXT_SLOTS); 1277 Context::NATIVE_CONTEXT_SLOTS);
1278 STATIC_ASSERT(Context::FIRST_WEAK_SLOT + 4 == 1278 STATIC_ASSERT(Context::FIRST_WEAK_SLOT + 4 ==
1279 Context::NATIVE_CONTEXT_SLOTS); 1279 Context::NATIVE_CONTEXT_SLOTS);
1280 } 1280 }
1281 } 1281 }
1282 1282
1283 1283
1284 void V8HeapExplorer::ExtractMapReferences(int entry, Map* map) { 1284 void V8HeapExplorer::ExtractMapReferences(int entry, Map* map) {
1285 Object* raw_transitions = map->raw_transitions(); 1285 Object* raw_transitions_or_prototype_info = map->raw_transitions();
1286 if (TransitionArray::IsFullTransitionArray(raw_transitions)) { 1286 if (TransitionArray::IsFullTransitionArray(
1287 TransitionArray* transitions = TransitionArray::cast(raw_transitions); 1287 raw_transitions_or_prototype_info)) {
1288 TransitionArray* transitions =
1289 TransitionArray::cast(raw_transitions_or_prototype_info);
1288 int transitions_entry = GetEntry(transitions)->index(); 1290 int transitions_entry = GetEntry(transitions)->index();
1289 1291
1290 if (FLAG_collect_maps && map->CanTransition()) { 1292 if (FLAG_collect_maps && map->CanTransition()) {
1291 if (transitions->HasPrototypeTransitions()) { 1293 if (transitions->HasPrototypeTransitions()) {
1292 FixedArray* prototype_transitions = 1294 FixedArray* prototype_transitions =
1293 transitions->GetPrototypeTransitions(); 1295 transitions->GetPrototypeTransitions();
1294 MarkAsWeakContainer(prototype_transitions); 1296 MarkAsWeakContainer(prototype_transitions);
1295 TagObject(prototype_transitions, "(prototype transitions"); 1297 TagObject(prototype_transitions, "(prototype transitions");
1296 SetInternalReference(transitions, transitions_entry, 1298 SetInternalReference(transitions, transitions_entry,
1297 "prototype_transitions", prototype_transitions); 1299 "prototype_transitions", prototype_transitions);
1298 } 1300 }
1299 // TODO(alph): transitions keys are strong links. 1301 // TODO(alph): transitions keys are strong links.
1300 MarkAsWeakContainer(transitions); 1302 MarkAsWeakContainer(transitions);
1301 } 1303 }
1302 1304
1303 TagObject(transitions, "(transition array)"); 1305 TagObject(transitions, "(transition array)");
1304 SetInternalReference(map, entry, "transitions", transitions, 1306 SetInternalReference(map, entry, "transitions", transitions,
1305 Map::kTransitionsOffset); 1307 Map::kTransitionsOrPrototypeInfoOffset);
1306 } else if (TransitionArray::IsSimpleTransition(raw_transitions)) { 1308 } else if (TransitionArray::IsSimpleTransition(
1307 TagObject(raw_transitions, "(transition)"); 1309 raw_transitions_or_prototype_info)) {
1308 SetInternalReference(map, entry, "transition", raw_transitions, 1310 TagObject(raw_transitions_or_prototype_info, "(transition)");
1309 Map::kTransitionsOffset); 1311 SetInternalReference(map, entry, "transition",
1312 raw_transitions_or_prototype_info,
1313 Map::kTransitionsOrPrototypeInfoOffset);
1314 } else if (map->is_prototype_map()) {
1315 TagObject(raw_transitions_or_prototype_info, "prototype_info");
1316 SetInternalReference(map, entry, "prototype_info",
1317 raw_transitions_or_prototype_info,
1318 Map::kTransitionsOrPrototypeInfoOffset);
1310 } 1319 }
1311 DescriptorArray* descriptors = map->instance_descriptors(); 1320 DescriptorArray* descriptors = map->instance_descriptors();
1312 TagObject(descriptors, "(map descriptors)"); 1321 TagObject(descriptors, "(map descriptors)");
1313 SetInternalReference(map, entry, 1322 SetInternalReference(map, entry,
1314 "descriptors", descriptors, 1323 "descriptors", descriptors,
1315 Map::kDescriptorsOffset); 1324 Map::kDescriptorsOffset);
1316 1325
1317 MarkAsWeakContainer(map->code_cache()); 1326 MarkAsWeakContainer(map->code_cache());
1318 SetInternalReference(map, entry, 1327 SetInternalReference(map, entry,
1319 "code_cache", map->code_cache(), 1328 "code_cache", map->code_cache(),
(...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after
3152 writer_->AddString("\"<dummy>\""); 3161 writer_->AddString("\"<dummy>\"");
3153 for (int i = 1; i < sorted_strings.length(); ++i) { 3162 for (int i = 1; i < sorted_strings.length(); ++i) {
3154 writer_->AddCharacter(','); 3163 writer_->AddCharacter(',');
3155 SerializeString(sorted_strings[i]); 3164 SerializeString(sorted_strings[i]);
3156 if (writer_->aborted()) return; 3165 if (writer_->aborted()) return;
3157 } 3166 }
3158 } 3167 }
3159 3168
3160 3169
3161 } } // namespace v8::internal 3170 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698