Commit 15b2573b authored by vitalyr@chromium.org's avatar vitalyr@chromium.org

Fix auto suspension of the sampler thread.

BUG=http://crbug.com/78267

Review URL: http://codereview.chromium.org/6801060

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7549 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8122f974
......@@ -936,13 +936,19 @@ class Isolate {
void SetCurrentVMState(StateTag state) {
if (RuntimeProfiler::IsEnabled()) {
if (state == JS) {
// JS or non-JS -> JS transition.
StateTag current_state = thread_local_top_.current_vm_state_;
if (current_state != JS && state == JS) {
// Non-JS -> JS transition.
RuntimeProfiler::IsolateEnteredJS(this);
} else if (thread_local_top_.current_vm_state_ == JS) {
} else if (current_state == JS && state != JS) {
// JS -> non-JS transition.
ASSERT(RuntimeProfiler::IsSomeIsolateInJS());
RuntimeProfiler::IsolateExitedJS(this);
} else {
// Other types of state transitions are not interesting to the
// runtime profiler, because they don't affect whether we're
// in JS or not.
ASSERT((current_state == JS) == (state == JS));
}
}
thread_local_top_.current_vm_state_ = state;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment