over-eager verification

Per Bothner per@bothner.com
Tue Mar 5 11:09:00 GMT 2002


Tom Tromey wrote:
>>>>>>"Per" == Per Bothner <per@bothner.com> writes:
> 
> Per> We should verify a method the first time it is invoked, not when
> Per> its class is prepared, since since most methods will never get
> Per> called.
> 
> I don't think we can do this.  See JVM Spec Section 4.9.1, Pass 3:
> 
>     Still during linking, the verifier checks the code array of the
>     Code attribute for each method of the class file by performing
>     data-flow analysis on each method.
> 
> So it explicitly requires checking during preparation and not at
> invocation.

Who cares?  It's just a book.  I know the guy who wrote it ...

We have to look at the big picture:  Making sure that invalid code
does not violate the Virtual Machine constraints is the big picture.

> Per> (Actually, ideally verfication should be done in conjunction with
> Per> JIT-compilation, since a JIT will need the type information that
> Per> the verifier has recoved.)
> 
> This seems unlikely given our desire for modularity, and also that the
> first JIT will most likely be ORP, which as far as I could see has no
> way of feeding it this info.

I would think any decent JIT already does 90% of the job of 
verification, at least if it does any optimization.  So the most
efficient implementation would be to (if necessary) fix the JIT to do
the remaining 10%.

In any case, this is something to think about later.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/



More information about the Java mailing list