<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 9, 2015 at 4:36 PM, Andrew Trick <span dir="ltr"><<a href="mailto:atrick@apple.com" target="_blank">atrick@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span class=""><blockquote type="cite"><div>On Jul 9, 2015, at 3:33 PM, Swaroop Sridhar <<a href="mailto:Swaroop.Sridhar@microsoft.com" target="_blank">Swaroop.Sridhar@microsoft.com</a>> wrote:</div><br><div>





<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Regarding Call-site size specification:<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">CoreCLR (<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_dotnet_coreclr&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=k9ShSbtyr8PTV_wAD6k1EUBN_L1NHV7z4gRzkd7hkTI&s=1wT7U5rYG7gu4VYtJjOjaV6LRfcapEjNmOCYQ84EjTk&e=" target="_blank">https://github.com/dotnet/coreclr</a>) requires the size of the Call-instruction to be reported in the GCInfo
 encoding.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">The runtime performs querries for StackMap records using instruction offsets as follows:<u></u><u></u></span></p><p><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><span>1)<span style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7pt;line-height:normal;font-family:'Times New Roman'">     
</span></span></span><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Offset at the end of the call instruction (offset of next instruction-1) if the call instruction occurs in code where GC can only take control at safe-points.</span></p></div></div></div></blockquote><div><br></div></span>As part of this change it would be great if LLVM could now guarantee that the call will be emitted at the end of the patchable space. It currently happens to emit at the beginning, but makes no guarantee. Emitting at the end works better for tracking the return address.</div></div></blockquote><div><br></div><div>I think for this to be reliable, we'd have to make the stackmap locations be valid to the end of the patchpoint, instead of only to the beginning of the patchpoint.  If we don't, the caller still has to be ready to move the call instruction to make room for any spills+restores of non-preserved registers used by the stackmap.</div></div></div></div>