JVM: move callSiteFile to InlineCallSiteInfo
This commit is contained in:
+1
-1
@@ -48,7 +48,7 @@ class IrInlineCodegen(
|
||||
if (info.generateAssertField) {
|
||||
// May be inlining code into `<clinit>`, in which case it's too late to modify the IR and
|
||||
// `generateAssertFieldIfNeeded` will return a statement for which we need to emit bytecode.
|
||||
val isClInit = info.callSiteInfo.functionName == "<clinit>"
|
||||
val isClInit = info.callSiteInfo.method.name == "<clinit>"
|
||||
codegen.classCodegen.generateAssertFieldIfNeeded(isClInit)?.accept(codegen, BlockInfo())?.discard()
|
||||
}
|
||||
}
|
||||
|
||||
+3
-9
@@ -46,19 +46,15 @@ class IrSourceCompilerForInline(
|
||||
override val callElementText: String
|
||||
get() = ir2string(callElement)
|
||||
|
||||
override val callsiteFile: PsiFile?
|
||||
get() = codegen.irFunction.fileParent.getKtFile()
|
||||
|
||||
override val inlineCallSiteInfo: InlineCallSiteInfo
|
||||
get() {
|
||||
val root = generateSequence(codegen) { it.inlinedInto }.last()
|
||||
return InlineCallSiteInfo(
|
||||
root.classCodegen.type.internalName,
|
||||
root.signature.asmMethod.name,
|
||||
root.signature.asmMethod.descriptor,
|
||||
root.signature.asmMethod,
|
||||
root.irFunction.isInlineOrInsideInline(),
|
||||
root.irFunction.isSuspend,
|
||||
findElement()?.let { CodegenUtil.getLineNumberForElement(it, false) } ?: 0
|
||||
root.irFunction.fileParent.getKtFile(),
|
||||
callElement.psiElement?.let { CodegenUtil.getLineNumberForElement(it, false) } ?: 0
|
||||
)
|
||||
}
|
||||
|
||||
@@ -141,8 +137,6 @@ class IrSourceCompilerForInline(
|
||||
.at(callElement.symbol.owner as IrDeclaration)
|
||||
.report(SUSPENSION_POINT_INSIDE_MONITOR, stackTraceElement)
|
||||
}
|
||||
|
||||
private fun findElement() = callElement.psiElement as? KtElement
|
||||
}
|
||||
|
||||
private tailrec fun IrDeclaration.isInlineOrInsideInline(): Boolean {
|
||||
|
||||
Reference in New Issue
Block a user