<div dir="ltr"><div>Thanks for your comments.</div><div><br></div><div>Bear with me while I play devil's advocate...<br></div><div dir="ltr"><br></div><div dir="ltr">On Thu, Jul 27, 2023 at 3:16 PM Remi Forax <<a href="mailto:forax@univ-mlv.fr">forax@univ-mlv.fr</a>> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><div><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><div dir="ltr"><div>What if we compiled <span style="font-family:monospace">try { X } finally { Y }</span> into this:</div><br><div><div><span style="font-family:monospace">    X</span></div><div><span style="font-family:monospace">    Store null in local e1         // new instruction<br></span></div><div><span style="font-family:monospace">  goto L2<br></span></div>L1:<span style="font-family:monospace"> Store exception in local e1<br></span><div><span style="font-family:monospace">L2:</span><span style="font-family:monospace">Y</span></div><div><span style="font-family:monospace">    Load exception from local e1<br></span></div><div><span style="font-family:monospace">    If null, goto L3               </span><span style="font-family:monospace">// new instruction</span></div><div><div><span style="font-family:monospace">    Load exception from local e1</span><span style="font-family:monospace">// new instruction</span></div><span style="font-family:monospace">  Throw exception</span></div><div><span style="font-family:monospace">L3: ...<br></span></div></div></div></blockquote><div><br></div><div>It's a well known issue since the introduction of the split-verifier, the alternative is exponential verification time.<br></div></div></div></div></blockquote><div><br></div><div>Wait - are you saying the split-verifier has exponential verification time in certain cases?</div><div><br></div><div>If so, how is that not just a stupid verifier bug? Not to mention an easy way to DOS Java's widely heralded code portability.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><div><div></div><div>If you try to generate the code above most JITs will refuse to optimize the code, sharing the nominal path and the exception path is a big no no.<br></div></div></div></div></blockquote><div><br></div><div>And this is whose fault... ?</div><div><br></div><div>Isn't it a JIT's job to be aware of any such effects (if they exist on some particular hardware) and deal with them??<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><div><div></div><div>The official workaround if there are a lot on enclosed try/finally blocks is to use several methods.<br></div></div></div></div></blockquote><div><br></div><div>Workaround for whom?</div><div><br></div><div>If for the programmer, then so what? The existence of a workaround doesn't mean a bug shouldn't still be fixed.</div><div><br></div><div>If for the compiler, then when is the "official" workaround going to be actually implemented?</div><div><br></div><div>Thanks,<br></div><div>-Archie<br></div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Archie L. Cobbs<br></div></div>