There is not, nor will there likely ever be, a "Java machine" in hardware. Even
the chips that can directly execute Java bytecode don't implement all of the
semantics of that bytecode in hardware, stuff like symbol resolution just traps
to software.
A Java VM is a virtual machine (i.e. a completely
non-physical machine), not a virtualized machine (a physical
machine whose resources are transparently shared). These are two similar, but
different things. A "virtualized machine" is a physical machine whose physical
resources have been "virtualized" -- so that they can be shared between several
client programs at once. Each client program thinks it has exclusive access to
the physical resource, when really it has access to a "virtual" resource (and
the hypervisor assigns the physical resource to the machine when needed, or
according to the user's direction). Think of a sound card, or blocks of RAM, or
a DVD-ROM drive, or the physical CPU. These are each physical resources which
could be virtualized by a hypervisor (or by a virtualization product like
VMware.)
Also, a "Java VM" executes Java bytecode, but it might do this
in a variety of ways: through an interpreter, through a JIT compiler, etc. The
goal is usually to run it as fast as possible.
By contrast, an "emulator" is
usually trying to reproduce all of the hardware's side effects as exactly as
possible (given the constraints of the host machine) which usually means
individual instructions, and sometimes even individual machine cycles, are
"emulated" one at a time. The emulator usually only needs to run at "the
original" speed (being synched to some fixed-frequency output device, either
video or sound).
A simulator is the same thing as an emulator,
except with a definite emphasis on making the reproduction of all side effects
as accurate as possible (and perhaps, allowing the simulated state to be
inspected accurately from outside--although some emulators support this
too).
Simulators are often written for a specific hardware chip. One use
case would be, to write a simulator after the chip is designed, but before it is
actually built, and use the simulator to study the design and identify
weaknesses or inefficiencies in it. It can also be used to write software for
hardware chips which have already been designed but have not yet been built. [ Reply to This | Parent | # ]
|