Skip to content
Advertisement

Tag: bytecode

I don’t understand this opcode in JVM Implementation

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?

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

Advertisement