This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
AJP/DiSLProject2022/src-profiler/ex11/CallInfo.java

17 lines
621 B
Java
Raw Permalink Normal View History

2023-01-20 17:26:55 +00:00
package ex11;
import org.objectweb.asm.Opcodes;
public record CallInfo(int instruction, long index, String caller, String callee, String callTarget) {
public String invokeType() {
return switch (instruction) {
case Opcodes.INVOKEDYNAMIC -> "dynamic";
case Opcodes.INVOKESTATIC -> "static";
case Opcodes.INVOKEINTERFACE -> "interface";
case Opcodes.INVOKESPECIAL -> "special";
case Opcodes.INVOKEVIRTUAL -> "virtual";
default -> throw new IllegalStateException("Not an INVOKE* bytecode instruction: " + instruction);
};
}
}