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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 return (*entry1_ptr)->id() < (*entry2_ptr)->id() ? -1 : 1; | 316 return (*entry1_ptr)->id() < (*entry2_ptr)->id() ? -1 : 1; |
317 } | 317 } |
318 | 318 |
319 | 319 |
320 List<HeapEntry*>* HeapSnapshot::GetSortedEntriesList() { | 320 List<HeapEntry*>* HeapSnapshot::GetSortedEntriesList() { |
321 if (sorted_entries_.is_empty()) { | 321 if (sorted_entries_.is_empty()) { |
322 sorted_entries_.Allocate(entries_.length()); | 322 sorted_entries_.Allocate(entries_.length()); |
323 for (int i = 0; i < entries_.length(); ++i) { | 323 for (int i = 0; i < entries_.length(); ++i) { |
324 sorted_entries_[i] = &entries_[i]; | 324 sorted_entries_[i] = &entries_[i]; |
325 } | 325 } |
326 sorted_entries_.Sort<int (*)(HeapEntry* const*, HeapEntry* const*)>( | 326 sorted_entries_.Sort(SortByIds); |
327 SortByIds); | |
328 } | 327 } |
329 return &sorted_entries_; | 328 return &sorted_entries_; |
330 } | 329 } |
331 | 330 |
332 | 331 |
333 void HeapSnapshot::Print(int max_depth) { | 332 void HeapSnapshot::Print(int max_depth) { |
334 root()->Print("", "", max_depth, 0); | 333 root()->Print("", "", max_depth, 0); |
335 } | 334 } |
336 | 335 |
337 | 336 |
(...skipping 2840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3178 for (int i = 1; i < sorted_strings.length(); ++i) { | 3177 for (int i = 1; i < sorted_strings.length(); ++i) { |
3179 writer_->AddCharacter(','); | 3178 writer_->AddCharacter(','); |
3180 SerializeString(sorted_strings[i]); | 3179 SerializeString(sorted_strings[i]); |
3181 if (writer_->aborted()) return; | 3180 if (writer_->aborted()) return; |
3182 } | 3181 } |
3183 } | 3182 } |
3184 | 3183 |
3185 | 3184 |
3186 } // namespace internal | 3185 } // namespace internal |
3187 } // namespace v8 | 3186 } // namespace v8 |
OLD | NEW |