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

Side by Side Diff: src/profiler/heap-snapshot-generator-inl.h

Issue 2595003002: Use std::deque for storing edges and children in heap snapshot. (Closed)
Patch Set: fix ce Created 3 years, 11 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
« no previous file with comments | « src/profiler/heap-snapshot-generator.cc ('k') | test/cctest/test-heap-profiler.cc » ('j') | 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 // 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 #ifndef V8_PROFILER_HEAP_SNAPSHOT_GENERATOR_INL_H_ 5 #ifndef V8_PROFILER_HEAP_SNAPSHOT_GENERATOR_INL_H_
6 #define V8_PROFILER_HEAP_SNAPSHOT_GENERATOR_INL_H_ 6 #define V8_PROFILER_HEAP_SNAPSHOT_GENERATOR_INL_H_
7 7
8 #include "src/profiler/heap-snapshot-generator.h" 8 #include "src/profiler/heap-snapshot-generator.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 20 matching lines...) Expand all
31 } 31 }
32 32
33 33
34 int HeapEntry::set_children_index(int index) { 34 int HeapEntry::set_children_index(int index) {
35 children_index_ = index; 35 children_index_ = index;
36 int next_index = index + children_count_; 36 int next_index = index + children_count_;
37 children_count_ = 0; 37 children_count_ = 0;
38 return next_index; 38 return next_index;
39 } 39 }
40 40
41 std::deque<HeapGraphEdge*>::iterator HeapEntry::children_begin() {
42 DCHECK(children_index_ >= 0);
43 SLOW_DCHECK(
44 children_index_ < static_cast<int>(snapshot_->children().size()) ||
45 (children_index_ == static_cast<int>(snapshot_->children().size()) &&
46 children_count_ == 0));
47 return snapshot_->children().begin() + children_index_;
48 }
41 49
42 HeapGraphEdge** HeapEntry::children_arr() { 50 std::deque<HeapGraphEdge*>::iterator HeapEntry::children_end() {
43 DCHECK(children_index_ >= 0); 51 return children_begin() + children_count_;
44 SLOW_DCHECK(children_index_ < snapshot_->children().length() ||
45 (children_index_ == snapshot_->children().length() &&
46 children_count_ == 0));
47 return &snapshot_->children().first() + children_index_;
48 } 52 }
49 53
50 54
51 Isolate* HeapEntry::isolate() const { return snapshot_->profiler()->isolate(); } 55 Isolate* HeapEntry::isolate() const { return snapshot_->profiler()->isolate(); }
52 56
53 } // namespace internal 57 } // namespace internal
54 } // namespace v8 58 } // namespace v8
55 59
56 #endif // V8_PROFILER_HEAP_SNAPSHOT_GENERATOR_INL_H_ 60 #endif // V8_PROFILER_HEAP_SNAPSHOT_GENERATOR_INL_H_
OLDNEW
« no previous file with comments | « src/profiler/heap-snapshot-generator.cc ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698