harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Santiago Gala <sg...@hisitech.com>
Subject Re: class file reader
Date Tue, 17 May 2005 11:29:24 GMT
El lun, 16-05-2005 a las 11:09 -0400, Geir Magnusson Jr. escribió:
> On May 13, 2005, at 11:54 PM, Rob Gonzalez wrote:
> 
> > The bytecode verifier is not a particularly difficult thing to
> > implement, just an important one to get correct ;)
> >
> > Regarding BCEL's bytecode verifier implementation: it is not 100%
> > compatible with Sun's as it is more strict, but the code is nice and
> > definitely worth using for any Java-based verifier implementation.
> >
> > In any event, I don't think the verifier--which basically performs
> > static type checking to save some run-time cost--will affect the
> > architecture of the VM, which should be the main focus of the
> > discussion for now.
> 
> Right - and we want to make this...
> 
> ... wait for it ....
> 
> .... pluggable!
> 
> Is anyone familiar enough to suggest the interfaces for such a  
> module? :)
> 

AFAICT, the verifier has the most simple possible interface: a static
method called verify() which takes a bytearray representing a class. It
throws ClassFormatError when the class does not pass verification.

The tricky bits on this arer how to get it bootstrapped 8if written in
java) so that it can verify system classes needed to initialize itself.
I'm not sure of the gory details of the spec, but I guess a gcj-compiled
version could take care of initial bootstrapping during VM
initialization, until the verifier itself can be loaded and initialized,
and then the java one would take charge. In this way one source module
would do.

I'm not sure how this tricky issue is solved in the different VMs:
- no verifier
- naive verifier (just size, simple consistency checks) in C/C++
- complete verifier
- no verification of bootclasspath
...


Regards
Santiago

> geir
> 
> >
> > -Rob
> >
> >
> > On 5/13/05, Stephan Michels <stephan.michels@gmail.com> wrote:
> >
> >> On 5/13/05, Davanum Srinivas <davanum@gmail.com> wrote:
> >>
> >>> http://jakarta.apache.org/bcel/
> >>> http://cglib.sourceforge.net/
> >>> http://forge.objectweb.org/projects/asm
> >>> http://serp.sourceforge.net/
> >>>
> >>
> >> I don't know  the others, but BCEL also include a bytecode verifier,
> >> which is not an easy task.
> >>
> >> Stephan.
> >>
> >>
> >
> >
> 
-- 
Santiago Gala <sgala@hisitech.com>
High Sierra Technology, SLU

Mime
View raw message