<div dir="ltr">Awesome!<div><br></div><div>Patch committed with cleanup in r268845. Thanks very much David. :)</div><div><br></div><div>- Lang.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 6, 2016 at 9:41 AM, David <span dir="ltr"><<a href="mailto:dk402538@googlemail.com" target="_blank">dk402538@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div>Hi Lang,<br><br></div>I have attached the patch to this mail for your consideration.<br><br></div><div>Notes:<br></div>-I basically just added OrcX86_64_Win32 with the custom resolver code for windows. All the other static methods simply relay to their OrcX86_64 versions (therefore there is no need for any more refactoring).<br></div><div>-The asm code in my inital post doesnt work in release mode, because I forgot to account for shadow space allocation on stack. The code in the attached patch has that fixed.<br></div>-I decided to name the support class OrcX86_64_Win32 in order to be consistent with Triple<span style="color:rgb(0,0,0)">::</span>OSType<span style="color:rgb(0,0,0)">::</span>Win32.<br></div>-I didnt rename any of the other classes in OrcArchitectureSupport, as I didnt feel comfortable touching those. I guess renaming those is a quick thing to do.<br></div><div>-In lli, I made changes to stub and compilecallback creation functions accordingly. Here I test for the os type in triple and return the win32 support class if required. There might be other tools/places I am not aware of where this needs to be done.<br></div>-I didnt ran any tests apart from my little sandbox example. <br><br></div>Best,<br></div>David<br><div><div><div><br></div></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 5, 2016 at 3:09 AM, David <span dir="ltr"><<a href="mailto:dk402538@googlemail.com" target="_blank">dk402538@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi Lang,<br></div>I also agree that the second option should probably be the way to go. I will give it a shot and submit a patch. <br></div>Best,<br></div>David <br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 4, 2016 at 11:39 PM, Lang Hames <span dir="ltr"><<a href="mailto:lhames@gmail.com" target="_blank">lhames@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi David,<div><br></div><div>This is really cool. I'd love to get this in-tree.</div><div><br></div><div>There are two ways we could go about this:</div><div><br></div><div>(1) Make the OrcArchitecture interface ABI-aware so that it can choose the right resolver code,</div><div>or</div><div>(2) Replace the OrcArchitecture classes with OrcABI classes. I.e. We'd just a rename OrcX86_64 -> Orc_X86_64_SysV (and rename I386 & AArch64 similarly) , then we add your code as Orc_X86_64_Windows.</div><div><br></div><div>I think the second is probably the way to go, with a little refactoring so that the various X86 ABIs could share the stub and resolver code.</div><div><br></div><div>Any interest in submitting a patch?</div><span><font color="#888888"><div><br></div><div>- Lang.</div><div> </div><div><br></div><div> </div></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 4, 2016 at 11:21 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">+Lang, JIT Cowboy</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Wed, May 4, 2016 at 11:17 AM, David via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div>Hi There,<br><br>I am currently exploring C++ JIT-compilation for a project where this would be very useful. I started with the code from the lli tool which uses OrcLazyJIT and changed it, such that the module is being compiled from c++ source in memory and OrcLazyJIT is used exclusively.<br><br>Now since I am on windows, I found that my application is crashing when trying to run the main function from the jit-compiled module ( which was found by casting the symbol address to the main prototype). Now after some digging I found that the crash is caused by LocalJITCompileCallbackManager::reenter not getting the correct CompileCallback and trampolineid references. This in turn is being caused by<br>OrcX86_64::writeResolverCode not respecting windows calling convention in the asm code for calling the reentry function.<br><br>After making changes to the asm code in OrcX86_64::writeResolverCode, the code runs without any problems. I thought I share it here with the public so that others who would like to use orclazyjit on windows could benefit. Please let me know if a different channel would be more appropriate.<br><br>Best,<br>David<br><br></div><div>In order to get OrcLazyJIT to work under windows, replace the prebaked asm code in OrcX86_64::writeResolverCode in file llvm/lib/ExecutionEngine/Orc/OrcAchitectureSupport.cpp with the following. Note that more work is needed to both support linux/windows but I am not sure how this is best dealt with in llvm.<br><br></div><div><br></div><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">windows</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">(arguments go to rcx and rdx and have reversed order)---</span>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(128,128,0)">const</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">uint8_t</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">ResolverCode</span><span style="color:rgb(0,0,0)">[]</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">{</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">                                      </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">resolver_entry:</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x55</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                      </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x00:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pushq</span><span style="color:rgb(192,192,192)">     </span><span style="color:rgb(0,128,0)">%rbp</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x48</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x89</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0xe5</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                          </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x01:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">movq</span><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(0,128,0)">%rsp,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">%rbp</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x50</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                      </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x04:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pushq</span><span style="color:rgb(192,192,192)">     </span><span style="color:rgb(0,128,0)">%rax</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x53</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                      </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x05:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pushq</span><span style="color:rgb(192,192,192)">     </span><span style="color:rgb(0,128,0)">%rbx</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x51</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                      </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x06:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pushq</span><span style="color:rgb(192,192,192)">     </span><span style="color:rgb(0,128,0)">%rcx</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x52</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                      </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x07:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pushq</span><span style="color:rgb(192,192,192)">     </span><span style="color:rgb(0,128,0)">%rdx</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x56</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                      </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x08:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pushq</span><span style="color:rgb(192,192,192)">     </span><span style="color:rgb(0,128,0)">%rsi</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x57</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                      </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x09:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pushq</span><span style="color:rgb(192,192,192)">     </span><span style="color:rgb(0,128,0)">%rdi</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x41</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x50</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x0a:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pushq</span><span style="color:rgb(192,192,192)">     </span><span style="color:rgb(0,128,0)">%r8</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x41</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x51</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x0c:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pushq</span><span style="color:rgb(192,192,192)">     </span><span style="color:rgb(0,128,0)">%r9</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x41</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x52</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x0e:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pushq</span><span style="color:rgb(192,192,192)">     </span><span style="color:rgb(0,128,0)">%r10</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x41</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x53</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x10:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pushq</span><span style="color:rgb(192,192,192)">     </span><span style="color:rgb(0,128,0)">%r11</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x41</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x54</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x12:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pushq</span><span style="color:rgb(192,192,192)">     </span><span style="color:rgb(0,128,0)">%r12</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x41</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x55</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x14:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pushq</span><span style="color:rgb(192,192,192)">     </span><span style="color:rgb(0,128,0)">%r13</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x41</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x56</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x16:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pushq</span><span style="color:rgb(192,192,192)">     </span><span style="color:rgb(0,128,0)">%r14</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x41</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x57</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x18:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pushq</span><span style="color:rgb(192,192,192)">     </span><span style="color:rgb(0,128,0)">%r15</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x48</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x81</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0xec</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x08</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x02</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x00</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x00</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x1a:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">subq</span><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(0,128,0)">0x208,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">%rsp</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x48</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x0f</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0xae</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x04</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x24</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">              </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x21:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">fxsave64</span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(0,128,0)">(%rsp)</span></pre>
<pre style="margin:0px;text-indent:0px"><br><br></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x48</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0xb9</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x26:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">movabsq</span><span style="color:rgb(192,192,192)">   </span><span style="color:rgb(0,128,0)"><CBMgr>,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">%rcx</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x28:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Callback</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">manager</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">addr.</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x00</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x00</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x00</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x00</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x00</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x00</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x00</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x00</span><span style="color:rgb(0,0,0)">,</span></pre>
<pre style="margin:0px;text-indent:0px"><br><br></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x48</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x8B</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x55</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x08</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                    </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">mov</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">rdx,QWORD</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">PTR</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">[rbp+0x8]</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x48</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x83</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0xea</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x06</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                    </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">sub</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">rdx,0x6</span></pre>
<pre style="margin:0px;text-indent:0px"><br><br></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x48</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0xb8</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x38:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">movabsq</span><span style="color:rgb(192,192,192)">   </span><span style="color:rgb(0,128,0)"><REntry>,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">%rax</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x3a:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">JIT</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">re-entry</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">fn</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">addr:</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x00</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x00</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x00</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x00</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x00</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x00</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x00</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x00</span><span style="color:rgb(0,0,0)">,</span></pre>
<pre style="margin:0px;text-indent:0px"><br></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0xff</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0xd0</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x42:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">callq</span><span style="color:rgb(192,192,192)">     </span><span style="color:rgb(0,128,0)">*%rax</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x48</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x89</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x45</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x08</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                    </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x44:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">movq</span><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(0,128,0)">%rax,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">8(%rbp)</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x48</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x0f</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0xae</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x0c</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x24</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">              </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x48:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">fxrstor64</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">(%rsp)</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x48</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x81</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0xc4</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x08</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x02</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x00</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x00</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x4d:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">addq</span><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(0,128,0)">0x208,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">%rsp</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x41</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x5f</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x54:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">popq</span><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(0,128,0)">%r15</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x41</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x5e</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x56:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">popq</span><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(0,128,0)">%r14</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x41</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x5d</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x58:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">popq</span><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(0,128,0)">%r13</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x41</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x5c</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x5a:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">popq</span><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(0,128,0)">%r12</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x41</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x5b</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x5c:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">popq</span><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(0,128,0)">%r11</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x41</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x5a</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x5e:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">popq</span><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(0,128,0)">%r10</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x41</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x59</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x60:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">popq</span><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(0,128,0)">%r9</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x41</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x58</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x62:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">popq</span><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(0,128,0)">%r8</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x5f</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                      </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x64:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">popq</span><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(0,128,0)">%rdi</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x5e</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                      </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x65:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">popq</span><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(0,128,0)">%rsi</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x5a</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                      </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x66:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">popq</span><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(0,128,0)">%rdx</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x59</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                      </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x67:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">popq</span><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(0,128,0)">%rcx</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x5b</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                      </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x68:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">popq</span><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(0,128,0)">%rbx</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x58</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                      </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x69:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">popq</span><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(0,128,0)">%rax</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0x5d</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                      </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x6a:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">popq</span><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(0,128,0)">%rbp</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,128)">0xc3</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)">                                      </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0x6b:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">retq</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,0)">};</span></pre><br><pre style="margin:0px;text-indent:0px"><span style="color:rgb(128,128,0)">const</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">unsigned</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">ReentryFnAddrOffset</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x3a</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(128,128,0)">const</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">unsigned</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">CallbackMgrAddrOffset</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x28</span><span style="color:rgb(0,0,0)">;</span></pre></div>
<br></div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>