Dan McGuirk wrote:

> On Tue, 5 Oct 1999, Chris Toshok wrote:
> >[re: storing local variable types on the stack]
> > It's not like removing the assignment of the local variable
> > type is going to halve the code being executed.  This has to be the same in
> > other VM's as well.
>
> That's only true if they're checking stack types (and sizes) at runtime,
> which I think most aren't.  I think the common approach is to use the
> bytecode verifier to do all the checks in advance, and then at runtime
> just let things run unencumbered.

hmm..  even with code that has been verified, you'd need to do at least one
overflow check - when the method is being called, perhaps...  although that's
not such a good idea, since the code might never actually make the stack
overflow.

>  Code that doesn't go through the
> bytecode verifier (e.g., loaded off the local disk without the '-verify'
> option in Sun's VM) can do illegal stuff and even crash the VM.
>
> If you assemble some code that does an istore followed by an aload, and
> run it on Sun's VM from the local disk without the '-verify' option, I'm
> almost certain it will work.  I can verify this if desired.

heh, looks like japhar needs a bytecode verifier, then. :)

Chris

Reply via email to