Java virtual machine: Difference between revisions

Content deleted Content added
mNo edit summary
Hirzel (talk | contribs)
Some elaboration on main interpretation loop and JVMs on different platforms.
Line 1:
The '''Java virtual machine''' or '''JVM''' is a [[Virtual machine]] that runs Java [[byte code]], the code produced by a [[Java programming language|Java]] [[compiler]] or compilers from other languages which produce this code.
 
Programs written in Java are compiled into a standardized portable binary format. This binary is then interpreted at runtime by a JVM written specifically for that particular [[operating system]] and architecture.
 
This binary is then interpreted at runtime by a JVM. The main interpretation loop is described by the following pseudo-code
The specification for this virtual machine are published in book form and [[HTML]] and anybody is allowed to write an implementation of it. The preface states:
 
do {
fetch an opcode;
if (operands) fetch operands;
execute the action for the opcode;
} while (there is more to do);
 
The JVM has a stack based architecture. Each thread has its own program counter.
 
Each particular [[operating system]] needs a JVM specifically for it. These JVMs interprete the byte code semantically the same way. But the actual implementation may be different.
 
The specification for thisthe virtualJVM machine areis published in book form and [[HTML]] and anybody is allowed to write an implementation of it. The preface states:
:''We intend that this specification should sufficiently document the Java Virtual Machine to make possible compatible clean-room implementations. Sun provides tests which verify the proper operation of implementations of the Java Virtual Machine.''