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

Unified Diff: runtime/vm/scavenger.cc

Issue 1541073002: Implement safepointing of threads (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix-typo Created 4 years, 11 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/safepoint.cc ('k') | runtime/vm/service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scavenger.cc
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
index 60478d3d5b645b7b8fc9c24dd03037c69862a5e7..5dc0aae609ee1ac723c0c291b762ee94ef073035 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -14,6 +14,7 @@
#include "vm/lockers.h"
#include "vm/object.h"
#include "vm/object_id_ring.h"
+#include "vm/safepoint.h"
#include "vm/stack_frame.h"
#include "vm/store_buffer.h"
#include "vm/thread_registry.h"
@@ -449,7 +450,7 @@ SemiSpace* Scavenger::Prologue(Isolate* isolate, bool invoke_api_callbacks) {
if (invoke_api_callbacks && (isolate->gc_prologue_callback() != NULL)) {
(isolate->gc_prologue_callback())();
}
- isolate->thread_registry()->PrepareForGC();
+ isolate->PrepareForGC();
// Flip the two semi-spaces so that to_ is always the space for allocating
// objects.
SemiSpace* from = to_;
@@ -763,7 +764,7 @@ void Scavenger::Scavenge(bool invoke_api_callbacks) {
// will continue with its scavenge after waiting for the winner to complete.
// TODO(koda): Consider moving SafepointThreads into allocation failure/retry
// logic to avoid needless collections.
- isolate->thread_registry()->SafepointThreads();
+ SafepointOperationScope safepoint_scope(Thread::Current());
// Scavenging is not reentrant. Make sure that is the case.
ASSERT(!scavenging_);
@@ -823,8 +824,6 @@ void Scavenger::Scavenge(bool invoke_api_callbacks) {
// Done scavenging. Reset the marker.
ASSERT(scavenging_);
scavenging_ = false;
-
- isolate->thread_registry()->ResumeAllThreads();
}
« no previous file with comments | « runtime/vm/safepoint.cc ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698