<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Yes, that's more clear (you duplicated the word specified, minor typo).</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The other part that threw me off was that the section name was only identified "for Darwin." I was able to find the section via assembly inspection, but that threw me off a bit.</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Philip Reames <listmail@philipreames.com><br>
<b>Sent:</b> Thursday, November 8, 2018 7:21 AM<br>
<b>To:</b> Jordan Rudd; llvm-dev@lists.llvm.org<br>
<b>Subject:</b> Re: [llvm-dev] Building GC on statepoint-example</font>
<div> </div>
</div>
<div style="background-color:#FFFFFF">
<p>Jordon,</p>
<p><br>
</p>
<p>I just submitted a change to the docs to hopefully address your confusion.  Can you take a look and let me know if you have further questions?  Start with the revised Stack Map Format section.</p>
<p><br>
</p>
<p>Philip</p>
<p><br>
</p>
<p>p.s. I just submitted this and it'll take a few minutes to refresh.  In the meantime, you could look at the diff for 346405.<br>
</p>
<p><br>
</p>
<div class="x_moz-cite-prefix">On 11/2/18 2:52 PM, Jordan Rudd via llvm-dev wrote:<br>
</div>
<blockquote type="cite"><style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Note: These instructions seem to be targeted towards people creating a JIT. My compiler compiles to native. I suppose I just need a reference to the stack location of the stack map, wherever that is.</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> llvm-dev
<a class="x_moz-txt-link-rfc2396E" href="mailto:llvm-dev-bounces@lists.llvm.org">
<llvm-dev-bounces@lists.llvm.org></a> on behalf of Jordan Rudd via llvm-dev <a class="x_moz-txt-link-rfc2396E" href="mailto:llvm-dev@lists.llvm.org">
<llvm-dev@lists.llvm.org></a><br>
<b>Sent:</b> Thursday, November 1, 2018 2:06 PM<br>
<b>To:</b> <a class="x_moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">
llvm-dev@lists.llvm.org</a><br>
<b>Subject:</b> [llvm-dev] Building GC on statepoint-example</font>
<div> </div>
</div>
<meta content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hi,</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
I'm trying to build a gc using the statepoint-example strategy. However, after hours of searching, reading documentation and trying to find code examples online, I cannot figure out how to access the Stack Map.</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
The documentation for statepoint-example says:</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<i><span style="">The stack map format generated by this GC strategy can be found in the<span> </span></span><a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fllvm.org%2Fdocs%2FStackMaps.html%23stackmap-section&data=02%7C01%7C%7C0d564a3c7b9a42962e2608d6458de2c0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636772873036011590&sdata=5TKPXTyU5xCrGx67PXW%2FfOHUxhmBJxLAFh1Qckj7jMk%3D&reserved=0" originalsrc="https://llvm.org/docs/StackMaps.html#stackmap-section" shash="se7AxZJlxMN+he91+uaVooQYxGnQPptuKz0umeSxtwO7SC5B6QMj+Bp+JVhhjWXdnFvn44471B0L1hSDjxq5Iqq+cjGGUwfBiW2vF4e1E4wI/rVWvBjutW4RPLfymsUtsPt8yhQHszinXUk/jOhy3iNmP3bBUyMuajN9K6jLdCE=" originalsrc="https://llvm.org/docs/StackMaps.html#stackmap-section" shash="VEGTjfCHpcYeYznX8jdBUdLzAI7QOw6YKFpYgAzyx96kYQZjAGC50JFOdpYfGrMHCl8ppZ1/gmJn7y7VXBPQ03pAaxsXlXodGEgbavdDWyifzHwSRgpZ5fgVpTch3aJlgiU8jQ6h3A/Y0cmyByKynLbBpY1fKjW/41sl5E9JjAg=" style=""><span>Stack
 Map Section</span></a><span style=""><span> </span>using a format documented<span> </span></span><a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fllvm.org%2Fdocs%2FStatepoints.html%23statepoint-stackmap-format&data=02%7C01%7C%7C0d564a3c7b9a42962e2608d6458de2c0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636772873036011590&sdata=HXlqIsOn9UXV8kCW508RVYs4UaGk6sDG8VfjmzCHiOc%3D&reserved=0" originalsrc="https://llvm.org/docs/Statepoints.html#statepoint-stackmap-format" shash="g9NLTkx0tI98/wLG9ce2/UcQ5xERrTHrJKs0C7J6oyzmAbg+le7N48v/TA/LZBeO66Vw/gNB7mwLkhky9LMs1y0bdHArzp/RRTMM1F6CZZ0Cv84eU7zImYh6HtQmzcLRXWiVZe+/S+4NhbAUV7oJxHbyD/2/NphYPjYheDyZJwc=" originalsrc="https://llvm.org/docs/Statepoints.html#statepoint-stackmap-format" shash="fPdsayL0G00r1X/ig1NNrVkyejjKWBfw1LvIRhzBdrbBYC3fMYoUz0QhztdzjGXtFkT773DEJ1+ppgqqWQVSTOe7kfuvH/9EwT5PMWqqPQi2K3OkAwx/8J+5xl7Lkm0QOUByMsKY88BcnIKAQ9zL+FIRyhzyiUFzxkzUIeKRW88=" style=""><span>here</span></a><span style="">.
 This format is intended to be the standard format supported by LLVM going forward.</span></i><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style=""><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="">Ok, great, I see the format. But... how do I access the Stack Map from my runtime? Where is it? </span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style=""><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="">The link seems to send me to this instruction:</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style=""><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style=""><i><span style="font-size:14px; background-color:rgb(255,255,255); display:inline!important">A JIT compiler can easily access this section by providing its own memory manager via the LLVM C API</span><code style=""><span style="">LLVMCreateSimpleMCJITMemoryManager()</span></code><span style="font-size:14px; background-color:rgb(255,255,255); display:inline!important">.
 When creating the memory manager, the JIT provides a callback:</span><code style=""><span style="">LLVMMemoryManagerAllocateDataSectionCallback()</span></code><span style="font-size:14px; background-color:rgb(255,255,255); display:inline!important">. When
 LLVM creates this section, it invokes the callback and passes the section name.</span></i><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style=""><span style="font-size:14px; background-color:rgb(255,255,255); display:inline!important"><br>
</span></span></div>
<div style="color:rgb(0,0,0)"><font face="Lucida Grande, Lucida
            Sans Unicode, Geneva, Verdana, sans-serif"><span style="font-size:14px">None of these API's are well-documented, so I'm kind of trying to guess what to do here. As a proof of concept,
 I tried building a do-nothing memory manager that calls APILLVMCreateSimpleMCJITMemoryManager on static initialization and passes the callbacks to it. I link the necessary llvm libs into my runtime and fire it up.<br>
<br>
I can confirm that my safepoint poll code is getting hit. I can confirm that creating the "memory manager" is called on runtime boot and that it's succeeding. But the callbacks never get hit. Even if they were, it's unclear how I would use the parameters of
 those callbacks to locate the stack map.</span></font></div>
<div style="color:rgb(0,0,0)"><font face="Lucida Grande, Lucida
            Sans Unicode, Geneva, Verdana, sans-serif"><span style="font-size:14px"><br>
</span></font></div>
<div style="color:rgb(0,0,0)"><font face="Lucida Grande, Lucida
            Sans Unicode, Geneva, Verdana, sans-serif"><span style="font-size:14px">What am I missing? </span></font></div>
<div style="color:rgb(0,0,0)"><font face="Lucida Grande, Lucida
            Sans Unicode, Geneva, Verdana, sans-serif"><span style="font-size:14px"><br>
</span></font></div>
<div style="color:rgb(0,0,0)"><font face="Lucida Grande, Lucida
            Sans Unicode, Geneva, Verdana, sans-serif"><span style="font-size:14px">Thanks!</span></font></div>
<div style="color:rgb(0,0,0)"><font face="Lucida Grande, Lucida
            Sans Unicode, Geneva, Verdana, sans-serif"><span style="font-size:14px">Jordan</span></font></div>
</div>
<br>
<fieldset class="x_mimeAttachmentHeader"></fieldset>
<pre class="x_moz-quote-pre">_______________________________________________
LLVM Developers mailing list
<a class="x_moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="x_moz-txt-link-freetext" href="https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.llvm.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fllvm-dev&data=02%7C01%7C%7C0d564a3c7b9a42962e2608d6458de2c0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636772873036011590&sdata=%2BRKrFLsD8wLLSHLi4zaXNbY2kOV5ElUbrNUjRkGEWj0%3D&reserved=0" originalsrc="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" shash="ItLI4f6yLHOFG7Hq5FTYp17YNgSjsdo7P5s4fUfyErciDyH5wxXvfnvgVocTasDqSyJRxv96ASB39GFUay7EAAr2AJB2Lgq1UECNnSDaiD+mZoiIFlFAkwN4nZpJ1IMGPq0qKfyihtFpvR4lIbq/IgNaWjKU4IrlQWTHVyPSwsM=">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
</div>
</body>
</html>