harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Asaf Yaffe <asaf_ya...@yahoo.com>
Subject [drlvm][verifier] Dead-code and Java 6 verification issues
Date Tue, 06 Nov 2007 08:03:22 GMT

This mail thread is for discussing Java 6 verification issues related to dead-code. The issue
was first brought up by Mikhail Loenko in the "[drlvm][verifier] Using the Harmony verifier
code for computing the StackMapTable attribute" mail thread.

Here's a general overview of this subject for anyone who wishes to join this discussion: the
Java 6 verifier requires the presence of StackMap data at the beginning of each basic block.
This requirements is true for all types of blocks, including "dead-blocks" (i.e., blocks unreachable
from the first block in a method's control-flow graph). The problem is that StackMaps are
computed using a control-flow/data-flow algorithm which (by definition) processes only reachable
blocks, and hence cannot be used on "dead" blocks. In short - StackMaps cannot be computed
for "dead" blocks.

So, the main question is this: what do we do with dead blocks? How do we compute their StackMaps?

One possible option is to remove the dead-code from the method by means of a dead-code removal
algorithm applied to the method byte codes. Another possible option (implemented by the ASM
BCI library) is to "nop" all instructions in the dead block up to the last one, modify the
last instruction to "athrow" and assigning a StackMap of [][java/lang/Throwable] to this block

Any other thoughts, suggestions or ideas?


[1] ASM developer guide: http://asm.objectweb.org/doc/developer-guide.html#deadcode

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message