Debugger, BE: Make the NOP instruction optimizer save the first NOP, not the last
This commit fixes the following tests: - KotlinSteppingTestGenerated.StepOver#testSoInlineLibFun - KotlinSteppingTestGenerated.StepOver#testSoInlineIterableFun - KotlinSteppingTestGenerated.StepOver#testSoInlineFunOnOneLineFor
This commit is contained in:
+4
-4
@@ -103,16 +103,16 @@ class RedundantNopsCleanupMethodTransformer : MethodTransformer() {
|
|||||||
|
|
||||||
|
|
||||||
internal fun getRequiredNopInRange(firstInclusive: AbstractInsnNode, lastExclusive: AbstractInsnNode?): AbstractInsnNode? {
|
internal fun getRequiredNopInRange(firstInclusive: AbstractInsnNode, lastExclusive: AbstractInsnNode?): AbstractInsnNode? {
|
||||||
var lastNop: AbstractInsnNode? = null
|
var firstNop: AbstractInsnNode? = null
|
||||||
var current: AbstractInsnNode? = firstInclusive
|
var current: AbstractInsnNode? = firstInclusive
|
||||||
while (current != null && current != lastExclusive) {
|
while (current != null && current != lastExclusive) {
|
||||||
if (current.isMeaningful && current.opcode != Opcodes.NOP) {
|
if (current.isMeaningful && current.opcode != Opcodes.NOP) {
|
||||||
return null
|
return null
|
||||||
} else if (current.opcode == Opcodes.NOP) {
|
} else if (current.opcode == Opcodes.NOP && firstNop == null) {
|
||||||
lastNop = current
|
firstNop = current
|
||||||
}
|
}
|
||||||
current = current.next
|
current = current.next
|
||||||
}
|
}
|
||||||
|
|
||||||
return lastNop
|
return firstNop
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -10,4 +10,4 @@ inline fun lookAtMe(f: (String) -> Unit) {
|
|||||||
f(a) // Should be no unneeded nops on this line, that might be generated for zero-parameters lambda
|
f(a) // Should be no unneeded nops on this line, that might be generated for zero-parameters lambda
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3 NOP
|
// 2 NOP
|
||||||
Reference in New Issue
Block a user