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

Side by Side Diff: src/api.cc

Issue 2128613004: Move SimulatorHelper into V8 out of profiler clients. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressing 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
« no previous file with comments | « no previous file | 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 7638 matching lines...) Expand 10 before | Expand all | Expand 10 after
7649 isolate->heap()->CollectCodeStatistics(); 7649 isolate->heap()->CollectCodeStatistics();
7650 7650
7651 code_statistics->code_and_metadata_size_ = isolate->code_and_metadata_size(); 7651 code_statistics->code_and_metadata_size_ = isolate->code_and_metadata_size();
7652 code_statistics->bytecode_and_metadata_size_ = 7652 code_statistics->bytecode_and_metadata_size_ =
7653 isolate->bytecode_and_metadata_size(); 7653 isolate->bytecode_and_metadata_size();
7654 return true; 7654 return true;
7655 } 7655 }
7656 7656
7657 void Isolate::GetStackSample(const RegisterState& state, void** frames, 7657 void Isolate::GetStackSample(const RegisterState& state, void** frames,
7658 size_t frames_limit, SampleInfo* sample_info) { 7658 size_t frames_limit, SampleInfo* sample_info) {
7659 #if defined(USE_SIMULATOR) 7659 if (TickSample::GetStackSample(this, state, TickSample::kSkipCEntryFrame,
7660 RegisterState regs; 7660 frames, frames_limit, sample_info)) {
7661 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7662 if (!i::SimulatorHelper::FillRegisters(isolate, &regs)) {
7663 sample_info->frames_count = 0;
7664 sample_info->vm_state = OTHER;
7665 sample_info->external_callback_entry = nullptr;
7666 return; 7661 return;
7667 } 7662 }
7668 #else 7663 sample_info->frames_count = 0;
7669 const RegisterState& regs = state; 7664 sample_info->vm_state = OTHER;
7670 #endif 7665 sample_info->external_callback_entry = nullptr;
7671 TickSample::GetStackSample(this, regs, TickSample::kSkipCEntryFrame, frames,
7672 frames_limit, sample_info);
7673 } 7666 }
7674 7667
7675 size_t Isolate::NumberOfPhantomHandleResetsSinceLastCall() { 7668 size_t Isolate::NumberOfPhantomHandleResetsSinceLastCall() {
7676 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7669 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7677 size_t result = isolate->global_handles()->NumberOfPhantomHandleResets(); 7670 size_t result = isolate->global_handles()->NumberOfPhantomHandleResets();
7678 isolate->global_handles()->ResetNumberOfPhantomHandleResets(); 7671 isolate->global_handles()->ResetNumberOfPhantomHandleResets();
7679 return result; 7672 return result;
7680 } 7673 }
7681 7674
7682 void Isolate::SetEventLogger(LogEventCallback that) { 7675 void Isolate::SetEventLogger(LogEventCallback that) {
(...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after
9019 Address callback_address = 9012 Address callback_address =
9020 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 9013 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
9021 VMState<EXTERNAL> state(isolate); 9014 VMState<EXTERNAL> state(isolate);
9022 ExternalCallbackScope call_scope(isolate, callback_address); 9015 ExternalCallbackScope call_scope(isolate, callback_address);
9023 callback(info); 9016 callback(info);
9024 } 9017 }
9025 9018
9026 9019
9027 } // namespace internal 9020 } // namespace internal
9028 } // namespace v8 9021 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698