|
|
@ -46,13 +46,13 @@ import org.openrs2.deob.bytecode.analysis.IntValueSet |
|
|
|
import org.openrs2.deob.bytecode.filter.ReflectedConstructorFilter |
|
|
|
import org.openrs2.deob.bytecode.filter.ReflectedConstructorFilter |
|
|
|
import org.openrs2.deob.bytecode.remap.MethodMappingGenerator |
|
|
|
import org.openrs2.deob.bytecode.remap.MethodMappingGenerator |
|
|
|
import org.openrs2.util.collect.DisjointSet |
|
|
|
import org.openrs2.util.collect.DisjointSet |
|
|
|
import org.openrs2.util.collect.removeFirstOrNull |
|
|
|
import org.openrs2.util.collect.UniqueQueue |
|
|
|
import javax.inject.Inject |
|
|
|
import javax.inject.Inject |
|
|
|
import javax.inject.Singleton |
|
|
|
import javax.inject.Singleton |
|
|
|
|
|
|
|
|
|
|
|
@Singleton |
|
|
|
@Singleton |
|
|
|
public class ConstantArgTransformer @Inject constructor(private val profile: Profile) : Transformer() { |
|
|
|
public class ConstantArgTransformer @Inject constructor(private val profile: Profile) : Transformer() { |
|
|
|
private val pendingMethods = LinkedHashSet<MemberRef>() |
|
|
|
private val pendingMethods = UniqueQueue<MemberRef>() |
|
|
|
private val arglessMethods = mutableSetOf<DisjointSet.Partition<MemberRef>>() |
|
|
|
private val arglessMethods = mutableSetOf<DisjointSet.Partition<MemberRef>>() |
|
|
|
private val argValues = mutableMapOf<ArgPartition, IntValueSet>() |
|
|
|
private val argValues = mutableMapOf<ArgPartition, IntValueSet>() |
|
|
|
private lateinit var inheritedMethodSets: DisjointSet<MemberRef> |
|
|
|
private lateinit var inheritedMethodSets: DisjointSet<MemberRef> |
|
|
@ -72,7 +72,7 @@ public class ConstantArgTransformer @Inject constructor(private val profile: Pro |
|
|
|
queueEntryPoints(classPath) |
|
|
|
queueEntryPoints(classPath) |
|
|
|
|
|
|
|
|
|
|
|
while (true) { |
|
|
|
while (true) { |
|
|
|
val method = pendingMethods.removeFirstOrNull() ?: break |
|
|
|
val method = pendingMethods.poll() ?: break |
|
|
|
analyzeMethod(classPath, method) |
|
|
|
analyzeMethod(classPath, method) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|