Re:The Next Twenty Years of Java: Where We've Been and Where...
by pron on Thursday June 04, 2015 @11:34PM
(#9663761)
C compiles down to register-based machine instructions, just as Java bytecode does. Bytecode is merely an intermediate represenation.
Re:The Next Twenty Years of Java: Where We've Been and Where...
by abc_lisper on Friday June 05, 2015 @01:44AM
(#9664046)
But in doing so, Java runs by simulating a stack machine, hence the name virtual machine.
Re:The Next Twenty Years of Java: Where We've Been and Where...
by pron on Friday June 05, 2015 @02:04AM
(#9664084)
Java 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).
To say that Linux or C is stack-based is nonsensical, as it applies to an instruction set architecture. Virtually all hardware ISAs you're likely to encounter are register-based these days.