| Index: runtime/vm/isolate.cc
|
| diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
|
| index 1327ef24db29e36369f887c28b2f51cbaff245db..669ae2caaac34e29413dbda005229929babafa9a 100644
|
| --- a/runtime/vm/isolate.cc
|
| +++ b/runtime/vm/isolate.cc
|
| @@ -1766,14 +1766,23 @@ intptr_t Isolate::ProfileInterrupt() {
|
| // Paused at start / exit . Don't tick.
|
| return 0;
|
| }
|
| - InterruptableThreadState* state = thread_state();
|
| - if (state == NULL) {
|
| - // Isolate is not scheduled on a thread.
|
| + if (mutator_thread_ == NULL) {
|
| + // No active mutator.
|
| ProfileIdle();
|
| return 1;
|
| }
|
| - ASSERT(state->id != OSThread::kInvalidThreadId);
|
| - ThreadInterrupter::InterruptThread(state);
|
| +
|
| + // TODO(johnmccutchan): Sample all threads, not just the mutator thread.
|
| + // TODO(johnmccutchan): Keep a global list of threads and use that
|
| + // instead of Isolate.
|
| + ThreadRegistry::EntryIterator it(thread_registry());
|
| + while (it.HasNext()) {
|
| + const ThreadRegistry::Entry& entry = it.Next();
|
| + if (entry.thread == mutator_thread_) {
|
| + ThreadInterrupter::InterruptThread(mutator_thread_);
|
| + break;
|
| + }
|
| + }
|
| return 1;
|
| }
|
|
|
| @@ -1926,19 +1935,6 @@ void Isolate::RemoveIsolateFromList(Isolate* isolate) {
|
| }
|
|
|
|
|
| -#if defined(DEBUG)
|
| -void Isolate::CheckForDuplicateThreadState(InterruptableThreadState* state) {
|
| - MonitorLocker ml(isolates_list_monitor_);
|
| - ASSERT(state != NULL);
|
| - Isolate* current = isolates_list_head_;
|
| - while (current) {
|
| - ASSERT(current->thread_state() != state);
|
| - current = current->next_;
|
| - }
|
| -}
|
| -#endif
|
| -
|
| -
|
| template<class T>
|
| T* Isolate::AllocateReusableHandle() {
|
| T* handle = reinterpret_cast<T*>(reusable_handles_.AllocateScopedHandle());
|
|
|