Move the creation of JitZygoteDoneCompilingTask out of any loop.
Test: boot JIT zygote
Bug: 221318443
Change-Id: I3470adb77065a1e662288ae3943beb8d1f39d77e
diff --git a/runtime/jit/jit.cc b/runtime/jit/jit.cc
index 685e707..549718d 100644
--- a/runtime/jit/jit.cc
+++ b/runtime/jit/jit.cc
@@ -949,9 +949,9 @@
added_to_queue += runtime->GetJit()->CompileMethodsFromProfile(
self, boot_class_path, profile_file, null_handle, /* add_to_queue= */ true);
}
- DCHECK(runtime->GetJit()->InZygoteUsingJit());
- runtime->GetJit()->AddPostBootTask(self, new JitZygoteDoneCompilingTask());
}
+ DCHECK(runtime->GetJit()->InZygoteUsingJit());
+ runtime->GetJit()->AddPostBootTask(self, new JitZygoteDoneCompilingTask());
JitCodeCache* code_cache = runtime->GetJit()->GetCodeCache();
code_cache->GetZygoteMap()->Initialize(added_to_queue);