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

Side by Side Diff: src/api.cc

Issue 1926863003: Make Isolate::GetStackSample API support simulator (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/sampler.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 7504 matching lines...) Expand 10 before | Expand all | Expand 10 after
7515 object_statistics->object_sub_type_ = object_sub_type; 7515 object_statistics->object_sub_type_ = object_sub_type;
7516 object_statistics->object_count_ = object_count; 7516 object_statistics->object_count_ = object_count;
7517 object_statistics->object_size_ = object_size; 7517 object_statistics->object_size_ = object_size;
7518 return true; 7518 return true;
7519 } 7519 }
7520 7520
7521 7521
7522 void Isolate::GetStackSample(const RegisterState& state, void** frames, 7522 void Isolate::GetStackSample(const RegisterState& state, void** frames,
7523 size_t frames_limit, SampleInfo* sample_info) { 7523 size_t frames_limit, SampleInfo* sample_info) {
7524 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7524 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7525 i::TickSample::GetStackSample(isolate, state, i::TickSample::kSkipCEntryFrame, 7525 #if defined(USE_SIMULATOR)
7526 RegisterState regs;
7527 regs.pc = state.pc;
7528 regs.sp = state.sp;
7529 regs.fp = state.fp;
7530 i::SimulatorHelper::FillRegisters(isolate, &regs);
7531 #else
7532 const RegisterState& regs = state;
7533 #endif
7534 i::TickSample::GetStackSample(isolate, regs, i::TickSample::kSkipCEntryFrame,
7526 frames, frames_limit, sample_info); 7535 frames, frames_limit, sample_info);
7527 } 7536 }
7528 7537
7529 7538
7530 void Isolate::SetEventLogger(LogEventCallback that) { 7539 void Isolate::SetEventLogger(LogEventCallback that) {
7531 // Do not overwrite the event logger if we want to log explicitly. 7540 // Do not overwrite the event logger if we want to log explicitly.
7532 if (i::FLAG_log_internal_timer_events) return; 7541 if (i::FLAG_log_internal_timer_events) return;
7533 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7542 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7534 isolate->set_event_logger(that); 7543 isolate->set_event_logger(that);
7535 } 7544 }
(...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after
8838 Address callback_address = 8847 Address callback_address =
8839 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8848 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8840 VMState<EXTERNAL> state(isolate); 8849 VMState<EXTERNAL> state(isolate);
8841 ExternalCallbackScope call_scope(isolate, callback_address); 8850 ExternalCallbackScope call_scope(isolate, callback_address);
8842 callback(info); 8851 callback(info);
8843 } 8852 }
8844 8853
8845 8854
8846 } // namespace internal 8855 } // namespace internal
8847 } // namespace v8 8856 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/profiler/sampler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698