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

Side by Side Diff: src/api.cc

Issue 2189513002: Move SimulatorHelper into V8 out of profiler clients. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update Created 4 years, 4 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 | « include/v8-profiler.h ('k') | src/log.cc » ('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 7629 matching lines...) Expand 10 before | Expand all | Expand 10 after
7640 isolate->heap()->CollectCodeStatistics(); 7640 isolate->heap()->CollectCodeStatistics();
7641 7641
7642 code_statistics->code_and_metadata_size_ = isolate->code_and_metadata_size(); 7642 code_statistics->code_and_metadata_size_ = isolate->code_and_metadata_size();
7643 code_statistics->bytecode_and_metadata_size_ = 7643 code_statistics->bytecode_and_metadata_size_ =
7644 isolate->bytecode_and_metadata_size(); 7644 isolate->bytecode_and_metadata_size();
7645 return true; 7645 return true;
7646 } 7646 }
7647 7647
7648 void Isolate::GetStackSample(const RegisterState& state, void** frames, 7648 void Isolate::GetStackSample(const RegisterState& state, void** frames,
7649 size_t frames_limit, SampleInfo* sample_info) { 7649 size_t frames_limit, SampleInfo* sample_info) {
7650 #if defined(USE_SIMULATOR) 7650 RegisterState regs = state;
7651 RegisterState regs; 7651 if (TickSample::GetStackSample(this, &regs, TickSample::kSkipCEntryFrame,
7652 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7652 frames, frames_limit, sample_info)) {
7653 if (!i::SimulatorHelper::FillRegisters(isolate, &regs)) {
7654 sample_info->frames_count = 0;
7655 sample_info->vm_state = OTHER;
7656 sample_info->external_callback_entry = nullptr;
7657 return; 7653 return;
7658 } 7654 }
7659 #else 7655 sample_info->frames_count = 0;
7660 const RegisterState& regs = state; 7656 sample_info->vm_state = OTHER;
7661 #endif 7657 sample_info->external_callback_entry = nullptr;
7662 TickSample::GetStackSample(this, regs, TickSample::kSkipCEntryFrame, frames,
7663 frames_limit, sample_info);
7664 } 7658 }
7665 7659
7666 size_t Isolate::NumberOfPhantomHandleResetsSinceLastCall() { 7660 size_t Isolate::NumberOfPhantomHandleResetsSinceLastCall() {
7667 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7661 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7668 size_t result = isolate->global_handles()->NumberOfPhantomHandleResets(); 7662 size_t result = isolate->global_handles()->NumberOfPhantomHandleResets();
7669 isolate->global_handles()->ResetNumberOfPhantomHandleResets(); 7663 isolate->global_handles()->ResetNumberOfPhantomHandleResets();
7670 return result; 7664 return result;
7671 } 7665 }
7672 7666
7673 void Isolate::SetEventLogger(LogEventCallback that) { 7667 void Isolate::SetEventLogger(LogEventCallback that) {
(...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after
8989 Address callback_address = 8983 Address callback_address =
8990 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8984 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8991 VMState<EXTERNAL> state(isolate); 8985 VMState<EXTERNAL> state(isolate);
8992 ExternalCallbackScope call_scope(isolate, callback_address); 8986 ExternalCallbackScope call_scope(isolate, callback_address);
8993 callback(info); 8987 callback(info);
8994 } 8988 }
8995 8989
8996 8990
8997 } // namespace internal 8991 } // namespace internal
8998 } // namespace v8 8992 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8-profiler.h ('k') | src/log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698