[JVM] Drop StoreLoadValue interface

This commit is contained in:
Ivan Kylchik
2023-09-06 10:25:33 +02:00
committed by Space Team
parent a05b37c652
commit 364faa9506
2 changed files with 5 additions and 6 deletions
@@ -42,11 +42,9 @@ import org.jetbrains.org.objectweb.asm.tree.analysis.Frame
import org.jetbrains.org.objectweb.asm.tree.analysis.Interpreter
import org.jetbrains.org.objectweb.asm.tree.analysis.Value
interface StoreLoadValue : Value
abstract class StoreLoadInterpreter<V : Value> : Interpreter<V>(API_VERSION)
abstract class StoreLoadInterpreter<V : StoreLoadValue> : Interpreter<V>(API_VERSION)
class StoreLoadFrame<V : StoreLoadValue>(val maxLocals: Int) : Frame<V>(maxLocals, 0) {
class StoreLoadFrame<V : Value>(val maxLocals: Int) : Frame<V>(maxLocals, 0) {
override fun execute(insn: AbstractInsnNode, interpreter: Interpreter<V>) {
when (insn.opcode) {
in Opcodes.ISTORE..Opcodes.ASTORE -> {
@@ -65,7 +63,7 @@ class StoreLoadFrame<V : StoreLoadValue>(val maxLocals: Int) : Frame<V>(maxLocal
}
}
class FastStoreLoadAnalyzer<V : StoreLoadValue>(
class FastStoreLoadAnalyzer<V : Value>(
owner: String,
method: MethodNode,
interpreter: StoreLoadInterpreter<V>
@@ -14,6 +14,7 @@ import org.jetbrains.org.objectweb.asm.Type
import org.jetbrains.org.objectweb.asm.tree.AbstractInsnNode
import org.jetbrains.org.objectweb.asm.tree.MethodNode
import org.jetbrains.org.objectweb.asm.tree.VarInsnNode
import org.jetbrains.org.objectweb.asm.tree.analysis.Value
// A temporary val is a local variables that is:
@@ -128,7 +129,7 @@ class TemporaryValsAnalyzer {
val loads = LinkedHashSet<VarInsnNode>()
}
private sealed class StoredValue : StoreLoadValue {
private sealed class StoredValue : Value {
// `StoredValue` represent some abstract value that doesn't really have a definition of size.
// `getSize` can return either 1 or 2, so we use 1 here.
override fun getSize(): Int = 1