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

Unified Diff: runtime/vm/compiler.cc

Issue 1881383004: Do not trigger background compilation while top level parsing in mutator thread (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: d Created 4 years, 8 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 | « no previous file | no next file » | 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 842ffea26b6474a4ad92f56d84bcd7006d5cc8c2..7f84e1407de635450ed583a4975946d3c650e29d 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -1754,7 +1754,7 @@ void BackgroundCompiler::Run() {
{ MonitorLocker ml(queue_monitor_);
function = function_queue()->PeekFunction();
}
- while (running_ && !function.IsNull()) {
+ while (running_ && !function.IsNull() && !isolate_->IsTopLevelParsing()) {
// Check that we have aggregated and cleared the stats.
ASSERT(thread->compiler_stats()->IsCleared());
const Error& error = Error::Handle(zone,
@@ -1794,7 +1794,8 @@ void BackgroundCompiler::Run() {
{
// Wait to be notified when the work queue is not empty.
MonitorLocker ml(queue_monitor_);
- while (function_queue()->IsEmpty() && running_) {
+ while ((function_queue()->IsEmpty() || isolate_->IsTopLevelParsing())
+ && running_) {
ml.Wait();
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698