Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: runtime/vm/isolate.cc

Issue 2992343002: Attempts to fix bugs introduced in 8b6fcf50e85d. (Closed)
Patch Set: Removes UnflushTLS() and renames FlushTLS to something appropriate Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/scavenger.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 6c3fa50322b6ed43d2e7a8c7b3a81b17a484ccac..55720c97d681dcebdbff57a779d9c3dc8158d180 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -2574,9 +2574,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());
+ if ((Dart::vm_isolate() != NULL) &&
+ (heap() != Dart::vm_isolate()->heap())) {
+ mutator_thread_->set_top(0);
+ mutator_thread_->set_end(0);
}
}
Thread::SetCurrent(thread);
@@ -2616,12 +2617,13 @@ 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_);
+ if ((Dart::vm_isolate() != NULL) &&
+ (heap() != Dart::vm_isolate()->heap())) {
+ if (mutator_thread_->HasActiveTLAB()) {
+ heap()->AbandonRemainingTLAB(mutator_thread_);
+ }
}
- mutator_thread_->top_ = 0;
- mutator_thread_->end_ = 0;
+ ASSERT(!mutator_thread_->HasActiveTLAB());
mutator_thread_ = NULL;
}
thread->isolate_ = NULL;
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/scavenger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698