| • Science | • People | • Locations | • Timeline |
The (JVM) is a crucial component of the Java platform. The availability of JVMs on almost all types of hardware and software platforms enables Java to function both as middleware and a platform in its own right. Hence the expression " Write once, run anywhere."
Programs intended to run on a JVM must be compiled into a standardized portable binary format, which typically comes in the form of .class files. A program may consist of many classes, in which case, every class will be in a different file. For easier distribution of large programs, multiple class files may be packaged together in a .jar file.
This binary is then executed by the JVM runtime which carries out emulation of the JVM instruction set by interpreting it or by applying a just-in-time Compiler (JIT).
The JVM has a stackA stack is a data structure that works on the principle of Last In First Out (LIFO). This means that the last item put on the stack is the first item that can be taken off, like a physical stack of plates. A stack-based computer system is one that is base based architecture.
Each thread has its own program counter.
The JVM verifies the bytecode of the program before it is executed. This means that only a limited amount of bytecode sequences form valid programs, e.g. a JUMP (branch) instruction can only target an instruction within the same function. Because of this, the fact that JVM is a stack architecture does not imply a speed penalty for emulation on register based architectures when using a JIT compiler: In face of the codeverified JVM architecture, it makes no difference to a JIT compiler whether it gets named imaginary registers or imaginary stack positions that need to be allocated to the target architectures registers. In fact, code verification makes the JVM different from a classic stack architecture whose efficient emulation with a JIT compiler is more complicated and typically carried out by a slower interpreter.
Code verification also ensures that arbitrary bitpatterns cannot get used as an address. Memory protectionMemory protection is a system that prevents one process from corrupting the memory of another process running on the same computer at the same time. It usually employs hardware (i. a Memory management unit) and system software to allocate distinct memory is achieved without the need for an MMUMMU short for Memory Management Unit is a class of computer hardware components responsible for handling memory accesses requested by the CPU. Among the functions of such devices are the translation of virtual addresses to physical addresses (i. virtual m. Thus, JVM is an efficient way of getting memory protection on simple silicon that has no MMU.
The JVM has instructions for the following groups of tasks
The aim is binary compatibility. Each particular host operating systemIn computing, an operating system OS is the system software responsible for the direct control and management of hardware and basic system operations, as well as running application software such as word processing programs and web browsers. In general, t needs its own implementation of the JVM and runtime. These JVMs interpret the byte code semantically the same way, but the actual implementation may be different. More complicated than just the emulation of bytecode is compatible and efficient implementation of the Java core API which has to be mapped to each host operating system.
The specification for the JVM is published in book form and HTMLHyperText Markup Language (HTML) is a markup language designed for creating web pages, that is, information presented on the World Wide Web. Defined as a simple "application" of SGML, which is used by organizations with complex publishing requirements, HT and anybody is allowed to write an implementation of it. The preface states: