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

Unified Diff: runtime/vm/isolate.cc

Issue 2951333002: Moves the top_ and end_ words of the Scavenger into mutator thread. (Closed)
Patch Set: Full removal of heap's top/end offsets. Changed allocs in other archs. Created 3 years, 6 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
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 8ca2e728aab1eee98f6e5ec088f6a035d8da8391..b54f9f5a73f5eb412517a1af9d9929b4e8948c56 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;
rmacnak 2017/07/05 17:39:52 // Grab an allocation area.
danunez 2017/07/05 18:12:55 Done.
+ if (this != Dart::vm_isolate()) {
rmacnak 2017/07/05 17:39:52 Is there a property of the heap we can check inste
danunez 2017/07/05 18:12:55 That should work. I'll give it a shot.
+ mutator_thread_->top_ = *(heap()->new_space()->TopAddress());
rmacnak 2017/07/05 17:39:52 *top_address() -> top()
danunez 2017/07/05 18:12:55 Done.
+ mutator_thread_->end_ = *(heap()->new_space()->EndAddress());
+ }
}
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()) {
rmacnak 2017/07/05 17:39:52 // Release allocation area.
danunez 2017/07/05 18:12:55 Done.
+ *(heap()->new_space()->TopAddress()) = mutator_thread_->top_;
rmacnak 2017/07/05 17:39:52 *top_address() -> set_top()
danunez 2017/07/05 18:12:55 Done.
+ *(heap()->new_space()->EndAddress()) = mutator_thread_->end_;
+ }
+ mutator_thread_->top_ = 0;
+ mutator_thread_->end_ = 0;
mutator_thread_ = NULL;
}
thread->isolate_ = NULL;

Powered by Google App Engine
This is Rietveld 408576698