Pregunta

I am learning ASM framework for Byte Code instrumentation and wrote couple of examples to achieve the same.I saw that in most of the examples JVM OPCodes are used for ex:DUP,AASTORE,LSTORE etc but looking at the javadocs of ASM Opcodes i don't see any proper documentation for different OPcodes

for ex

AALOAD

static final int AALOAD

DUP

static final int DUP

This javadoc link http://asm.ow2.org/asm40/javadoc/user/org/objectweb/asm/Opcodes.html gives the list of opcodes available but doesn't clearly describe why/when each opcode is used.I understand that these are nothing but JVM opcodes, but is there a location where i can get more details on when/why these opcodes should be used??

I am currently using ASMIFIER to get an idea of how BYTECODE representation of my code which i am supposed to inject should look like ,but better understanding of OPCodes will help me in getting better understanding of the BYTECode which i have to inject.

Thanks

VishwanathB

¿Fue útil?

Solución

If you want to find out what the opcodes do, just read "The Java Virtual Machine Instruction Set" chapter of JVM specification.

If you want to find out how to chose sequences of instructions to do what you want, well, that's just programming.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top