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