JVM 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.
≈ 2 min read
Names in other languages
No names in other languages are held for this entry yet.
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
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. outer: for (int i = 2; i A Java compiler might translate the Java code above into bytecode as follows, assuming the above was put in a method: 0: iconst_2 1: istore_1 2: iload_1 3: sipush 1000 6: if_icmpge 44 9: iconst_2 10: istore_2 11: iload_2 12: iload_1 13: if_icmpge 31 16: iload_1 17: iload_2 18: irem 19: ifne 25 22: goto 38 25: iinc 2, 1 28: goto 11 31: getstatic #84; // Field java/lang/System.out:Ljava/io/PrintStream; 34: iload_1 35: invokevirtual #85; // Method java/io/PrintStream.println:(I)V 38: iinc 1, 1 41: goto 2 44: return
Text derived from https://en.wikipedia.org/w/index.php?oldid=1356813861 under CC BY-SA 4.0; modifications have been made.