Wednesday, July 20, 2005

JVM-I

All computation in the JVM centers on the stack. Because the JVM has no registers for storing arbitrary values, everything must be pushed onto the stack before it can be used in a calculation.
A static Java compiler converts Java source code into a verifiably secure and compact architecture-neutral intermediate format, called Java byte codes. At runtime, the Java Virtual Machine (JVM) can either interpret the Java byte codes or translated into native code by Java Just-In-Time (JIT) compiler to improve the runtime performance.

JIT
The JIT compiler is contained within the JVM. The JIT compiler uses method-by-method translation; that is, it translates each method as it is loaded, rather than translating an entire class. When the JVM runs in interpreter mode (without the JIT compiler), it works directly with the Java bytecode, interpreting each instruction at run time.
When the JVM runs in JIT compiler mode (with the JIT compiler), the JIT compiler translates Java bytecode to native instructions and then the JVM then executes those instructions. During a single run of the Java interpreter, the JVM can use the same method multiple times, but the JIT compiler translates that method only once. After the JIT compiler translates a method, the JVM uses the method's native code instead of Java bytecode.

Bytecodes
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. Intepretation, just-in-time compiling, or any other technique that was chosen by the designer of a particular JVM could execute it. 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.

1 Comments:

At 12:35 PM, Anonymous Anonymous said...

Hi, you have a wonderful blog here! I will certainly suggest my friends take a look at your blog ! I have a cholesterol site map site. It more or less encompasses a great deal that matches cholesterol site map topics. If you possess the time, please come and check it out.

 

Post a Comment

<< Home