<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Good point.  I have it around somewhere... (I need that automatic resource management in real life..)<BR> <BR> - Jay<br><br> <BR><div>> To: hosking@cs.purdue.edu<br>> Date: Tue, 28 Jan 2014 15:49:19 -0800<br>> From: mika@async.caltech.edu<br>> CC: m3devel@elegosoft.com<br>> Subject: Re: [M3devel] garbage collector compacting and volatile?<br>> <br>> <br>> Sounds like Jay doesn't need to buy a copy of your book :-)<br>> <br>> Tony Hosking writes:<br>> ><br>> >--Apple-Mail=_12C5DBD9-678E-4559-B4C2-E4CFDA144CD4<br>> >Content-Transfer-Encoding: quoted-printable<br>> >Content-Type: text/plain;<br>> >      charset=iso-8859-1<br>> ><br>> ><br>> ><br>> >On Jan 27, 2014, at 2:45 AM, Jay K <jay.krell@cornell.edu> wrote:<br>> ><br>> >> In summary, shortest:<br>> >>=20<br>> >>=20<br>> >>   We must be able to read registers (or save them to the stack or =<br>> >elsewhere (known thread locals)). =20<br>> >>   We must be able to read the stack. =20<br>> >>   We need not write registers or stack (from garbage collector). =20<br>> ><br>> >Correct.<br>> ><br>> >> Slight elaboration:<br>> >>  Copying/compaction only occurs when references are only from globals =<br>> >and heap.=20<br>> >>  Therefore updates/writes only occur to globals and heap.=20<br>> ><br>> >Correct.<br>> ><br>> >>  Is there any desire to do better/different?=20<br>> >>  To require the ability to update stack/registers?=20<br>> ><br>> >Without control of the register allocator, optimisations, and stack =<br>> >layout performed by the compiler (especially back-end) getting fully =<br>> >accurate stack maps is very difficult.<br>> ><br>> >>  What does Java typically to?=20<br>> ><br>> >Java VMs usually control their own destiny, having full control of JIT =<br>> >and stack layout.  viz. HotSpot, IBM J9, Jikes RVM.<br>> ><br>> >> I guess there is the problem that we don't know for certain if values =<br>> >in registers and stack are pointers, or just coincident integers, and so =<br>> >updating them can be wrong.<br>> ><br>> >Correct.<br>> ><br>> >> Whereas in the globals and "reachable thereof" we have precise type =<br>> >information for, so we can update those values safely.<br>> ><br>> >Correct.<br>> ><br>> >> To do better/different would require more backend cooperation.<br>> >> We conservatively treat registers/stack as pointers if they look like =<br>> >them, and therefore keep values alive, but not trust them so much as to =<br>> >update them.<br>> ><br>> >Correct.<br></div>                                        </div></body>
</html>