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

Side by Side Diff: src/api.cc

Issue 2105943002: Expose TickSample and its APIs in v8-profiler.h (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years, 5 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 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 18 matching lines...) Expand all
29 #include "src/char-predicates-inl.h" 29 #include "src/char-predicates-inl.h"
30 #include "src/code-stubs.h" 30 #include "src/code-stubs.h"
31 #include "src/compiler.h" 31 #include "src/compiler.h"
32 #include "src/context-measure.h" 32 #include "src/context-measure.h"
33 #include "src/contexts.h" 33 #include "src/contexts.h"
34 #include "src/conversions-inl.h" 34 #include "src/conversions-inl.h"
35 #include "src/counters.h" 35 #include "src/counters.h"
36 #include "src/debug/debug.h" 36 #include "src/debug/debug.h"
37 #include "src/deoptimizer.h" 37 #include "src/deoptimizer.h"
38 #include "src/execution.h" 38 #include "src/execution.h"
39 #include "src/frames-inl.h"
39 #include "src/gdb-jit.h" 40 #include "src/gdb-jit.h"
40 #include "src/global-handles.h" 41 #include "src/global-handles.h"
41 #include "src/icu_util.h" 42 #include "src/icu_util.h"
42 #include "src/isolate-inl.h" 43 #include "src/isolate-inl.h"
43 #include "src/json-parser.h" 44 #include "src/json-parser.h"
44 #include "src/json-stringifier.h" 45 #include "src/json-stringifier.h"
45 #include "src/messages.h" 46 #include "src/messages.h"
46 #include "src/parsing/parser.h" 47 #include "src/parsing/parser.h"
47 #include "src/parsing/scanner-character-streams.h" 48 #include "src/parsing/scanner-character-streams.h"
48 #include "src/pending-compilation-error-handler.h" 49 #include "src/pending-compilation-error-handler.h"
(...skipping 7513 matching lines...) Expand 10 before | Expand all | Expand 10 after
7562 isolate->heap()->CollectCodeStatistics(); 7563 isolate->heap()->CollectCodeStatistics();
7563 7564
7564 code_statistics->code_and_metadata_size_ = isolate->code_and_metadata_size(); 7565 code_statistics->code_and_metadata_size_ = isolate->code_and_metadata_size();
7565 code_statistics->bytecode_and_metadata_size_ = 7566 code_statistics->bytecode_and_metadata_size_ =
7566 isolate->bytecode_and_metadata_size(); 7567 isolate->bytecode_and_metadata_size();
7567 return true; 7568 return true;
7568 } 7569 }
7569 7570
7570 void Isolate::GetStackSample(const RegisterState& state, void** frames, 7571 void Isolate::GetStackSample(const RegisterState& state, void** frames,
7571 size_t frames_limit, SampleInfo* sample_info) { 7572 size_t frames_limit, SampleInfo* sample_info) {
7573 #if defined(USE_SIMULATOR)
7572 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7574 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7573 #if defined(USE_SIMULATOR) 7575 if (!i::SimulatorHelper::FillRegisters(isolate,
7574 RegisterState regs; 7576 const_cast<RegisterState*>(&state))) {
alph 2016/06/30 21:18:08 please avoid using const_cast, as the caller is no
lpy 2016/06/30 22:51:29 Done.
7575 regs.pc = state.pc;
7576 regs.sp = state.sp;
7577 regs.fp = state.fp;
7578 if (!i::SimulatorHelper::FillRegisters(isolate, &regs)) {
7579 sample_info->frames_count = 0; 7577 sample_info->frames_count = 0;
7580 sample_info->vm_state = OTHER; 7578 sample_info->vm_state = OTHER;
7581 sample_info->external_callback_entry = nullptr; 7579 sample_info->external_callback_entry = nullptr;
7582 return; 7580 return;
7583 } 7581 }
7584 #else
7585 const RegisterState& regs = state;
7586 #endif 7582 #endif
7587 i::TickSample::GetStackSample(isolate, regs, i::TickSample::kSkipCEntryFrame, 7583 TickSample::GetStackSample(this, state, TickSample::kSkipCEntryFrame, frames,
7588 frames, frames_limit, sample_info); 7584 frames_limit, sample_info);
7589 } 7585 }
7590 7586
7591 size_t Isolate::NumberOfPhantomHandleResetsSinceLastCall() { 7587 size_t Isolate::NumberOfPhantomHandleResetsSinceLastCall() {
7592 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7588 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7593 size_t result = isolate->global_handles()->NumberOfPhantomHandleResets(); 7589 size_t result = isolate->global_handles()->NumberOfPhantomHandleResets();
7594 isolate->global_handles()->ResetNumberOfPhantomHandleResets(); 7590 isolate->global_handles()->ResetNumberOfPhantomHandleResets();
7595 return result; 7591 return result;
7596 } 7592 }
7597 7593
7598 void Isolate::SetEventLogger(LogEventCallback that) { 7594 void Isolate::SetEventLogger(LogEventCallback that) {
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after
8929 Address callback_address = 8925 Address callback_address =
8930 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8926 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8931 VMState<EXTERNAL> state(isolate); 8927 VMState<EXTERNAL> state(isolate);
8932 ExternalCallbackScope call_scope(isolate, callback_address); 8928 ExternalCallbackScope call_scope(isolate, callback_address);
8933 callback(info); 8929 callback(info);
8934 } 8930 }
8935 8931
8936 8932
8937 } // namespace internal 8933 } // namespace internal
8938 } // namespace v8 8934 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8-profiler.h ('k') | src/log.h » ('j') | src/profiler/cpu-profiler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698