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

Unified Diff: src/isolate.h

Issue 6801060: Fix auto suspension of the sampler thread. (Closed)
Patch Set: Cover other transitions Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.h
diff --git a/src/isolate.h b/src/isolate.h
index 638658ba7a67a21a4c6cc68cb05765c4cfc4ad5c..7c9573802e9900c0a44c52524ac929bcb4aafafe 100644
--- a/src/isolate.h
+++ b/src/isolate.h
@@ -897,13 +897,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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698