<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Thomas,</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Inline, towards the end.</div> <br><p class="airmail_on" style="color:#000;">On June 25, 2015 at 2:18:36 PM, Thomas Schatzl (<a href="mailto:thomas.schatzl@oracle.com">thomas.schatzl@oracle.com</a>) wrote:</p> <div><blockquote type="cite" class="clean_bq" style="color: rgb(0, 0, 0); font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span><div><div></div><div>Hi Tony,<span class="Apple-converted-space"> </span><br><br>On Thu, 2015-06-25 at 12:35 -0400, Tony Printezis wrote:<span class="Apple-converted-space"> </span><br>> Thomas,<span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> One nit and one question:<span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> 144 // Fill the memory area from start to end with a dead object, and update the BOT<span class="Apple-converted-space"> </span><br>> 145 // and the mark bitmap.<span class="Apple-converted-space"> </span><br>> 146 void zap_dead_objects(HeapWord* start, HeapWord* end) {<span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> the nit: The comment should now be “with dead objects” (and I’d prefer<span class="Apple-converted-space"> </span><br>> "with filler objects”) instead of “with dead object” given that<span class="Apple-converted-space"> </span><br>> fill_with_objects(), called from zap_dead_objects(), might place up to<span class="Apple-converted-space"> </span><br>> two objects in the area (given your previous change, right?).<span class="Apple-converted-space"> </span><br><br>Will fix that.<span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> the (related) question: Do you set the BOT for [start, end) assuming<span class="Apple-converted-space"> </span><br>> one filler object but in reality [start, end) might have two objects?<span class="Apple-converted-space"> </span><br>> I looked at the code for cross_threshold() / BOT::alloc_block() and it<span class="Apple-converted-space"> </span><br>> looks as if they set up the BOT as if [start, end) is covered by a<span class="Apple-converted-space"> </span><br>> single object (but I could have misread the code). This will result in<span class="Apple-converted-space"> </span><br>> some (most likely very rare) cases where BOT look-ups will do more<span class="Apple-converted-space"> </span><br>> work than they should. Should you do fill_with_objects() first, then<span class="Apple-converted-space"> </span><br>> iterate over the filler objects, and update the BOT for each?<span class="Apple-converted-space"> </span><br><br>You are right about this. However considering these are going to be dead<span class="Apple-converted-space"> </span><br>objects, they will never be iterated over using the BOT in performance<span class="Apple-converted-space"> </span><br>sensitive code.<span class="Apple-converted-space"> </span></div></div></span></blockquote></div><p><br></p><p>I agree. But isn’t there an edge case? Imagine you have the sequence of D* dead objects, followed by A (a live object):</p><p>D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 A</p><p>Let’s say your code replaces the D* dead objects with two filler objects, F0 and F1:</p><p>F0 F1 A</p><p>If A’s start is in the middle of a card, in order to scan that card, won’t the BOT do more work to find the first object on that card given that it will have to look-up F0 which is further away? Also, note that the BOT look-up for A will actually NOT return the first object on that card (F0). Will that break any asserts?</p><p>Tony</p><p><br></p><p><br></p><div><blockquote type="cite" class="clean_bq" style="color: rgb(0, 0, 0); font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span><div><div><br>I need to check though if some verification code might not like this<span class="Apple-converted-space"> </span><br>situation.<span class="Apple-converted-space"> </span><br><br>Maybe I can find some good fix for that.<span class="Apple-converted-space"> </span><br><br>Thanks,<span class="Apple-converted-space"> </span><br>Thomas<span class="Apple-converted-space"> </span><br><br><br><br></div></div></span></blockquote><br class="Apple-interchange-newline"></div> <div id="bloop_sign_1435262335429108224" class="bloop_sign"><div style="font-family:helvetica,arial;font-size:13px"><div>-----</div><div><br></div><div>Tony Printezis | JVM/GC Engineer / VM Team | Twitter</div><div><br></div><div>@TonyPrintezis</div><div><a href="mailto:tprintezis@twitter.com">tprintezis@twitter.com</a></div><div><br></div></div></div></body></html>