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…
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…
Java Bytecode Error : Expecting to find object/array on stack
I am compiling a simple language into JVM Bytecode and having some issues with Java object method calls. The verifier gives the error below java.lang.VerifyError: (class: Test_1, method: main signature: ()V) Expecting to find object/array on stack and below is the generated Java source code from my bytecodes …
In Java, verify all methods in a class path that are called actually exist within that classpath [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question Given a classpath (e.g. a set of jar files) I would like to know, do any of these jar files m…
What JVM optimization is causing these performance results? [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 8 years ago. Improve this question In a Java REST service performance test, I got an unexpected pattern: a method that creates …
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 one thing I can’t see how to do in a nice way. The type of the first parameter to the method I