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

Side by Side Diff: src/api.cc

Issue 2040683002: Remove dependencies of V8 on cpu-profiler is_profiling. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: use macro for declaring is_profiling Created 4 years, 6 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/assembler.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 8269 matching lines...) Expand 10 before | Expand all | Expand 10 after
8280 8280
8281 CpuProfile* CpuProfiler::StopProfiling(Local<String> title) { 8281 CpuProfile* CpuProfiler::StopProfiling(Local<String> title) {
8282 return reinterpret_cast<CpuProfile*>( 8282 return reinterpret_cast<CpuProfile*>(
8283 reinterpret_cast<i::CpuProfiler*>(this)->StopProfiling( 8283 reinterpret_cast<i::CpuProfiler*>(this)->StopProfiling(
8284 *Utils::OpenHandle(*title))); 8284 *Utils::OpenHandle(*title)));
8285 } 8285 }
8286 8286
8287 8287
8288 void CpuProfiler::SetIdle(bool is_idle) { 8288 void CpuProfiler::SetIdle(bool is_idle) {
8289 i::CpuProfiler* profiler = reinterpret_cast<i::CpuProfiler*>(this); 8289 i::CpuProfiler* profiler = reinterpret_cast<i::CpuProfiler*>(this);
8290 if (!profiler->is_profiling()) return;
8291 i::Isolate* isolate = profiler->isolate(); 8290 i::Isolate* isolate = profiler->isolate();
8291 if (!isolate->is_profiling()) return;
8292 v8::StateTag state = isolate->current_vm_state(); 8292 v8::StateTag state = isolate->current_vm_state();
8293 DCHECK(state == v8::EXTERNAL || state == v8::IDLE); 8293 DCHECK(state == v8::EXTERNAL || state == v8::IDLE);
8294 if (isolate->js_entry_sp() != NULL) return; 8294 if (isolate->js_entry_sp() != NULL) return;
8295 if (is_idle) { 8295 if (is_idle) {
8296 isolate->set_current_vm_state(v8::IDLE); 8296 isolate->set_current_vm_state(v8::IDLE);
8297 } else if (state == v8::IDLE) { 8297 } else if (state == v8::IDLE) {
8298 isolate->set_current_vm_state(v8::EXTERNAL); 8298 isolate->set_current_vm_state(v8::EXTERNAL);
8299 } 8299 }
8300 } 8300 }
8301 8301
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
8778 Address callback_address = 8778 Address callback_address =
8779 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8779 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8780 VMState<EXTERNAL> state(isolate); 8780 VMState<EXTERNAL> state(isolate);
8781 ExternalCallbackScope call_scope(isolate, callback_address); 8781 ExternalCallbackScope call_scope(isolate, callback_address);
8782 callback(info); 8782 callback(info);
8783 } 8783 }
8784 8784
8785 8785
8786 } // namespace internal 8786 } // namespace internal
8787 } // namespace v8 8787 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698