| 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...) Expand 10 before | Expand all | Expand 10 after 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" V8PRIuPTR " @%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 |
| (...skipping 3045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3139 for (int i = 1; i < sorted_strings.length(); ++i) { | 3139 for (int i = 1; i < sorted_strings.length(); ++i) { |
| 3140 writer_->AddCharacter(','); | 3140 writer_->AddCharacter(','); |
| 3141 SerializeString(sorted_strings[i]); | 3141 SerializeString(sorted_strings[i]); |
| 3142 if (writer_->aborted()) return; | 3142 if (writer_->aborted()) return; |
| 3143 } | 3143 } |
| 3144 } | 3144 } |
| 3145 | 3145 |
| 3146 | 3146 |
| 3147 } // namespace internal | 3147 } // namespace internal |
| 3148 } // namespace v8 | 3148 } // namespace v8 |
| OLD | NEW |