basic block reordering + java

Anthony Green green@redhat.com
Fri Sep 21 07:26:00 GMT 2001


With basic block reordering, we often see code from gcj that ends in...

.L20:
        call    _Jv_ThrowNullPointerException
.L21:
        call    _Jv_ThrowNullPointerException
.L22:
        call    _Jv_ThrowNullPointerException
.L23:
        call    _Jv_ThrowNullPointerException
.L24:
        call    _Jv_ThrowNullPointerException
.L25:
        call    _Jv_ThrowNullPointerException
.L26:
        call    _Jv_ThrowNullPointerException

Is there an easy way for GCC to merge identical blocks?


Also, I find that if the last NullPointerException branch is taken,
printStackTrace() will produce incorrect results.  You end up seeing the
function after this in place of the one calling _Jv_ThrowNullPointerException.
Should we be backing up the program counter somewhere? (or emitting a NOP at
the very end of each function?)

AG




More information about the Java mailing list