| Index: runtime/vm/isolate.cc
|
| diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
|
| index 8ca2e728aab1eee98f6e5ec088f6a035d8da8391..932cc9a7d7ed908e8d3270aaa640c618b11c0681 100644
|
| --- a/runtime/vm/isolate.cc
|
| +++ b/runtime/vm/isolate.cc
|
| @@ -2658,6 +2658,7 @@ Thread* Isolate::ScheduleThread(bool is_mutator, bool bypass_safepoint) {
|
| thread->isolate_ = this;
|
| ASSERT(heap() != NULL);
|
| thread->heap_ = heap();
|
| +
|
| thread->set_os_thread(os_thread);
|
| ASSERT(thread->execution_state() == Thread::kThreadInNative);
|
| thread->set_execution_state(Thread::kThreadInVM);
|
| @@ -2667,6 +2668,10 @@ Thread* Isolate::ScheduleThread(bool is_mutator, bool bypass_safepoint) {
|
| os_thread->set_thread(thread);
|
| if (is_mutator) {
|
| mutator_thread_ = thread;
|
| + if (this != Dart::vm_isolate()) {
|
| + mutator_thread_->set_top(heap()->new_space()->top());
|
| + mutator_thread_->set_end(heap()->new_space()->end());
|
| + }
|
| }
|
| Thread::SetCurrent(thread);
|
| os_thread->EnableThreadInterrupts();
|
| @@ -2706,6 +2711,12 @@ void Isolate::UnscheduleThread(Thread* thread,
|
| os_thread->set_thread(NULL);
|
| OSThread::SetCurrent(os_thread);
|
| if (is_mutator) {
|
| + if (this != Dart::vm_isolate()) {
|
| + heap()->new_space()->set_top(mutator_thread_->top_);
|
| + heap()->new_space()->set_end(mutator_thread_->end_);
|
| + }
|
| + mutator_thread_->top_ = 0;
|
| + mutator_thread_->end_ = 0;
|
| mutator_thread_ = NULL;
|
| }
|
| thread->isolate_ = NULL;
|
|
|