Remove FieldInitializer class

We don't need to track the class version and maxStack value: the
Library::remap will already have access to them (and always needs to, as
it has to fiddle with {Class,Field,Method}Nodes to actually move the
field).

Signed-off-by: Graham <gpe@openrs2.dev>
Graham 5 years ago
parent 35fea8f293
commit 4674dfb5ba
  1. 3
      asm/src/main/java/dev/openrs2/asm/classpath/ExtendedRemapper.kt
  2. 14
      asm/src/main/java/dev/openrs2/asm/classpath/FieldInitializer.kt

@ -1,9 +1,10 @@
package dev.openrs2.asm.classpath package dev.openrs2.asm.classpath
import org.objectweb.asm.commons.Remapper import org.objectweb.asm.commons.Remapper
import org.objectweb.asm.tree.AbstractInsnNode
abstract class ExtendedRemapper : Remapper() { abstract class ExtendedRemapper : Remapper() {
open fun getFieldInitializer(owner: String, name: String, descriptor: String): FieldInitializer? { open fun getFieldInitializer(owner: String, name: String, descriptor: String): List<AbstractInsnNode>? {
return null return null
} }

@ -1,14 +0,0 @@
package dev.openrs2.asm.classpath
import dev.openrs2.asm.MemberRef
import org.objectweb.asm.Opcodes
import org.objectweb.asm.tree.AbstractInsnNode
import org.objectweb.asm.tree.FieldInsnNode
class FieldInitializer(val instructions: List<AbstractInsnNode>, val version: Int, val maxStack: Int) {
val dependencies = instructions.asSequence()
.filterIsInstance<FieldInsnNode>()
.filter { it.opcode == Opcodes.GETSTATIC }
.map(::MemberRef)
.toSet()
}
Loading…
Cancel
Save