BYTECODE : By using bytecode,
source code can be run on any platform once it has been compiled and run
through the virtual machine. Bytecode is
the compiled format forJava programs.
Once a Java program
has been converted to bytecode,
it can be transferred across a network and executed by Java Virtual Machine (JVM).
BYTECODE FORMAT : Bytecodes are the
machine language of the Java virtual machine. When a JVM loads a class file, it
gets one stream of bytecodes for each method in the class. The bytecodes
streams are stored in the method area of the JVM. The bytecodes for a method
are executed when that method is invoked during the course of running the
program. They can be executed by intepretation, just-in-time compiling, or any
other technique that was chosen by the designer of a particular JVM.
BYTECODE
STREAM & OPCODE : A method's bytecode stream is a sequence of
instructions for the Java virtual machine. Each instruction consists of a
one-byte opcode followed by zero or more operands.
The opcode indicates the action to take. If more information is required before
the JVM can take the action, that information is encoded into one or more
operands that immediately follow the opcode.
Each type of opcode has a mnemonic. In the typical assembly
language style, streams of Java bytecodes can be represented by their mnemonics
followed by any operand values. For example, the following stream of bytecodes
can be disassembled into mnemonics
No comments:
Post a Comment