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

Unified Diff: runtime/vm/compiler.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/code_descriptors_test.cc ('k') | runtime/vm/compiler_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler.cc
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index 74795062b1ef56e71e69b289926e3e98ca2a5909..3ce18f89e3ec5d94364f1c8c7e91788cf8633228 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -1058,14 +1058,13 @@ bool CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
// instruction object, since the creation of instruction object
// changes code page access permissions (makes them temporary not
// executable).
- isolate()->thread_registry()->SafepointThreads();
{
+ SafepointOperationScope safepoint_scope(thread());
// Do not Garbage collect during this stage and instead allow the
// heap to grow.
NoHeapGrowthControlScope no_growth_control;
FinalizeCompilation(&assembler, &graph_compiler, flow_graph);
}
- isolate()->thread_registry()->ResumeAllThreads();
if (isolate()->heap()->NeedsGarbageCollection()) {
isolate()->heap()->CollectAllGarbage();
}
@@ -1899,9 +1898,7 @@ void BackgroundCompiler::Stop(BackgroundCompiler* task) {
{
MonitorLocker ml_done(done_monitor);
while (!(*task_done)) {
- // In case that the compiler is waiting for safepoint.
- Isolate::Current()->thread_registry()->CheckSafepoint();
- ml_done.Wait(1);
+ ml_done.WaitWithSafepointCheck(Thread::Current());
}
}
delete task_done;
« no previous file with comments | « runtime/vm/code_descriptors_test.cc ('k') | runtime/vm/compiler_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698