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

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 & address comments. 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 7508 matching lines...) Expand 10 before | Expand all | Expand 10 after
7557 isolate->heap()->CollectCodeStatistics(); 7558 isolate->heap()->CollectCodeStatistics();
7558 7559
7559 code_statistics->code_and_metadata_size_ = isolate->code_and_metadata_size(); 7560 code_statistics->code_and_metadata_size_ = isolate->code_and_metadata_size();
7560 code_statistics->bytecode_and_metadata_size_ = 7561 code_statistics->bytecode_and_metadata_size_ =
7561 isolate->bytecode_and_metadata_size(); 7562 isolate->bytecode_and_metadata_size();
7562 return true; 7563 return true;
7563 } 7564 }
7564 7565
7565 void Isolate::GetStackSample(const RegisterState& state, void** frames, 7566 void Isolate::GetStackSample(const RegisterState& state, void** frames,
7566 size_t frames_limit, SampleInfo* sample_info) { 7567 size_t frames_limit, SampleInfo* sample_info) {
7568 #if defined(USE_SIMULATOR)
7567 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7569 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7568 #if defined(USE_SIMULATOR)
7569 RegisterState regs; 7570 RegisterState regs;
7570 regs.pc = state.pc; 7571 regs.pc = state.pc;
alph 2016/06/29 19:39:09 Hmm, how these got here??? Can you please drop the
lpy 2016/06/29 20:17:39 Done.
7571 regs.sp = state.sp; 7572 regs.sp = state.sp;
7572 regs.fp = state.fp; 7573 regs.fp = state.fp;
7573 if (!i::SimulatorHelper::FillRegisters(isolate, &regs)) { 7574 if (!i::SimulatorHelper::FillRegisters(isolate, &regs)) {
7574 sample_info->frames_count = 0; 7575 sample_info->frames_count = 0;
7575 sample_info->vm_state = OTHER; 7576 sample_info->vm_state = OTHER;
7576 sample_info->external_callback_entry = nullptr; 7577 sample_info->external_callback_entry = nullptr;
7577 return; 7578 return;
7578 } 7579 }
7579 #else 7580 #else
7580 const RegisterState& regs = state; 7581 const RegisterState& regs = state;
7581 #endif 7582 #endif
7582 i::TickSample::GetStackSample(isolate, regs, i::TickSample::kSkipCEntryFrame, 7583 TickSample::GetStackSample(this, regs, TickSample::kSkipCEntryFrame, frames,
7583 frames, frames_limit, sample_info); 7584 frames_limit, sample_info);
7584 } 7585 }
7585 7586
7586 size_t Isolate::NumberOfPhantomHandleResetsSinceLastCall() { 7587 size_t Isolate::NumberOfPhantomHandleResetsSinceLastCall() {
7587 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7588 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7588 size_t result = isolate->global_handles()->NumberOfPhantomHandleResets(); 7589 size_t result = isolate->global_handles()->NumberOfPhantomHandleResets();
7589 isolate->global_handles()->ResetNumberOfPhantomHandleResets(); 7590 isolate->global_handles()->ResetNumberOfPhantomHandleResets();
7590 return result; 7591 return result;
7591 } 7592 }
7592 7593
7593 void Isolate::SetEventLogger(LogEventCallback that) { 7594 void Isolate::SetEventLogger(LogEventCallback that) {
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after
8924 Address callback_address = 8925 Address callback_address =
8925 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8926 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8926 VMState<EXTERNAL> state(isolate); 8927 VMState<EXTERNAL> state(isolate);
8927 ExternalCallbackScope call_scope(isolate, callback_address); 8928 ExternalCallbackScope call_scope(isolate, callback_address);
8928 callback(info); 8929 callback(info);
8929 } 8930 }
8930 8931
8931 8932
8932 } // namespace internal 8933 } // namespace internal
8933 } // namespace v8 8934 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698