<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Pawel,<br>
<br>
Sorry for taking so long to reply. I just stumbled across your
email again and realized I'd never gotten around to responding. <br>
<br>
I would suggest that you not attempt to use the existing gc_root
mechanism provided by LLVM today. It's buggy, not well supported,
and essentially no one uses it. I am actively hoping to kill it
within the near future. <br>
<br>
I'd recommend taking a look at the work we've been doing on
safepoint placement here:
<a class="moz-txt-link-freetext" href="https://github.com/AzulSystems/llvm-late-safepoint-placement">https://github.com/AzulSystems/llvm-late-safepoint-placement</a>. The
actual late safepoint placement pass is still under active
development and isn't necessarily ready for general use (though
feedback is appreciated!), but the supporting infrastructure is
fairly mature at this point. <br>
<br>
If you're willing to do eager safepoint insertion in your IR
generator, everything should work fairly reliably. In particular,
the data your original question asked would be available in the
StackMap section which is fairly well documented. All you'd need to
do would be write a parser. (Well, and fix/report any bugs you
might encounter..)<br>
<br>
Philip<br>
<br>
<div class="moz-cite-prefix">On 06/02/2014 03:24 PM, Paweł Batko
wrote:<br>
</div>
<blockquote
cite="mid:CA+nu9yQHNZ5cVWxoEy6ZyzqtOetyPon_zqFx_eeREc5_Lthq7Q@mail.gmail.com"
type="cite">
<div dir="ltr">Hi all,<br>
<br>
I'm writing a GC plugin, targeting x86_64. I'm stuck on handling
stack maps. I generate assembly for them like in the
documentation: <a moz-do-not-send="true"
href="http://llvm.org/docs/GarbageCollection.html#emitting-assembly-code-gcmetadataprinter">http://llvm.org/docs/GarbageCollection.html#emitting-assembly-code-gcmetadataprinter</a>
and now I'm trying to figure out the best way to correlate stack
maps with call frames.
<div>
<div>I have an idea to put a label before every stack map
entry and then put the address of this label within well
known offset from the function. Then, while walking the call
stack and having function address I could retrieve relevant
stack map entry..<br>
My current approach to generating the label for stack map
entries looks like this:</div>
<div>
<div> <span class="" style="white-space:pre"> </span>MCSymbol
*ala = AP.OutContext.GetOrCreateSymbol(StringRef("ala"));</div>
<div> <span class="" style="white-space:pre"> </span>OS.EmitLabel(ala);<br>
But then, I don't know how to emit the address of the
label near the function. I mean, I think I'd use something
like this 'OS.EmitSymbolValue(ala, 4)', but I'm not sure
where I should hook into to achieve this.<br>
<br>
Note that I'm fairly new to LLVM and the approach I
described above does not necessarily make much sense. I'd
pleased to hear the proper way to handle stack maps.<br>
<br>
Regards,<br>
Paweł</div>
<br>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
</body>
</html>