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

Unified Diff: runtime/vm/compiler.cc

Issue 2771013002: Add more safe points in compiler (Closed)
Patch Set: Fix logic error in compiler code installation, more safe points, remove safe point in zone code, ni… Created 3 years, 9 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/compiler.cc
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index 0a452b337b1a412b47d1b82ca76ea63fc7d60420..17a3e78df5bbefdb4b69773349351b6c3bf068db 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -835,7 +835,12 @@ bool CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
JitOptimizer optimizer(flow_graph);
- optimizer.ApplyICData();
+ {
+ NOT_IN_PRODUCT(TimelineDurationScope tds(thread(), compiler_timeline,
+ "ApplyICData"));
+ optimizer.ApplyICData();
+ thread()->CheckForSafepoint();
+ }
DEBUG_ASSERT(flow_graph->VerifyUseLists());
// Optimize (a << b) & c patterns, merge operations.
@@ -866,6 +871,7 @@ bool CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
inliner.Inline();
// Use lists are maintained and validated by the inliner.
DEBUG_ASSERT(flow_graph->VerifyUseLists());
+ thread()->CheckForSafepoint();
}
// Propagate types and eliminate more type tests.
@@ -915,6 +921,7 @@ bool CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
// propagation.
ConstantPropagator::Optimize(flow_graph);
DEBUG_ASSERT(flow_graph->VerifyUseLists());
+ thread()->CheckForSafepoint();
}
// Optimistically convert loop phis that have a single non-smi input
@@ -978,6 +985,7 @@ bool CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
DEBUG_ASSERT(flow_graph->VerifyUseLists());
}
flow_graph->RemoveRedefinitions();
+ thread()->CheckForSafepoint();
}
// Optimize (a << b) & c patterns, merge operations.
@@ -1057,6 +1065,7 @@ bool CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
// TODO(fschneider): Support allocation sinking with try-catch.
sinking = new AllocationSinking(flow_graph);
sinking->Optimize();
+ thread()->CheckForSafepoint();
}
DEBUG_ASSERT(flow_graph->VerifyUseLists());
@@ -1106,6 +1115,7 @@ bool CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
// Perform register allocation on the SSA graph.
FlowGraphAllocator allocator(*flow_graph);
allocator.AllocateRegisters();
+ thread()->CheckForSafepoint();
}
if (reorder_blocks) {

Powered by Google App Engine
This is Rietveld 408576698