<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-GB link=blue vlink=purple>

<div class=WordSection1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Foo<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'>

<p class=MsoNormal>Here's another way to think about the issue: Compare this
whole approach to stack roots to that of a conservative collector. Since we
know conservative collectors work, the whole reason for making an accurate
collector in the first place is efficiency, right? If we couldn't make an
accurate collector that was more efficient than a conservative collector, then
no one would bother because it's such a pain.<o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>However, looking strictly at stack frames, a conservative
collector has a much more compact stack layout. There's no need to copy
anything to local variables, because by the time you call into the collector
proper, everything - every register variable, every function parameter, and so
on - is already on the stack *somewhere*.<o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>The stack frame layout dictated by llvm.gcroot, by contrast,
is much, much fatter. In a typical deeply-nested call stack, there will be many
copies of the same value on the stack. Let's take the 'this' pointer as an
example. Say we have some method that calls itself recursively, and we are
currently 10 levels deep. That means that we have 20 copies of the 'this'
pointer on the stack: Because each invocation of the method has to push the
'this' pointer on the stack as part of the calling protocol (even if it's
passed in registers, it still has to save the prior value of the register
somewhere), and in addition we also have to save the 'this' pointer as a stack
root. A conservative collector, on the other hand, would be able to get by with
only 10 copies of the 'this' pointer.<o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>As far as the issue of eliminating redundant stores, I'm
pretty sure that the optimizers cannot eliminate redundant <i>roots</i>.
Figuring out the minimal set of temporary roots needed for a function call is a
non-trivial problem (you don't want to just blindly make every pointer argument
to a function a temporary root, since that just bloats the size of the call
frame needlessly.)<o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>My entire goal here is to get a GC that has high performance
and efficiency. I want my GC to be able to run on everything from a data center
to a beagle board, and use the minimum resources possible.<br clear=all>
<br>
<span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>--
<br>
-- Talin<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Foo<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Foo<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

</div>

</div>

</body>

</html>