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

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

Issue 19631003: Add named links to dependent_code in Map objects in heap snapshot. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 885
886 886
887 class IndexedReferencesExtractor : public ObjectVisitor { 887 class IndexedReferencesExtractor : public ObjectVisitor {
888 public: 888 public:
889 IndexedReferencesExtractor(V8HeapExplorer* generator, 889 IndexedReferencesExtractor(V8HeapExplorer* generator,
890 HeapObject* parent_obj, 890 HeapObject* parent_obj,
891 int parent) 891 int parent)
892 : generator_(generator), 892 : generator_(generator),
893 parent_obj_(parent_obj), 893 parent_obj_(parent_obj),
894 parent_(parent), 894 parent_(parent),
895 next_index_(1) { 895 next_index_(0) {
896 } 896 }
897 void VisitCodeEntry(Address entry_address) { 897 void VisitCodeEntry(Address entry_address) {
898 Code* code = Code::cast(Code::GetObjectFromEntryAddress(entry_address)); 898 Code* code = Code::cast(Code::GetObjectFromEntryAddress(entry_address));
899 generator_->SetInternalReference(parent_obj_, parent_, "code", code); 899 generator_->SetInternalReference(parent_obj_, parent_, "code", code);
900 generator_->TagObject(code, "(code)"); 900 generator_->TagObject(code, "(code)");
901 } 901 }
902 void VisitPointers(Object** start, Object** end) { 902 void VisitPointers(Object** start, Object** end) {
903 for (Object** p = start; p < end; p++) { 903 for (Object** p = start; p < end; p++) {
904 if (CheckVisitedAndUnmark(p)) continue; 904 if (CheckVisitedAndUnmark(p)) continue;
905 generator_->SetHiddenReference(parent_obj_, parent_, next_index_++, *p); 905 generator_->SetHiddenReference(parent_obj_, parent_, next_index_++, *p);
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1140 Map::kDescriptorsOffset); 1140 Map::kDescriptorsOffset);
1141 1141
1142 SetInternalReference(map, entry, 1142 SetInternalReference(map, entry,
1143 "code_cache", map->code_cache(), 1143 "code_cache", map->code_cache(),
1144 Map::kCodeCacheOffset); 1144 Map::kCodeCacheOffset);
1145 SetInternalReference(map, entry, 1145 SetInternalReference(map, entry,
1146 "prototype", map->prototype(), Map::kPrototypeOffset); 1146 "prototype", map->prototype(), Map::kPrototypeOffset);
1147 SetInternalReference(map, entry, 1147 SetInternalReference(map, entry,
1148 "constructor", map->constructor(), 1148 "constructor", map->constructor(),
1149 Map::kConstructorOffset); 1149 Map::kConstructorOffset);
1150 TagObject(map->dependent_code(), "(dependent code)");
1151 SetInternalReference(map, entry,
ulan 2013/07/18 10:56:00 Note that objects in dependent_code and transition
alph 2013/07/18 14:17:37 I'm curious where does this knowledge come from. A
ulan 2013/07/18 15:01:46 It is in StaticMarkingVisitor<StaticVisitor>::Mark
1152 "dependent_code", map->dependent_code(),
1153 Map::kDependentCodeOffset);
1150 } 1154 }
1151 1155
1152 1156
1153 void V8HeapExplorer::ExtractSharedFunctionInfoReferences( 1157 void V8HeapExplorer::ExtractSharedFunctionInfoReferences(
1154 int entry, SharedFunctionInfo* shared) { 1158 int entry, SharedFunctionInfo* shared) {
1155 HeapObject* obj = shared; 1159 HeapObject* obj = shared;
1156 SetInternalReference(obj, entry, 1160 SetInternalReference(obj, entry,
1157 "name", shared->name(), 1161 "name", shared->name(),
1158 SharedFunctionInfo::kNameOffset); 1162 SharedFunctionInfo::kNameOffset);
1159 TagObject(shared->code(), "(code)"); 1163 TagObject(shared->code(), "(code)");
(...skipping 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after
2688 2692
2689 2693
2690 void HeapSnapshotJSONSerializer::SortHashMap( 2694 void HeapSnapshotJSONSerializer::SortHashMap(
2691 HashMap* map, List<HashMap::Entry*>* sorted_entries) { 2695 HashMap* map, List<HashMap::Entry*>* sorted_entries) {
2692 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) 2696 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p))
2693 sorted_entries->Add(p); 2697 sorted_entries->Add(p);
2694 sorted_entries->Sort(SortUsingEntryValue); 2698 sorted_entries->Sort(SortUsingEntryValue);
2695 } 2699 }
2696 2700
2697 } } // namespace v8::internal 2701 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698