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

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: Make internal::TickSample 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/globals.h" 42 #include "src/globals.h"
42 #include "src/icu_util.h" 43 #include "src/icu_util.h"
43 #include "src/isolate-inl.h" 44 #include "src/isolate-inl.h"
44 #include "src/json-parser.h" 45 #include "src/json-parser.h"
45 #include "src/json-stringifier.h" 46 #include "src/json-stringifier.h"
46 #include "src/messages.h" 47 #include "src/messages.h"
47 #include "src/parsing/parser.h" 48 #include "src/parsing/parser.h"
48 #include "src/parsing/scanner-character-streams.h" 49 #include "src/parsing/scanner-character-streams.h"
(...skipping 7514 matching lines...) Expand 10 before | Expand all | Expand 10 after
7563 isolate->heap()->CollectCodeStatistics(); 7564 isolate->heap()->CollectCodeStatistics();
7564 7565
7565 code_statistics->code_and_metadata_size_ = isolate->code_and_metadata_size(); 7566 code_statistics->code_and_metadata_size_ = isolate->code_and_metadata_size();
7566 code_statistics->bytecode_and_metadata_size_ = 7567 code_statistics->bytecode_and_metadata_size_ =
7567 isolate->bytecode_and_metadata_size(); 7568 isolate->bytecode_and_metadata_size();
7568 return true; 7569 return true;
7569 } 7570 }
7570 7571
7571 void Isolate::GetStackSample(const RegisterState& state, void** frames, 7572 void Isolate::GetStackSample(const RegisterState& state, void** frames,
7572 size_t frames_limit, SampleInfo* sample_info) { 7573 size_t frames_limit, SampleInfo* sample_info) {
7573 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7574 #if defined(USE_SIMULATOR) 7574 #if defined(USE_SIMULATOR)
7575 RegisterState regs; 7575 RegisterState regs;
7576 regs.pc = state.pc; 7576 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7577 regs.sp = state.sp;
7578 regs.fp = state.fp;
7579 if (!i::SimulatorHelper::FillRegisters(isolate, &regs)) { 7577 if (!i::SimulatorHelper::FillRegisters(isolate, &regs)) {
7580 sample_info->frames_count = 0; 7578 sample_info->frames_count = 0;
7581 sample_info->vm_state = OTHER; 7579 sample_info->vm_state = OTHER;
7582 sample_info->external_callback_entry = nullptr; 7580 sample_info->external_callback_entry = nullptr;
7583 return; 7581 return;
7584 } 7582 }
7585 #else 7583 #else
7586 const RegisterState& regs = state; 7584 const RegisterState& regs = state;
7587 #endif 7585 #endif
7588 i::TickSample::GetStackSample(isolate, regs, i::TickSample::kSkipCEntryFrame, 7586 TickSample::GetStackSample(this, regs, TickSample::kSkipCEntryFrame, frames,
7589 frames, frames_limit, sample_info); 7587 frames_limit, sample_info);
7590 } 7588 }
7591 7589
7592 size_t Isolate::NumberOfPhantomHandleResetsSinceLastCall() { 7590 size_t Isolate::NumberOfPhantomHandleResetsSinceLastCall() {
7593 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7591 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7594 size_t result = isolate->global_handles()->NumberOfPhantomHandleResets(); 7592 size_t result = isolate->global_handles()->NumberOfPhantomHandleResets();
7595 isolate->global_handles()->ResetNumberOfPhantomHandleResets(); 7593 isolate->global_handles()->ResetNumberOfPhantomHandleResets();
7596 return result; 7594 return result;
7597 } 7595 }
7598 7596
7599 void Isolate::SetEventLogger(LogEventCallback that) { 7597 void Isolate::SetEventLogger(LogEventCallback that) {
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after
8930 Address callback_address = 8928 Address callback_address =
8931 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8929 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8932 VMState<EXTERNAL> state(isolate); 8930 VMState<EXTERNAL> state(isolate);
8933 ExternalCallbackScope call_scope(isolate, callback_address); 8931 ExternalCallbackScope call_scope(isolate, callback_address);
8934 callback(info); 8932 callback(info);
8935 } 8933 }
8936 8934
8937 8935
8938 } // namespace internal 8936 } // namespace internal
8939 } // namespace v8 8937 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8-profiler.h ('k') | src/log.h » ('j') | src/profiler/cpu-profiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698