<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">John, thanks for the review!<div><br><div><div>On Feb 24, 2014, at 12:27 PM, John Rose &lt;<a href="mailto:john.r.rose@oracle.com">john.r.rose@oracle.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Feb 23, 2014, at 11:02 PM, Igor Veresov &lt;<a href="mailto:igor.veresov@oracle.com">igor.veresov@oracle.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span style="font-family: Helvetica; font-size: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">May I please have a second review of this?</span><br style="font-family: Helvetica; font-size: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">Webrev:<span class="Apple-converted-space">&nbsp;</span></span><a href="http://cr.openjdk.java.net/~iveresov/8035283/webrev.01/" style="font-family: Helvetica; font-size: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;">http://cr.openjdk.java.net/~iveresov/8035283/webrev.01/</a><br style="font-family: Helvetica; font-size: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></blockquote><br></div><div>I don't understand the force of the assert; it seems to be true mostly by accident.</div><div><br></div></div></blockquote><div><br></div><div>I assume you’re talking about the first one. The goal of that assert is to basically ensure that br_offs&nbsp;- prev_block_loop_pad doesn’t underflow, which should be true for all the blocks except the first that require padding.</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Maybe you want an assert that 'last_may_be_short_branch_adr' does not fall between (br_offs&nbsp;- prev_block_loop_pad)+1 and br_offs, inclusive?</div><br><div>It took me a long time to convince myself that moving the goalpost for the comparison to 'last_may_be_short_branch_adr' was safe. &nbsp;Really, the argument hinges on the fact that all layout info. is relative to a pessimistic assumption that the maximum possible padding (block-&gt;code_alignment() - relocInfo::addr_unit()) is always inserted.</div><div><br></div><div>I suggest making the linkage to that assumption clearer, by hoisting the crucial expression 'block-&gt;code_alignment() - relocInfo::addr_unit()' as follows:</div><div><br></div><div>&nbsp; uint* &nbsp; &nbsp; &nbsp;worst_case_pad &nbsp;= NEW_RESOURCE_ARRAY(uint,nblocks);</div><div>...</div><div><br></div><div>&nbsp;&nbsp;worst_case_pad[i] =&nbsp;block-&gt;code_alignment() - relocInfo::addr_unit();</div><div><br></div><div>Then use the array reference directly instead of the now-linked uses of code_alignment etc.</div><div><br></div><div>This is delicate code!</div></div></blockquote><div><br></div><div>I agree, that’ll make the code more robust. I’ll make the changes.</div><div><br></div><div>igor</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>— John</div></div></blockquote></div><br></div></body></html>