Which useful (for performance or otherwise) constructions are valid bytecode, but not expressable in Java?
It performs three major functions viz. Loading, Linking, and Initialization. JVM Method Area stores class structures like metadata, the constant runtime pool, and the code for methods. All the Objects, their related instance variables, and arrays are stored in the heap.
The JVM has two primary functions: to allow Java programs to run on any device or operating system (known as the "Write once, run anywhere" principle), and to manage and optimize program memory.
The JVM consists of three distinct components: Class Loader. Runtime Memory/Data Area. Execution Engine.
As javac is a compiler for JVM, it is not a part of it.
JVM bytecode is a stack-oriented programming language, so most of the stack management instructions don't make sense in Java, e.g. dup
, swap
, etc. Arbitrary goto
, of course, is also not expressible in Java.
Something like JSR 292 proposes support for dynamically typed languages, which I don't think Java is planning to become.
I think something needs to be addressed here, though: your question seems to be at least partially motivated by the issue of performance. In practice, bytecodes are JIT-compiled to assembly. Whether or not there's a super magical bytecode instruction is really quite moot.
I have read that the bytecode method signatures support multiple dispatch on return types, whereas Java only allows for methods of the same name to dispatch on parameter types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With