Check the validity of a .class file

Christian Thalinger twisti at complang.tuwien.ac.at
Fri Nov 21 06:36:37 PST 2008


On Fri, 2008-11-21 at 08:52 -0500, Keith McGuigan wrote:
> Christian Thalinger wrote:
> > On Thu, 2008-11-20 at 17:14 -0500, Keith McGuigan wrote:
> >> Well, verification in the JVM occurs as part of the loading, so the 
> >> bytecode actually is statically examined.  It doesn't have to run, the 
> >> verifier is kicked off at link time, not run time.  This means you 
> > 
> > Really?  HotSpot verifies all methods during link time not during
> > compile time (well, first interpreter invocation)?
> 
> Yeah, pretty much.
> 
> Hotspot (and all other spec-compliant JVMs) verify the entire class at 
> link time, which is usually the point just before when the static 
> initializers execute.   Check sections like 2.17.3 in the JVM spec to 
> get the exact details of when this happens and what causes it.

"The Java programming language allows an implementation flexibility as
to when linking activities (and, because of recursion, loading) take
place, provided that the semantics of the language are respected, that a
class or interface is completely verified and prepared before it is
initialized, ..."

Uhm... reading that section again makes me think CACAO has a problem in
this area.  We verify methods while compiling, not while linking the
class file.  I should write a small testcase to see if CACAO does not
behave like the RI.

- Christian




More information about the hotspot-dev mailing list