Revision: 7549
Author:   [email protected]
Date:     Thu Apr  7 13:57:07 2011
Log:      Fix auto suspension of the sampler thread.

BUG=http://crbug.com/78267

Review URL: http://codereview.chromium.org/6801060
http://code.google.com/p/v8/source/detail?r=7549

Modified:
 /branches/bleeding_edge/src/isolate.h

=======================================
--- /branches/bleeding_edge/src/isolate.h       Thu Apr  7 12:52:24 2011
+++ /branches/bleeding_edge/src/isolate.h       Thu Apr  7 13:57:07 2011
@@ -936,13 +936,19 @@

   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;

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to