Bytecode verification

Per Bothner bothner at cygnus.com
Tue Apr 29 17:00:59 PDT 1997


> Now while I was doing this I came
> across one aspect of the verification which doesn't seem to be well
> documented in the JVM book.  Here's the problem: What types should the
> local variables be given at the start of an exception handler?

It seems clear to me.  See 4th sentence page 130 - an exception
handler is a valid successor to *any* instruction in the associated
exception block.

> Should is be a merge of all possible locals from anywhere in the exception
> block?  This seems rather heavy handed to me, but perhas there's an
> alternative?

Well, at least conceptually, that seems to be what is needed.
But I agree, that seems a bit expensive.  Some simplifications seem
easy - not doing a merge for instructions that cannot throw
an exception.  And you only need to do a merge when the types
of a local variable has changed.  So on the whole, I don't think
it should be too bad.

	--Per Bothner
Cygnus Solutions     bothner at cygnus.com     http://www.cygnus.com/~bothner



More information about the kaffe mailing list