Running VM State - Modification, Complexity, Cleanliness

Steve Sansha ssansha at
Mon Feb 12 07:08:24 PST 2001

How difficult would it be to manually /
programatically change the entire state of the running
virtual machine? I'd like to be able to direct the
computation (data, bytecode, program counter, etc).  I
guess this is similiar to what needs to be done when a
multiprocess operating system switches processes. 

As I originally (naively) pictured it, the Java
Virtual Machine was simply a little stack-based Von
machine and I could write an add-on to the virtual
machine that would simply copy/move the relevant
sections of memory.  The more I look into virtual
machine (and I've still just started) the more complex
it seems... the actual implementation keeps elaborate
data structures, and... I'm guessing... I can't bet on
contiguously-allocated blocks of memory.

So... any guesses on what's required?

Also: Does the Virtual Machine allow self-modifying
code?  I'm sure it's possible for the bytecode to
create a new byte[] and use custom-built classloader
to actually load it, but is their an easier
(I'm guessing it's not, since it's a type-safe

Also: I'm sending this to Kaffe because it seems to be
the best-documented, best-spirited VM... But just so I

know, are their any documents (except the in-source
code documentation) for Sun's reference
implementation?  I've looked around and can't find

(Thanks * 1,000,000)  -Steve

Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!

More information about the kaffe mailing list