I am writing a JVM. I was implementing all opcodes one by one, until I faced dup2. The oracle instruction set https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-6.html#jvms-6.5.dup2 says Duplicate the top one or two values on the operand stack and push the duplicated value or values back onto the operand stack in the original order How am I supposed to choose which operation to perform?
Tag: bytecode
Java bytecode – Why is offset being skipped?
I have this very simple class That i compiled with javac and then decompiled with javap to see its bytecode. Lets check offsets 0 – is reserved for “this” reference 1 – is the method parameter 2 – skipped ? 3 – variable “d” 4 – skipped ? 5 – variable “k” Why were offsets 2 and 4 skipped? Is
In Java, verify all methods in a class path that are called actually exist within that classpath [closed]
Given a classpath (e.g. a set of jar files) I would like to know, do any of these jar files make a method call (ignoring reflection) to a method which doesn’t exist within the class path. For example …
What JVM optimization is causing these performance results? [closed]
In a Java REST service performance test, I got an unexpected pattern: a method that creates and returns always the same value object in each invocation runs faster than another version that just …
ASM: how to easily get proper Opcode based on type
I am using ASM to generate Java bytecode. I have a need to create a dynamic proxy which can override basically any kind of method with additional post-processing. I am able to do it all, but there is …