Minor, Rename InsnStream -> InsnSequence
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
package org.jetbrains.kotlin.codegen.inline
|
package org.jetbrains.kotlin.codegen.inline
|
||||||
|
|
||||||
import org.jetbrains.org.objectweb.asm.tree.MethodNode
|
import org.jetbrains.org.objectweb.asm.tree.MethodNode
|
||||||
import org.jetbrains.kotlin.codegen.optimization.common.InsnStream
|
import org.jetbrains.kotlin.codegen.optimization.common.InsnSequence
|
||||||
import org.jetbrains.org.objectweb.asm.tree.LineNumberNode
|
import org.jetbrains.org.objectweb.asm.tree.LineNumberNode
|
||||||
import org.jetbrains.org.objectweb.asm.Label
|
import org.jetbrains.org.objectweb.asm.Label
|
||||||
import kotlin.properties.Delegates
|
import kotlin.properties.Delegates
|
||||||
@@ -29,7 +29,7 @@ import org.jetbrains.kotlin.codegen.SourceInfo
|
|||||||
class SMAPAndMethodNode(val node: MethodNode, val classSMAP: SMAP) {
|
class SMAPAndMethodNode(val node: MethodNode, val classSMAP: SMAP) {
|
||||||
|
|
||||||
val lineNumbers =
|
val lineNumbers =
|
||||||
InsnStream(node.instructions.getFirst(), null).stream().filterIsInstance<LineNumberNode>().map {
|
InsnSequence(node.instructions.getFirst(), null).stream().filterIsInstance<LineNumberNode>().map {
|
||||||
val index = Collections.binarySearch(classSMAP.intervals, RangeMapping(it.line, it.line, 1)) {
|
val index = Collections.binarySearch(classSMAP.intervals, RangeMapping(it.line, it.line, 1)) {
|
||||||
value, key ->
|
value, key ->
|
||||||
if (value.contains(key.dest)) 0 else RangeMapping.Comparator.compare(value, key)
|
if (value.contains(key.dest)) 0 else RangeMapping.Comparator.compare(value, key)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ val AbstractInsnNode.isMeaningful : Boolean get() =
|
|||||||
else -> true
|
else -> true
|
||||||
}
|
}
|
||||||
|
|
||||||
class InsnStream(val from: AbstractInsnNode, val to: AbstractInsnNode?) : Stream<AbstractInsnNode> {
|
class InsnSequence(val from: AbstractInsnNode, val to: AbstractInsnNode?) : Sequence<AbstractInsnNode> {
|
||||||
override fun iterator(): Iterator<AbstractInsnNode> {
|
override fun iterator(): Iterator<AbstractInsnNode> {
|
||||||
return object : Iterator<AbstractInsnNode> {
|
return object : Iterator<AbstractInsnNode> {
|
||||||
var current: AbstractInsnNode? = from
|
var current: AbstractInsnNode? = from
|
||||||
@@ -44,14 +44,14 @@ class InsnStream(val from: AbstractInsnNode, val to: AbstractInsnNode?) : Stream
|
|||||||
|
|
||||||
fun MethodNode.prepareForEmitting() {
|
fun MethodNode.prepareForEmitting() {
|
||||||
tryCatchBlocks = tryCatchBlocks.filter { tcb ->
|
tryCatchBlocks = tryCatchBlocks.filter { tcb ->
|
||||||
InsnStream(tcb.start, tcb.end).any { insn ->
|
InsnSequence(tcb.start, tcb.end).any { insn ->
|
||||||
insn.isMeaningful
|
insn.isMeaningful
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// local variables with live ranges starting after last meaningful instruction lead to VerifyError
|
// local variables with live ranges starting after last meaningful instruction lead to VerifyError
|
||||||
localVariables = localVariables.filter { lv ->
|
localVariables = localVariables.filter { lv ->
|
||||||
InsnStream(lv.start, instructions.getLast()).any { insn ->
|
InsnSequence(lv.start, instructions.getLast()).any { insn ->
|
||||||
insn.isMeaningful
|
insn.isMeaningful
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user