Code Review for 8010437

Prepared by:rasbold on Fri Mar 22 09:50:08 PDT 2013
Summary of changes: 33 lines changed: 13 ins; 19 del; 1 mod; 2984 unchg
Patch of changes: 8010437.patch
Author comments:

8010437 : guarantee(this->is8bit(imm8)) failed: Short forward jump exceeds 8-bit offset

Fix assembly output bug that may cause a short branch instruction to
attempt a jump too far due to an off-by-one error in block size
estimtation.

The fix has three parts. The first enables detection of the error
condition in output.cpp, the second removes some redundant assert
checking, and the third fixes the root problem:

- Strengthen the assert code in fill_buffer() to not adjust for loop
padding. The sizes calculated by shorten_branches already take that
into account. The adjustment by block_alignment_padding weakened the
subsequent orig_blk_size assert enough to make it ineffective.

- Re-order code in fill_buffer() so that orig_blk_size is no longer
needed. Change the old orig_blk_size assert to be a guarantee.
Remove redundant "shouldn't increase distance" assert. Remove
guarantee at top of loop that is weaker than the new guarantee.

- Fix shorten_branches() to accurately count an initial nop that may
be inserted in a block that starts with a safepoint. This is done by
adjusting the "last" addresses after alignment nops are counted in
blocks that end with a call and precede a loop head.
Legend: Modified file
Deleted file
New file

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw src/share/vm/opto/output.cpp

33 lines changed: 13 ins; 19 del; 1 mod; 2984 unchg