| FazBrowse Wikipedia Viewer | Main Page | | |
| Viewing: https://en.wikipedia.org/wiki/Java_bytecode |
JVM bytecode is the instruction set architecture (ISA) of the Java virtual machine (JVM), the language to which Java and other JVM-compatible source code is compiled. Each instruction is represented by one byte, hence the name bytecode, making it a compact form of data.
Due to the nature of virtual machines and bytecode, a JVM bytecode program is runnable on any machine with a compatible JVM, without the long process of compiling from source code.
JVM bytecode is used at runtime either interpreted by a JVM or compiled to machine code via just-in-time (JIT) compilation and run as a native application.
As JVM bytecode is designed for cross-platform software compatibility and security, a JVM bytecode application tends to run consistently across various hardware and software configurations.
double types, which are 64 bits, take up two consecutive local variables (which need not be 64-bit aligned in the local variables array) or one value in the operand stack (but are counted as two units in the depth of the stack).Each bytecode is composed of one byte that represents the opcode, along with zero or more bytes for operands.
Of the 256 possible byte-long opcodes, outer: for(inti=2;i<1000;i++){ for(intj=2;j<i;j++){ if(i%j==0) continueouter; } System.out.println(i); }
A Java compiler might translate the Java code above into bytecode as follows, assuming the above was put in a method:
The most common language targeting Java virtual machine by producing JVM bytecode is Java. Originally only one compiler existed, the javac compiler from Sun Microsystems, which compiles Java source code to JVM bytecode; but because all the specifications for JVM bytecode are now available, other parties have supplied compilers that produce JVM bytecode. Examples of other compilers include:
Some projects provide Java assemblers to enable writing JVM bytecode by hand. Assembly code may be also generated by machine, for example by a compiler targeting a Java virtual machine. Notable Java assemblers include:
Others have developed compilers, for different programming languages, to target the Java virtual machine, such as:
| View original on Wikipedia | Back | FazBrowse Home |