<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'><div>The more I think about this, the more I want to do it the other way,</div><div>at least for the C backend, but only after another round of change.</div><div><br></div><div><br></div><div>For now, I prefer how it is.</div><div><br></div><div><br></div><div>The other change I want is "get_member_reference", or for load/store to indicate</div><div>field names or constant array indices, along with the "resolved" offset.</div><div><br></div><div><br></div><div>That is, I want the backend to be able to do layout, and I want the generated</div><div>C to be independent of word size. Including expressions involving</div><div>BITSIZE(INTEGER) to be rendered as</div><div>  #include <stddef.h> // or stdint.h (or autoconf) </div><div>  typedef ptrdiff_t INTEGER;  // or intptr_t (or autoconf) </div><div>  #define BITSIZE(x) sizeof(x) * CHAR_BIT</div><div><br></div><div>  BITSIZE(INTEGER)  </div><div><br></div><div><br></div><div>instead of the current 32 or 64.</div><div><br></div><div><br></div><div> Currently I have two pointers per jmpbuf.</div><div> One in the frame, one in another local variable.</div><div> Perhaps this can be converged to have just the one in the frame.</div><div> Independently of any other change.</div><div><br></div><div><br></div><div>Once we have get_member_reference, then for C this</div><div>would just be a nothing-special struct/record with a jmpbuf value at the end,</div><div>referenced by name.</div><div><br></div><div><br></div><div>For the other backends, perhaps we could make it a record,</div><div>of unspecified size, have the runtime compute the size by adding</div><div>the size of the prefix to the size of a jmpbuf and doing alloca.</div><div><br></div><div><br></div><div>I'd like C and non-C to be ABI compatible though.</div><div>They have other differences already, in particular around the frame pointer</div><div>for nested functions. This bothers me.</div><div><br></div><div><br></div><div> - Jay</div><br><br><br><div><hr id="stopSpelling">From: jay.krell@cornell.edu<br>To: hosking@purdue.edu<br>Date: Sun, 9 Aug 2015 16:18:59 +0000<br>CC: m3devel@elegosoft.com<br>Subject: Re: [M3devel] alloca(jmpbuf) vs. alloca(jmpbuf + frame)?<br><br>

<style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}

.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}

--></style>
<div dir="ltr"><a href="https://github.com/modula3/cm3/commit/5b04afe9134e5807196ba6af13fa4cd28401f054" target="_blank">https://github.com/modula3/cm3/commit/5b04afe9134e5807196ba6af13fa4cd28401f054</a><div><br></div><div>jmpbuf in frame changed from value to pointer.</div><div><br></div><div> - Jay<br><br><br><br><div><hr id="ecxstopSpelling">Subject: Re: [M3devel] alloca(jmpbuf) vs. alloca(jmpbuf + frame)?<br>From: hosking@purdue.edu<br>Date: Sun, 9 Aug 2015 20:09:36 +1000<br>CC: m3devel@elegosoft.com<br>To: jay.krell@cornell.edu<br><br><div>What is the m3core change you refer to?<br><br>Sent from my iPad</div><div><br>On 9 Aug 2015, at 11:33 am, Jay K <<a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a>> wrote:<br><br></div><blockquote><div>

<style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}

.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}


--></style>
<div dir="ltr"><span style="font-size:12pt;">I considered that I could lump the jmpbuf alloca in with its enclosing frame -- one slightly larger alloca,</span><div>and the same amount of overall stack, minus the pointer or two per jmpbuf in the current scheme.</div><div><br><div><br></div><div>That would preclude the need for m3core change, which I'm sure will cause trouble,</div><div>but is meant to be an ok thing to do.</div><div><br></div><div><br></div><div>However, that isn't perhaps as amenable to my next desired step in the C backend wrt jmp_buf.</div><div>Though, I guess, I could have it both ways -- the compiler and runtime could share a flag</div><div>and the frame be altered.</div><div><br></div><div><br></div><div>Thoughts?</div><div><br></div><div> - Jay</div></div>                                    </div>
</div></blockquote><blockquote><div><span>_______________________________________________</span><br><span>M3devel mailing list</span><br><span><a href="mailto:M3devel@elegosoft.com">M3devel@elegosoft.com</a></span><br><span><a href="https://mail.elegosoft.com/cgi-bin/mailman/listinfo/m3devel" target="_blank">https://mail.elegosoft.com/cgi-bin/mailman/listinfo/m3devel</a></span><br></div></blockquote></div></div>                                     </div>
<br>_______________________________________________
M3devel mailing list
M3devel@elegosoft.com
https://mail.elegosoft.com/cgi-bin/mailman/listinfo/m3devel</div>                                           </div></body>
</html>