2 ms·
C compiles down to register-based machine instructions, just as Java bytecode does. Bytecode is merely an intermediate represenation.
by pron 11y ago
C compiles down to register-based machine instructions, just as Java bytecode does. Bytecode is merely an intermediate represenation.
- abc_lisper 11y agoBut in doing so, Java runs by simulating a stack machine, hence the name virtual machine.
- pron 11y agoJava bytecode is instructions for a stack machine -- but that's an abstraction. Then the bytecode compiles down to (register) machine instructions, and that compiled implementation is highly efficient and highly optimized. The virtual machine itself is a complete abstraction. Modern JVMs do not run a simulation of a stack machine at runtime (after compilation, that is).