[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" }
|
check(!forbidRuntime) { "Attempt to init runtime where runtime usage is forbidden" }
|
||||||
call(context.llvm.initRuntimeIfNeeded, emptyList())
|
call(context.llvm.initRuntimeIfNeeded, emptyList())
|
||||||
}
|
}
|
||||||
handlePrologueExperimentalMM()
|
if (switchToRunnable) {
|
||||||
|
switchThreadState(Runnable)
|
||||||
|
}
|
||||||
if (needSlots || needCleanupLandingpadAndLeaveFrame) {
|
if (needSlots || needCleanupLandingpadAndLeaveFrame) {
|
||||||
call(context.llvm.enterFrameFunction, listOf(slotsPhi!!, Int32(vars.skipSlots).llvm, Int32(slotCount).llvm))
|
call(context.llvm.enterFrameFunction, listOf(slotsPhi!!, Int32(vars.skipSlots).llvm, Int32(slotCount).llvm))
|
||||||
} else {
|
} else {
|
||||||
check(!setCurrentFrameIsCalled)
|
check(!setCurrentFrameIsCalled)
|
||||||
}
|
}
|
||||||
|
if (context.memoryModel == MemoryModel.EXPERIMENTAL && !forbidRuntime) {
|
||||||
|
call(context.llvm.Kotlin_mm_safePointFunctionPrologue, emptyList())
|
||||||
|
}
|
||||||
resetDebugLocation()
|
resetDebugLocation()
|
||||||
br(entryBb)
|
br(entryBb)
|
||||||
}
|
}
|
||||||
@@ -1575,15 +1580,6 @@ internal abstract class FunctionGenerationContext(
|
|||||||
handleEpilogueExperimentalMM()
|
handleEpilogueExperimentalMM()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handlePrologueExperimentalMM() {
|
|
||||||
if (switchToRunnable) {
|
|
||||||
switchThreadState(Runnable)
|
|
||||||
}
|
|
||||||
if (context.memoryModel == MemoryModel.EXPERIMENTAL && !forbidRuntime) {
|
|
||||||
call(context.llvm.Kotlin_mm_safePointFunctionPrologue, emptyList())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun handleEpilogueExperimentalMM() {
|
private fun handleEpilogueExperimentalMM() {
|
||||||
if (switchToRunnable) {
|
if (switchToRunnable) {
|
||||||
check(!forbidRuntime) { "Generating a bridge when runtime is forbidden" }
|
check(!forbidRuntime) { "Generating a bridge when runtime is forbidden" }
|
||||||
|
|||||||
Reference in New Issue
Block a user