[kaffe] State of the Verifier

Rob Gonzalez rgonzale at wso.williams.edu
Mon Jul 28 12:23:02 PDT 2003


Hi Tim,

> Thats cool...  As I was thinking about it more, the JanosVM changes are 
> more useful for changes in the jitter than for verifying (Basically, you 
> want to generate code 'optimal' code if the class is loaded, but you don't 
> want to force loading either.)
> 
> > with the exception that loadClass
> > will have a new parameter that allows you to specify to what target state
> > a class should be loaded until.  The new method is called
> > loadClassToState, and loadClass simply forwards a call to loadClassToState
> > with the default target state.  The reason for this is that, during
> > verification, if I really need to load a class, I don't want to link it
> > (that can cause circular dependency problems when loading on the same
> > thread),
> 
> I don't understand why this is a problem.

Here's why this is a problem during verification.  When verify3() is
called on a class, the class is CSTATE_PREPARED.  Suppose that I am
verifying class A and I need to load class B to complete verifying class
A.  Now, loadClass makes sure a class is processed to CSTATE_LINKED, which
is just after verify3() is called.  But suppose class B requires class A
to be loaded to complete verification.  Then loadClass is called, class A
is found in memory but it has not yet been processed to CSTATE_LINKED, so
the thread tries to verify3() it again.  This is legal because it's the
same calling thread, so it already has the lock for class A.  etc. etc.

What I can do instead is to create a new CSTATE_BEING_LINKED or something
instead of doing the loadClassToState() method.  That probably
works...that sound alright?

I'm still getting my feet wet in the kaffe core internals, so thanks for
helping me out :)


Cheers,
Rob





More information about the kaffe mailing list