@@ -647,18 +647,15 @@ RawCode* CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
647
647
{
648
648
TIMELINE_DURATION (thread (), CompilerVerbose, " FinalizeCompilation" );
649
649
650
- auto mutator_fun = [&]() {
651
- *result =
652
- FinalizeCompilation (&assembler, &graph_compiler, flow_graph);
653
- };
654
- auto bg_compiler_fun = [&]() {
655
- if (Compiler::IsBackgroundCompilation ()) {
656
- CheckIfBackgroundCompilerIsBeingStopped (optimized ());
657
- }
650
+ auto install_code_fun = [&]() {
658
651
*result =
659
652
FinalizeCompilation (&assembler, &graph_compiler, flow_graph);
660
653
};
661
654
655
+ if (Compiler::IsBackgroundCompilation ()) {
656
+ CheckIfBackgroundCompilerIsBeingStopped (optimized ());
657
+ }
658
+
662
659
// We have to ensure no mutators are running, because:
663
660
//
664
661
// a) We allocate an instructions object, which might cause us to
@@ -673,7 +670,7 @@ RawCode* CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
673
670
// those writes are observed atomically.
674
671
//
675
672
thread ()->isolate_group ()->RunWithStoppedMutators (
676
- mutator_fun, bg_compiler_fun , /* use_force_growth=*/ true );
673
+ install_code_fun, install_code_fun , /* use_force_growth=*/ true );
677
674
678
675
// We notify code observers after finalizing the code in order to be
679
676
// outside a [SafepointOperationScope].
0 commit comments