Remove existing FrameNode manipulation support

This code is no longer used. Remove it to avoid bit rot.

Signed-off-by: Graham <gpe@openrs2.dev>
master
Graham 5 years ago
parent 43646bbd9d
commit 3a29f61d7c
  1. 13
      asm/src/main/java/dev/openrs2/asm/ClassNodeRemapper.kt
  2. 10
      asm/src/main/java/dev/openrs2/asm/MethodNodeUtils.kt

@ -45,20 +45,9 @@ fun ClassNode.remap(remapper: Remapper) {
} }
} }
private fun Remapper.mapFrameType(type: Any?): Any? {
return if (type is String) {
mapType(type)
} else {
type
}
}
private fun AbstractInsnNode.remap(remapper: Remapper) { private fun AbstractInsnNode.remap(remapper: Remapper) {
when (this) { when (this) {
is FrameNode -> { is FrameNode -> throw UnsupportedOperationException("SKIP_FRAMES and COMPUTE_FRAMES must be used")
local = local?.map(remapper::mapFrameType)
stack = stack?.map(remapper::mapFrameType)
}
is FieldInsnNode -> { is FieldInsnNode -> {
val originalOwner = owner val originalOwner = owner
owner = remapper.mapType(originalOwner) owner = remapper.mapType(originalOwner)

@ -96,15 +96,7 @@ fun MethodNode.removeArgument(argIndex: Int) {
when (insn) { when (insn) {
is VarInsnNode -> insn.`var` = remap(insn.`var`, argType, localIndex) is VarInsnNode -> insn.`var` = remap(insn.`var`, argType, localIndex)
is IincInsnNode -> insn.`var` = remap(insn.`var`, argType, localIndex) is IincInsnNode -> insn.`var` = remap(insn.`var`, argType, localIndex)
is FrameNode -> { is FrameNode -> throw UnsupportedOperationException("SKIP_FRAMES and COMPUTE_FRAMES must be used")
if (insn.type != Opcodes.F_NEW) {
throw UnsupportedOperationException("Only F_NEW frames are supported")
}
for (i in 0 until argType.size) {
insn.local.removeAt(localIndex)
}
}
} }
} }
} }

Loading…
Cancel
Save