harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Loenko" <mloe...@gmail.com>
Subject Re: [drlvm][verifier] Dead-code and Java 6 verification issues
Date Thu, 08 Nov 2007 11:50:14 GMT
2007/11/8, Asaf Yaffe <asaf_yaffe@yahoo.com>:
> Hi Mikhail,
> As you point out, there is not quote on the spec about the verifier ignoring applicable
exception handlers. However, consider the following:
> Assume the verifier needs to take applicable exception handlers into account when verifying
the code in a dead-block. Since a StackMap cannot be computed for this block (because it is
unreachable by the control and data flow algorithm) it means that the verification will always
fail if the exception handler block has local variables in its StackMap. The end result is
that a dead block will cause verification for the method to fail, which does not make any
> Therefore, I suggest we will take the risk and assume that the behavior described by
the ASM Developer Guide is correct. If you like, we can try and prototype this with some test
cases and see if it really works.

Hi Asaf

I started to play with the verifier code to see how we can build
stackmap table attributes, and I see that real-life classes compiled
with Javac6:

1. pretty often have dead code,
2. have jumps from dead to normal code
3. have valid stackmaps at the beginning of the dead code blocks and
those stackmap are compartible to branch targets

So real life classes have valid stackmaps according to the spec, and
it's not clear
why we should assume that real VMs don't comply with the spec.

Anyway, before making such an assumption, we should discuss other possible
ways. so that if we are able to build 100% correct approach we could
proceed with it.

So, back to my question: is it possible to modify try blocks?


> Thanks,
> Asaf
> ----- Original Message ----
> From: Mikhail Loenko <mloenko@gmail.com>
> To: dev@harmony.apache.org
> Sent: Thursday, November 8, 2007 9:29:29 AM
> Subject: Re: [drlvm][verifier] Dead-code and Java 6 verification issues
> [snip...]
> >
> > That's what I missed! Could you please provide a link to the quote in
> > the spec that nop and athrow are not checked against "applicable"
> > exception handlers?
> seems like the spec says that it must perform the check...
> instructionIsTypeSafe(nop, _Environment, _Offset, StackFrame,
> StackFrame, ExceptionStackFrame) :-
> exceptionStackFrame(StackFrame, ExceptionStackFrame).
> Thanks,
> Mikhail
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com

View raw message