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/profiler/heap-snapshot-generator.h" | 5 #include "src/profiler/heap-snapshot-generator.h" |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/conversions.h" | 8 #include "src/conversions.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/objects-body-descriptors.h" | 10 #include "src/objects-body-descriptors.h" |
(...skipping 62 matching lines...) Loading... |
73 HeapEntry* entry) { | 73 HeapEntry* entry) { |
74 HeapGraphEdge edge(type, index, this->index(), entry->index()); | 74 HeapGraphEdge edge(type, index, this->index(), entry->index()); |
75 snapshot_->edges().Add(edge); | 75 snapshot_->edges().Add(edge); |
76 ++children_count_; | 76 ++children_count_; |
77 } | 77 } |
78 | 78 |
79 | 79 |
80 void HeapEntry::Print( | 80 void HeapEntry::Print( |
81 const char* prefix, const char* edge_name, int max_depth, int indent) { | 81 const char* prefix, const char* edge_name, int max_depth, int indent) { |
82 STATIC_ASSERT(sizeof(unsigned) == sizeof(id())); | 82 STATIC_ASSERT(sizeof(unsigned) == sizeof(id())); |
83 base::OS::Print("%6" PRIuS " @%6u %*c %s%s: ", self_size(), id(), indent, | 83 base::OS::Print("%6" PRIuS " @%6u %*c %s%s: ", self_size(), id(), indent, ' ', |
84 ' ', prefix, edge_name); | 84 prefix, edge_name); |
85 if (type() != kString) { | 85 if (type() != kString) { |
86 base::OS::Print("%s %.40s\n", TypeAsString(), name_); | 86 base::OS::Print("%s %.40s\n", TypeAsString(), name_); |
87 } else { | 87 } else { |
88 base::OS::Print("\""); | 88 base::OS::Print("\""); |
89 const char* c = name_; | 89 const char* c = name_; |
90 while (*c && (c - name_) <= 40) { | 90 while (*c && (c - name_) <= 40) { |
91 if (*c != '\n') | 91 if (*c != '\n') |
92 base::OS::Print("%c", *c); | 92 base::OS::Print("%c", *c); |
93 else | 93 else |
94 base::OS::Print("\\n"); | 94 base::OS::Print("\\n"); |
(...skipping 1285 matching lines...) Loading... |
1380 SharedFunctionInfo::kFunctionDataOffset); | 1380 SharedFunctionInfo::kFunctionDataOffset); |
1381 SetInternalReference(obj, entry, | 1381 SetInternalReference(obj, entry, |
1382 "debug_info", shared->debug_info(), | 1382 "debug_info", shared->debug_info(), |
1383 SharedFunctionInfo::kDebugInfoOffset); | 1383 SharedFunctionInfo::kDebugInfoOffset); |
1384 SetInternalReference(obj, entry, "function_identifier", | 1384 SetInternalReference(obj, entry, "function_identifier", |
1385 shared->function_identifier(), | 1385 shared->function_identifier(), |
1386 SharedFunctionInfo::kFunctionIdentifierOffset); | 1386 SharedFunctionInfo::kFunctionIdentifierOffset); |
1387 SetInternalReference(obj, entry, | 1387 SetInternalReference(obj, entry, |
1388 "optimized_code_map", shared->optimized_code_map(), | 1388 "optimized_code_map", shared->optimized_code_map(), |
1389 SharedFunctionInfo::kOptimizedCodeMapOffset); | 1389 SharedFunctionInfo::kOptimizedCodeMapOffset); |
1390 SetInternalReference(obj, entry, | 1390 SetInternalReference(obj, entry, "feedback_metadata", |
1391 "feedback_vector", shared->feedback_vector(), | 1391 shared->feedback_metadata(), |
1392 SharedFunctionInfo::kFeedbackVectorOffset); | 1392 SharedFunctionInfo::kFeedbackMetadataOffset); |
1393 } | 1393 } |
1394 | 1394 |
1395 | 1395 |
1396 void V8HeapExplorer::ExtractScriptReferences(int entry, Script* script) { | 1396 void V8HeapExplorer::ExtractScriptReferences(int entry, Script* script) { |
1397 HeapObject* obj = script; | 1397 HeapObject* obj = script; |
1398 SetInternalReference(obj, entry, | 1398 SetInternalReference(obj, entry, |
1399 "source", script->source(), | 1399 "source", script->source(), |
1400 Script::kSourceOffset); | 1400 Script::kSourceOffset); |
1401 SetInternalReference(obj, entry, | 1401 SetInternalReference(obj, entry, |
1402 "name", script->name(), | 1402 "name", script->name(), |
(...skipping 1720 matching lines...) Loading... |
3123 for (int i = 1; i < sorted_strings.length(); ++i) { | 3123 for (int i = 1; i < sorted_strings.length(); ++i) { |
3124 writer_->AddCharacter(','); | 3124 writer_->AddCharacter(','); |
3125 SerializeString(sorted_strings[i]); | 3125 SerializeString(sorted_strings[i]); |
3126 if (writer_->aborted()) return; | 3126 if (writer_->aborted()) return; |
3127 } | 3127 } |
3128 } | 3128 } |
3129 | 3129 |
3130 | 3130 |
3131 } // namespace internal | 3131 } // namespace internal |
3132 } // namespace v8 | 3132 } // namespace v8 |
OLD | NEW |