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

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

Issue 1909353002: [wasm] Make wasm info available on the stack trace (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@wasm-offset-table-3
Patch Set: more gcmole problems Created 4 years, 8 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
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 #include "src/profiler/sampling-heap-profiler.h" 5 #include "src/profiler/sampling-heap-profiler.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <memory> 8 #include <memory>
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/base/utils/random-number-generator.h" 10 #include "src/base/utils/random-number-generator.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 } 136 }
137 AllocationNode* child = new AllocationNode(name, script_id, start_position); 137 AllocationNode* child = new AllocationNode(name, script_id, start_position);
138 parent->children_.push_back(child); 138 parent->children_.push_back(child);
139 return child; 139 return child;
140 } 140 }
141 141
142 SamplingHeapProfiler::AllocationNode* SamplingHeapProfiler::AddStack() { 142 SamplingHeapProfiler::AllocationNode* SamplingHeapProfiler::AddStack() {
143 AllocationNode* node = &profile_root_; 143 AllocationNode* node = &profile_root_;
144 144
145 std::vector<SharedFunctionInfo*> stack; 145 std::vector<SharedFunctionInfo*> stack;
146 StackTraceFrameIterator it(isolate_); 146 JavaScriptFrameIterator it(isolate_);
147 int frames_captured = 0; 147 int frames_captured = 0;
148 while (!it.done() && frames_captured < stack_depth_) { 148 while (!it.done() && frames_captured < stack_depth_) {
149 StandardFrame* frame = it.frame(); 149 JavaScriptFrame* frame = it.frame();
150 SharedFunctionInfo* shared = frame->function()->shared(); 150 SharedFunctionInfo* shared = frame->function()->shared();
151 stack.push_back(shared); 151 stack.push_back(shared);
152 152
153 frames_captured++; 153 frames_captured++;
154 it.Advance(); 154 it.Advance();
155 } 155 }
156 156
157 if (frames_captured == 0) { 157 if (frames_captured == 0) {
158 const char* name = nullptr; 158 const char* name = nullptr;
159 switch (isolate_->current_vm_state()) { 159 switch (isolate_->current_vm_state()) {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 auto profile = new v8::internal::AllocationProfile(); 258 auto profile = new v8::internal::AllocationProfile();
259 259
260 TranslateAllocationNode(profile, &profile_root_, scripts); 260 TranslateAllocationNode(profile, &profile_root_, scripts);
261 261
262 return profile; 262 return profile;
263 } 263 }
264 264
265 265
266 } // namespace internal 266 } // namespace internal
267 } // namespace v8 267 } // namespace v8
OLDNEW
« src/messages.cc ('K') | « src/profiler/allocation-tracker.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698