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

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: 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
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 7685 matching lines...) Expand 10 before | Expand all | Expand 10 after
7696 isolate->heap()->CollectCodeStatistics(); 7696 isolate->heap()->CollectCodeStatistics();
7697 7697
7698 code_statistics->code_and_metadata_size_ = isolate->code_and_metadata_size(); 7698 code_statistics->code_and_metadata_size_ = isolate->code_and_metadata_size();
7699 code_statistics->bytecode_and_metadata_size_ = 7699 code_statistics->bytecode_and_metadata_size_ =
7700 isolate->bytecode_and_metadata_size(); 7700 isolate->bytecode_and_metadata_size();
7701 return true; 7701 return true;
7702 } 7702 }
7703 7703
7704 void Isolate::GetStackSample(const RegisterState& state, void** frames, 7704 void Isolate::GetStackSample(const RegisterState& state, void** frames,
7705 size_t frames_limit, SampleInfo* sample_info) { 7705 size_t frames_limit, SampleInfo* sample_info) {
7706 #if defined(USE_SIMULATOR) 7706 RegisterState updated_state;
7707 RegisterState regs; 7707 if (TickSample::GetStackSample(this, state, updated_state,
7708 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7708 TickSample::kSkipCEntryFrame, frames,
7709 if (!i::SimulatorHelper::FillRegisters(isolate, &regs)) { 7709 frames_limit, sample_info)) {
7710 sample_info->frames_count = 0;
7711 sample_info->vm_state = OTHER;
7712 sample_info->external_callback_entry = nullptr;
7713 return; 7710 return;
7714 } 7711 }
7715 #else 7712 sample_info->frames_count = 0;
7716 const RegisterState& regs = state; 7713 sample_info->vm_state = OTHER;
7717 #endif 7714 sample_info->external_callback_entry = nullptr;
7718 TickSample::GetStackSample(this, regs, TickSample::kSkipCEntryFrame, frames,
7719 frames_limit, sample_info);
7720 } 7715 }
7721 7716
7722 size_t Isolate::NumberOfPhantomHandleResetsSinceLastCall() { 7717 size_t Isolate::NumberOfPhantomHandleResetsSinceLastCall() {
7723 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7718 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7724 size_t result = isolate->global_handles()->NumberOfPhantomHandleResets(); 7719 size_t result = isolate->global_handles()->NumberOfPhantomHandleResets();
7725 isolate->global_handles()->ResetNumberOfPhantomHandleResets(); 7720 isolate->global_handles()->ResetNumberOfPhantomHandleResets();
7726 return result; 7721 return result;
7727 } 7722 }
7728 7723
7729 void Isolate::SetEventLogger(LogEventCallback that) { 7724 void Isolate::SetEventLogger(LogEventCallback that) {
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after
9042 Address callback_address = 9037 Address callback_address =
9043 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 9038 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
9044 VMState<EXTERNAL> state(isolate); 9039 VMState<EXTERNAL> state(isolate);
9045 ExternalCallbackScope call_scope(isolate, callback_address); 9040 ExternalCallbackScope call_scope(isolate, callback_address);
9046 callback(info); 9041 callback(info);
9047 } 9042 }
9048 9043
9049 9044
9050 } // namespace internal 9045 } // namespace internal
9051 } // namespace v8 9046 } // namespace v8
OLDNEW
« include/v8-profiler.h ('K') | « include/v8-profiler.h ('k') | src/log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698