Minor: inline single use of 'analyzeMethodNodeBeforeInline'
This commit is contained in:
@@ -394,9 +394,9 @@ class MethodInliner(
|
|||||||
): MethodNode {
|
): MethodNode {
|
||||||
val processingNode = prepareNode(node, finallyDeepShift)
|
val processingNode = prepareNode(node, finallyDeepShift)
|
||||||
|
|
||||||
normalizeLocalReturns(processingNode, labelOwner)
|
normalizeNodeBeforeInline(processingNode, labelOwner)
|
||||||
|
|
||||||
val sources = analyzeMethodNodeWithoutMandatoryTransformations(processingNode)
|
val sources = analyzeMethodNodeBeforeInline(processingNode)
|
||||||
|
|
||||||
val toDelete = SmartSet.create<AbstractInsnNode>()
|
val toDelete = SmartSet.create<AbstractInsnNode>()
|
||||||
val instructions = processingNode.instructions
|
val instructions = processingNode.instructions
|
||||||
@@ -508,7 +508,14 @@ class MethodInliner(
|
|||||||
return processingNode
|
return processingNode
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun normalizeLocalReturns(node: MethodNode, labelOwner: LabelOwner) {
|
private fun normalizeNodeBeforeInline(node: MethodNode, labelOwner: LabelOwner) {
|
||||||
|
try {
|
||||||
|
FixStackWithLabelNormalizationMethodTransformer().transform("fake", node)
|
||||||
|
}
|
||||||
|
catch (e: Throwable) {
|
||||||
|
throw wrapException(e, node, "couldn't inline method call")
|
||||||
|
}
|
||||||
|
|
||||||
val frames = analyzeMethodNodeBeforeInline(node)
|
val frames = analyzeMethodNodeBeforeInline(node)
|
||||||
|
|
||||||
val localReturnsNormalizer = LocalReturnsNormalizer()
|
val localReturnsNormalizer = LocalReturnsNormalizer()
|
||||||
@@ -540,17 +547,6 @@ class MethodInliner(
|
|||||||
return info != null && info.shouldRegenerate(true)
|
return info != null && info.shouldRegenerate(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun analyzeMethodNodeBeforeInline(node: MethodNode): Array<Frame<SourceValue>?> {
|
|
||||||
try {
|
|
||||||
FixStackWithLabelNormalizationMethodTransformer().transform("fake", node)
|
|
||||||
}
|
|
||||||
catch (e: Throwable) {
|
|
||||||
throw wrapException(e, node, "couldn't inline method call")
|
|
||||||
}
|
|
||||||
|
|
||||||
return analyzeMethodNodeWithoutMandatoryTransformations(node)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun buildConstructorInvocation(
|
private fun buildConstructorInvocation(
|
||||||
anonymousType: String,
|
anonymousType: String,
|
||||||
desc: String,
|
desc: String,
|
||||||
@@ -729,7 +725,7 @@ class MethodInliner(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun analyzeMethodNodeWithoutMandatoryTransformations(node: MethodNode): Array<Frame<SourceValue>?> {
|
private fun analyzeMethodNodeBeforeInline(node: MethodNode): Array<Frame<SourceValue>?> {
|
||||||
val analyzer = object : Analyzer<SourceValue>(SourceInterpreter()) {
|
val analyzer = object : Analyzer<SourceValue>(SourceInterpreter()) {
|
||||||
override fun newFrame(nLocals: Int, nStack: Int): Frame<SourceValue> {
|
override fun newFrame(nLocals: Int, nStack: Int): Frame<SourceValue> {
|
||||||
return object : Frame<SourceValue>(nLocals, nStack) {
|
return object : Frame<SourceValue>(nLocals, nStack) {
|
||||||
|
|||||||
Reference in New Issue
Block a user