Is the JVM low level?

Dwight Hughes
Mon, 28 Apr 1997 23:34:54 -0500

> From: Paul Prescod <>
> To:
> Subject: Is the JVM low level?
> Date: Monday, April 28, 1997 12:30 PM
> People are talking as if the JVM is a "low level" VM. I don't see that.
> What assembly languages do you know of that presume garbage collection?
> What assembly language has an "invoke method" primitive? The JVM is
> actually pretty high level, in my opinion. I would say that it is
> sufficiently "low level" that it is not tied to a particular language as
> a VM that just ran "Lisp code" would be (although the JVM is obviously
> optimized for Java).

See the various discussions on higher level VMs - including VMs that actually only
serve as an portable intermediate code for pure native code generation. JVM is low-level 
because 90% or more of its byte codes are at the level of assembly language for a stack
processor. This low level severely limits the choices one has to generate high
performance --
each bytecoded instruction is equivalent to only a few (sometimes one or two) machine 
instructions -- but to decode the bytecodes requires many more instructions per bytecoded
instruction (most in the JVM are 2 or 3 bytes long - fetching bytes in a 32 bit aligned
is not terribly efficient either). The overhead is considerable -- the only reason JIT
show the performance improvement they do - and then only in short , tight loops (which is
the benchmarks for JITs always look so good). And I'm not even getting to the security -
is built in at the same low level, taking another hit at overall performance on the JVM.

A higher level VM would be far easier to extend to support new language features or just 
add  new languages. We would have to start somewhere though in the design and apply it 
to one language - Lisp in this case, while designing in the extension mechanisms and
to allow support for others. Of course care would need to be exercised that we not get
high-level and basically wind up with tokenized Lisp. The happy medium rules here.