OLD | NEW |
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 Loading... |
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 7523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7572 isolate->heap()->CollectCodeStatistics(); | 7573 isolate->heap()->CollectCodeStatistics(); |
7573 | 7574 |
7574 code_statistics->code_and_metadata_size_ = isolate->code_and_metadata_size(); | 7575 code_statistics->code_and_metadata_size_ = isolate->code_and_metadata_size(); |
7575 code_statistics->bytecode_and_metadata_size_ = | 7576 code_statistics->bytecode_and_metadata_size_ = |
7576 isolate->bytecode_and_metadata_size(); | 7577 isolate->bytecode_and_metadata_size(); |
7577 return true; | 7578 return true; |
7578 } | 7579 } |
7579 | 7580 |
7580 void Isolate::GetStackSample(const RegisterState& state, void** frames, | 7581 void Isolate::GetStackSample(const RegisterState& state, void** frames, |
7581 size_t frames_limit, SampleInfo* sample_info) { | 7582 size_t frames_limit, SampleInfo* sample_info) { |
7582 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | |
7583 #if defined(USE_SIMULATOR) | 7583 #if defined(USE_SIMULATOR) |
7584 RegisterState regs; | 7584 RegisterState regs; |
7585 regs.pc = state.pc; | 7585 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
7586 regs.sp = state.sp; | |
7587 regs.fp = state.fp; | |
7588 if (!i::SimulatorHelper::FillRegisters(isolate, ®s)) { | 7586 if (!i::SimulatorHelper::FillRegisters(isolate, ®s)) { |
7589 sample_info->frames_count = 0; | 7587 sample_info->frames_count = 0; |
7590 sample_info->vm_state = OTHER; | 7588 sample_info->vm_state = OTHER; |
7591 sample_info->external_callback_entry = nullptr; | 7589 sample_info->external_callback_entry = nullptr; |
7592 return; | 7590 return; |
7593 } | 7591 } |
7594 #else | 7592 #else |
7595 const RegisterState& regs = state; | 7593 const RegisterState& regs = state; |
7596 #endif | 7594 #endif |
7597 i::TickSample::GetStackSample(isolate, regs, i::TickSample::kSkipCEntryFrame, | 7595 TickSample::GetStackSample(this, regs, TickSample::kSkipCEntryFrame, frames, |
7598 frames, frames_limit, sample_info); | 7596 frames_limit, sample_info); |
7599 } | 7597 } |
7600 | 7598 |
7601 size_t Isolate::NumberOfPhantomHandleResetsSinceLastCall() { | 7599 size_t Isolate::NumberOfPhantomHandleResetsSinceLastCall() { |
7602 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 7600 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
7603 size_t result = isolate->global_handles()->NumberOfPhantomHandleResets(); | 7601 size_t result = isolate->global_handles()->NumberOfPhantomHandleResets(); |
7604 isolate->global_handles()->ResetNumberOfPhantomHandleResets(); | 7602 isolate->global_handles()->ResetNumberOfPhantomHandleResets(); |
7605 return result; | 7603 return result; |
7606 } | 7604 } |
7607 | 7605 |
7608 void Isolate::SetEventLogger(LogEventCallback that) { | 7606 void Isolate::SetEventLogger(LogEventCallback that) { |
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8939 Address callback_address = | 8937 Address callback_address = |
8940 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8938 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8941 VMState<EXTERNAL> state(isolate); | 8939 VMState<EXTERNAL> state(isolate); |
8942 ExternalCallbackScope call_scope(isolate, callback_address); | 8940 ExternalCallbackScope call_scope(isolate, callback_address); |
8943 callback(info); | 8941 callback(info); |
8944 } | 8942 } |
8945 | 8943 |
8946 | 8944 |
8947 } // namespace internal | 8945 } // namespace internal |
8948 } // namespace v8 | 8946 } // namespace v8 |
OLD | NEW |