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

Unified Diff: runtime/vm/compiler.cc

Issue 1562853003: 1. Add code to grow the heap instead of collecting garbage in Heap::AllocateOld when allocation is … (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: self-review-comments 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 | « no previous file | runtime/vm/heap.h » ('j') | runtime/vm/heap.cc » ('J')
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 be9c996a8ee88a12f439c6bb3fbe4041a12f7223..a43da6bdd5661fa7d233cfa5f3de25aeb9c7dc42 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -1049,8 +1049,10 @@ bool CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
TimelineDurationScope tds(thread(),
compiler_timeline,
"FinalizeCompilation");
- // This part of compilation must be at a safepoint.
- if (!thread()->IsMutatorThread()) {
+ if (thread()->IsMutatorThread()) {
+ FinalizeCompilation(&assembler, &graph_compiler, flow_graph);
+ } else {
+ // This part of compilation must be at a safepoint.
// Stop mutator thread before creating the instruction object and
// installing code.
// Mutator thread may not run code while we are creating the
@@ -1058,13 +1060,16 @@ bool CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
// changes code page access permissions (makes them temporary not
// executable).
isolate()->thread_registry()->SafepointThreads();
- }
-
- FinalizeCompilation(&assembler, &graph_compiler, flow_graph);
-
- if (!thread()->IsMutatorThread()) {
- // Background compilation.
+ {
+ // We do not Garbage collect during this stage and allow the
Ivan Posva 2016/01/11 06:14:09 // Do not allow garbage collection during this sta
siva 2016/01/11 18:27:47 Done.
+ // heap to grow.
+ NoHeapGrowthControlScope no_growth_control;
+ FinalizeCompilation(&assembler, &graph_compiler, flow_graph);
+ }
isolate()->thread_registry()->ResumeAllThreads();
+ if (isolate()->heap()->NeedsGarbageCollection()) {
+ isolate()->heap()->CollectAllGarbage();
+ }
}
}
// Mark that this isolate now has compiled code.
« no previous file with comments | « no previous file | runtime/vm/heap.h » ('j') | runtime/vm/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698