[K/N] Replace safe points after EnterFrame to allow LLVM reemove repeated instructions
This commit is contained in:
+6
-10
@@ -1516,12 +1516,17 @@ internal abstract class FunctionGenerationContext(
|
||||
check(!forbidRuntime) { "Attempt to init runtime where runtime usage is forbidden" }
|
||||
call(context.llvm.initRuntimeIfNeeded, emptyList())
|
||||
}
|
||||
handlePrologueExperimentalMM()
|
||||
if (switchToRunnable) {
|
||||
switchThreadState(Runnable)
|
||||
}
|
||||
if (needSlots || needCleanupLandingpadAndLeaveFrame) {
|
||||
call(context.llvm.enterFrameFunction, listOf(slotsPhi!!, Int32(vars.skipSlots).llvm, Int32(slotCount).llvm))
|
||||
} else {
|
||||
check(!setCurrentFrameIsCalled)
|
||||
}
|
||||
if (context.memoryModel == MemoryModel.EXPERIMENTAL && !forbidRuntime) {
|
||||
call(context.llvm.Kotlin_mm_safePointFunctionPrologue, emptyList())
|
||||
}
|
||||
resetDebugLocation()
|
||||
br(entryBb)
|
||||
}
|
||||
@@ -1575,15 +1580,6 @@ internal abstract class FunctionGenerationContext(
|
||||
handleEpilogueExperimentalMM()
|
||||
}
|
||||
|
||||
private fun handlePrologueExperimentalMM() {
|
||||
if (switchToRunnable) {
|
||||
switchThreadState(Runnable)
|
||||
}
|
||||
if (context.memoryModel == MemoryModel.EXPERIMENTAL && !forbidRuntime) {
|
||||
call(context.llvm.Kotlin_mm_safePointFunctionPrologue, emptyList())
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleEpilogueExperimentalMM() {
|
||||
if (switchToRunnable) {
|
||||
check(!forbidRuntime) { "Generating a bridge when runtime is forbidden" }
|
||||
|
||||
Reference in New Issue
Block a user