Revision: 7179
Author: [email protected]
Date: Tue Mar 15 11:00:02 2011
Log: [Isolates] linux: fix sampling profiler.

BUG=1251

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

Modified:
 /branches/experimental/isolates/src/platform-linux.cc

=======================================
--- /branches/experimental/isolates/src/platform-linux.cc Mon Mar 7 18:47:54 2011 +++ /branches/experimental/isolates/src/platform-linux.cc Tue Mar 15 11:00:02 2011
@@ -810,7 +810,10 @@
   USE(info);
   if (signal != SIGPROF) return;
   Isolate* isolate = Isolate::UncheckedCurrent();
-  if (isolate == NULL || !isolate->IsInUse()) return;
+ if (isolate == NULL || !isolate->IsInitialized() || !isolate->IsInUse()) {
+    // We require a fully initialized and entered isolate.
+    return;
+  }
   Sampler* sampler = isolate->logger()->sampler();
   if (sampler == NULL || !sampler->IsActive()) return;

@@ -882,7 +885,7 @@
       sigemptyset(&sa.sa_mask);
       sa.sa_flags = SA_RESTART | SA_SIGINFO;
       signal_handler_installed_ =
-          (sigaction(SIGPROF, &sa, &old_signal_handler_) != 0);
+          (sigaction(SIGPROF, &sa, &old_signal_handler_) == 0);

       // Start a thread that sends SIGPROF signal to VM threads.
       instance_ = new SignalSender(sampler->interval());

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

Reply via email to