On Fri, Dec 10, 2010 at 5:19 PM, <[email protected]> wrote: > On 2010/12/10 14:12:56, Karl Klose wrote: >> >> > It seems wrong that state window tracking is done in SuspendIfNecessary. >> > Why >> not >> > move this to NotifyTick instead? Added bonus: this way it'll only be >> > used > > when >> >> > the runtime profiler is enabled. >> We also want to sample the state when the runtime profiler is suspended, >> but >> NotifyTick is not called in this case. > > SuspendIfNecessary is called on every tick and returns true if the runtime > profiler should not be called. The calling code is in > Sampler::PlatformData::SignalSender()
SuspendIfNecessary actually suspends the thread if the profiler should not be called (it waits on a semaphore in Top::WaitForJSState()). Its return value is used to check whether sampling is still active (by restarting the loop and rereading sampler->IsActive()). -- Vitaly -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
