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

Side by Side Diff: src/profiler/sampling-heap-profiler.h

Issue 1929813002: Sampling heap profiler: Fix potential crash on accessing scripts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | src/profiler/sampling-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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_SAMPLING_HEAP_PROFILER_H_ 5 #ifndef V8_PROFILER_SAMPLING_HEAP_PROFILER_H_
6 #define V8_PROFILER_SAMPLING_HEAP_PROFILER_H_ 6 #define V8_PROFILER_SAMPLING_HEAP_PROFILER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 // Methods that construct v8::AllocationProfile. 104 // Methods that construct v8::AllocationProfile.
105 105
106 // Translates the provided AllocationNode *node* returning an equivalent 106 // Translates the provided AllocationNode *node* returning an equivalent
107 // AllocationProfile::Node. The newly created AllocationProfile::Node is added 107 // AllocationProfile::Node. The newly created AllocationProfile::Node is added
108 // to the provided AllocationProfile *profile*. Line numbers, column numbers, 108 // to the provided AllocationProfile *profile*. Line numbers, column numbers,
109 // and script names are resolved using *scripts* which maps all currently 109 // and script names are resolved using *scripts* which maps all currently
110 // loaded scripts keyed by their script id. 110 // loaded scripts keyed by their script id.
111 v8::AllocationProfile::Node* TranslateAllocationNode( 111 v8::AllocationProfile::Node* TranslateAllocationNode(
112 AllocationProfile* profile, SamplingHeapProfiler::AllocationNode* node, 112 AllocationProfile* profile, SamplingHeapProfiler::AllocationNode* node,
113 const std::map<int, Script*>& scripts); 113 const std::map<int, Handle<Script>>& scripts);
114 v8::AllocationProfile::Allocation ScaleSample(size_t size, 114 v8::AllocationProfile::Allocation ScaleSample(size_t size,
115 unsigned int count); 115 unsigned int count);
116 AllocationNode* AddStack(); 116 AllocationNode* AddStack();
117 AllocationNode* FindOrAddChildNode(AllocationNode* parent, const char* name, 117 AllocationNode* FindOrAddChildNode(AllocationNode* parent, const char* name,
118 int script_id, int start_position); 118 int script_id, int start_position);
119 119
120 Isolate* const isolate_; 120 Isolate* const isolate_;
121 Heap* const heap_; 121 Heap* const heap_;
122 base::SmartPointer<SamplingAllocationObserver> new_space_observer_; 122 base::SmartPointer<SamplingAllocationObserver> new_space_observer_;
123 base::SmartPointer<SamplingAllocationObserver> other_spaces_observer_; 123 base::SmartPointer<SamplingAllocationObserver> other_spaces_observer_;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 SamplingHeapProfiler* const profiler_; 157 SamplingHeapProfiler* const profiler_;
158 Heap* const heap_; 158 Heap* const heap_;
159 base::RandomNumberGenerator* const random_; 159 base::RandomNumberGenerator* const random_;
160 uint64_t const rate_; 160 uint64_t const rate_;
161 }; 161 };
162 162
163 } // namespace internal 163 } // namespace internal
164 } // namespace v8 164 } // namespace v8
165 165
166 #endif // V8_PROFILER_SAMPLING_HEAP_PROFILER_H_ 166 #endif // V8_PROFILER_SAMPLING_HEAP_PROFILER_H_
OLDNEW
« no previous file with comments | « no previous file | src/profiler/sampling-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698