<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Ah..I'm doing more comparisons of release vs. head...but..I guess your point is, you'd rather have n locals, which the backend automatically merges, than n calls to alloca?<br>It's not a huge difference -- there are still going to be n calls to setjmp and n calls to pthread_getspecific.<br>The alloca calls will be dwarfed.<br>Code size will suffer.<br><br><br>And, even so, there are plenty of optimizations to be had, even if setjmp/pthread_getspecific is used.<br><br><br> - It could make a maximum of one call to setjmp/pthread_getspecific per function<br> - The calls to alloca could be merged. The frontend could keep track of how many calls it makes per function,<br> issue a multiplication, and offset each jmpbuf. It is a tradeoff.<br><br><br>So, yes, given my current understanding, it is progress.<br>The target-dependence is not worth it, imho.<br>I'll still do some comparisons to release.<br><br><br>I'll still be looking into using the gcc unwinder relatively soon.<br><br><br> - Jay<br><br><br><hr id="stopSpelling">Subject: Re: [M3commit] CVS Update: cm3<br>From: hosking@cs.purdue.edu<br>Date: Wed, 5 Jan 2011 21:14:17 -0500<br>CC: m3commit@elegosoft.com<br>To: jay.krell@cornell.edu<br><br>
<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML"><base><div><div>On Jan 5, 2011, at 9:08 PM, Jay K wrote:</div><br class="ecxApple-interchange-newline"><blockquote><span class="ecxApple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-size: medium;"><div class="ecxhmmessage" style="font-size: 10pt; font-family: Tahoma;">Tony, um..well, um.. first, isn't that how it already worked maybe? Declaring a new local EF1 for each TRY? It looks like it.<br>I'll do more testing.<br></div></span></blockquote><div><br></div><div>Yes, it did. I assume you simply have a local variable for each TRY block that is a pointer now instead of a jmp_buf. Should be OK.</div><br><blockquote><span class="ecxApple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-size: medium;"><div class="ecxhmmessage" style="font-size: 10pt; font-family: Tahoma;"><br>So the additional inefficiency is multiplied the same as the rest of the preexisting inefficiency.<br>And the preexisting inefficiency is way more than the increase.<br><br>And second, either way, it could be better.<br><br>Basically, the model should be, that if a function has any try or lock, it calls setjmp once.<br>And then, it should have one volatile integer, that in a sense represents the line number.<br> But not really. It's like, every time you cross a TRY, the integer is incremented, every time you<br> cross a finally or unlock, the integer is decremented. Or rather, the value can be stored.<br> And then there is a maximum of one one handler per function, it switches on the integer<br> to decide where it got into the function and what it should do.<br><br>This is how other compilers work and it is a fairly simple sensible approach.<br><br> - Jay<br><br><br><hr id="ecxstopSpelling">Subject: Re: [M3commit] CVS Update: cm3<br>From:<span class="ecxApple-converted-space"> </span><a href="mailto:hosking@cs.purdue.edu">hosking@cs.purdue.edu</a><br>Date: Wed, 5 Jan 2011 20:49:24 -0500<br>CC:<span class="ecxApple-converted-space"> </span><a href="mailto:m3commit@elegosoft.com">m3commit@elegosoft.com</a><br>To:<span class="ecxApple-converted-space"> </span><a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a><br><br>Note that you need a different jmpbuf for each nested TRY!<div><br><div><span class="ecxApple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span class="ecxApple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div style="word-wrap: break-word;"><span class="ecxApple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span class="ecxApple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span class="ecxApple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span class="ecxApple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span class="ecxApple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span class="ecxApple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span class="ecxApple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span class="ecxApple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div><font class="ecxApple-style-span" color="#0000ff"><font class="ecxApple-style-span" face="Gill Sans"><span class="ecxApple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans';"><span class="ecxApple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans';">Antony Hosking</span></span></font></font><font class="ecxApple-style-span" face="Gill Sans"><span class="ecxApple-style-span" style="font-family: 'Gill Sans';"><span class="ecxApple-style-span" style="font-family: 'Gill Sans';"><span class="ecxApple-converted-space"> </span>|<span class="ecxApple-converted-space"> </span></span></span><span class="ecxApple-style-span" style="font-family: 'Gill Sans';"><span class="ecxApple-style-span" style="font-family: 'Gill Sans';">Associate Professor</span></span><span class="ecxApple-style-span" style="font-family: 'Gill Sans';"><span class="ecxApple-style-span" style="font-family: 'Gill Sans';"> | Computer Science | Purdue University</span></span></font></div><div><font class="ecxApple-style-span" face="GillSans-Light"><span class="ecxApple-style-span" style="font-family: GillSans-Light;">305 N. University Street | West Lafayette | IN 47907 | USA</span></font></div><div><font class="ecxApple-style-span" color="#0000ff" face="Gill Sans"><span class="ecxApple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans';"><span class="ecxApple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans';">Office</span></span></font><font class="ecxApple-style-span" face="GillSans-Light"><span class="ecxApple-style-span" style="font-family: GillSans-Light;"><span class="ecxApple-style-span" style="font-family: GillSans-Light;"> +1 765 494 6001 |<span class="ecxApple-converted-space"> </span></span></span></font><font class="ecxApple-style-span" color="#0000ff" face="Gill Sans"><span class="ecxApple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans';"><span class="ecxApple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans';">Mobile</span></span></font><font class="ecxApple-style-span" face="GillSans-Light"><span class="ecxApple-style-span" style="font-family: GillSans-Light;"><span class="ecxApple-style-span" style="font-family: GillSans-Light;"><span class="ecxApple-converted-space"> </span>+1 765 427 5484</span></span></font></div><div><font class="ecxApple-style-span" face="GillSans-Light"><br class="ecxkhtml-block-placeholder"></font></div></span></span></span></span></span></span></span><br class="ecxApple-interchange-newline"></span></div></span></span><br class="ecxApple-interchange-newline"></div><br><div><div>On Jan 5, 2011, at 8:33 PM, Jay K wrote:</div><br class="ecxApple-interchange-newline"><blockquote><span class="ecxApple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-size: medium;"><div class="ecxhmmessage" style="font-size: 10pt; font-family: Tahoma;">oops, that's not how I thought it worked. I'll do more testing and fix it -- check for NIL.<br><br> - Jay<br><br><hr id="ecxstopSpelling">Subject: Re: [M3commit] CVS Update: cm3<br>From:<span class="ecxApple-converted-space"> </span><a href="mailto:hosking@cs.purdue.edu">hosking@cs.purdue.edu</a><br>Date: Wed, 5 Jan 2011 20:23:09 -0500<br>CC:<span class="ecxApple-converted-space"> </span><a href="mailto:m3commit@elegosoft.com">m3commit@elegosoft.com</a><br>To:<span class="ecxApple-converted-space"> </span><a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a><br><br>Ah, yes, I guess you need a different jmpbuf for each TRY. But now you are allocating on every TRY where previously the storage was statically allocated. Do you really think this is progress?<br><br><div><div>On Jan 5, 2011, at 5:40 PM, Jay K wrote:</div><br class="ecxApple-interchange-newline"><blockquote><span class="ecxApple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-size: medium;"><div class="ecxhmmessage" style="font-size: 10pt; font-family: Tahoma;">I've back with full keyboard if more explanation needed. The diff is actually fairly small to read.<div>I understand it is definitely less efficient, a few more instructions for every try/lock.</div><div>No extra function call, at least with gcc backend.</div><div>I haven't tested NT386 yet. Odds are so/so that it works -- the change is written so that it should work</div><div>but I have to test it to be sure, will to roughly tonight. And there probably is a function call there.</div><div><br></div><div> - Jay<br><br><hr id="ecxstopSpelling">From:<span class="ecxApple-converted-space"> </span><a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a><br>To:<span class="ecxApple-converted-space"> </span><a href="mailto:hosking@cs.purdue.edu">hosking@cs.purdue.edu</a><br>Date: Wed, 5 Jan 2011 20:44:08 +0000<br>CC:<span class="ecxApple-converted-space"> </span><a href="mailto:m3commit@elegosoft.com">m3commit@elegosoft.com</a><br>Subject: Re: [M3commit] CVS Update: cm3<br><br>I only have phone right now. I think it is fairly clear: the jumpbuf in EF1 is now allocated with alloca, and a pointer stored. It is definitely a bit less efficient, but the significant advantage is frontend no longer needs to know the size or alignment of a jumpbuf.<br><br><br>As well, there is no longer the problem regarding jumpbuf aligned to more than 64 bits. I at least checked on Linux/PowerPC and alloca seems to align to 16 bytes. I don't have an HPUX machine currently to see if the problem is addressed there.<br><br><br>The inefficiency of course can be dramatically mitigated via a stack walker. I wanted to do this first though, while more targets using setjmp.<br><br>- Jay/phone<br><br><hr>Subject: Re: [M3commit] CVS Update: cm3<br>From:<span class="ecxApple-converted-space"> </span><a href="mailto:hosking@cs.purdue.edu">hosking@cs.purdue.edu</a><br>Date: Wed, 5 Jan 2011 13:35:59 -0500<br>CC:<span class="ecxApple-converted-space"> </span><a href="mailto:jkrell@elego.de">jkrell@elego.de</a>;<span class="ecxApple-converted-space"> </span><a href="mailto:m3commit@elegosoft.com">m3commit@elegosoft.com</a><br>To:<span class="ecxApple-converted-space"> </span><a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a><br><br>Can you provide a more descriptive checkin comment? I don't know what has been done here without diving into the diff.<div><br><div><div><span class="ecxApple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span class="ecxApple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div style="word-wrap: break-word;"><span class="ecxApple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span class="ecxApple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span class="ecxApple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span class="ecxApple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span class="ecxApple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span class="ecxApple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span class="ecxApple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span class="ecxApple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div><font class="ecxApple-style-span" color="#0000ff"><font class="ecxApple-style-span" face="Gill Sans"><span class="ecxApple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans';"><span class="ecxApple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans';">Antony Hosking</span></span></font></font><font class="ecxApple-style-span" face="Gill Sans"><span class="ecxApple-style-span" style="font-family: 'Gill Sans';"><span class="ecxApple-style-span" style="font-family: 'Gill Sans';"><span class="ecxApple-converted-space"> </span>|<span class="ecxApple-converted-space"> </span></span></span><span class="ecxApple-style-span" style="font-family: 'Gill Sans';"><span class="ecxApple-style-span" style="font-family: 'Gill Sans';">Associate Professor</span></span><span class="ecxApple-style-span" style="font-family: 'Gill Sans';"><span class="ecxApple-style-span" style="font-family: 'Gill Sans';"> | Computer Science | Purdue University</span></span></font></div><div><font class="ecxApple-style-span" face="GillSans-Light"><span class="ecxApple-style-span" style="font-family: GillSans-Light;">305 N. University Street | West Lafayette | IN 47907 | USA</span></font></div><div><font class="ecxApple-style-span" color="#0000ff" face="Gill Sans"><span class="ecxApple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans';"><span class="ecxApple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans';">Office</span></span></font><font class="ecxApple-style-span" face="GillSans-Light"><span class="ecxApple-style-span" style="font-family: GillSans-Light;"><span class="ecxApple-style-span" style="font-family: GillSans-Light;"> +1 765 494 6001 |<span class="ecxApple-converted-space"> </span></span></span></font><font class="ecxApple-style-span" color="#0000ff" face="Gill Sans"><span class="ecxApple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans';"><span class="ecxApple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans';">Mobile</span></span></font><font class="ecxApple-style-span" face="GillSans-Light"><span class="ecxApple-style-span" style="font-family: GillSans-Light;"><span class="ecxApple-style-span" style="font-family: GillSans-Light;"><span class="ecxApple-converted-space"> </span>+1 765 427 5484</span></span></font></div><div><font class="ecxApple-style-span" face="GillSans-Light"><br class="ecxkhtml-block-placeholder"></font></div></span></span></span></span></span></span></span><br class="ecxApple-interchange-newline"></span></div></span></span><br class="ecxApple-interchange-newline"></div><br><div><div>On Jan 5, 2011, at 9:37 AM, Jay K wrote:</div><br class="ecxApple-interchange-newline"><blockquote><span class="ecxApple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-size: medium;"><div class="ecxhmmessage" style="font-size: 10pt; font-family: Tahoma;">diff attached<br><br>> Date: Wed, 5 Jan 2011 15:34:55 +0000<br>> To:<span class="ecxApple-converted-space"> </span><a href="mailto:m3commit@elegosoft.com">m3commit@elegosoft.com</a><br>> From:<span class="ecxApple-converted-space"> </span><a href="mailto:jkrell@elego.de">jkrell@elego.de</a><br>> Subject: [M3commit] CVS Update: cm3<br>><span class="ecxApple-converted-space"> </span><br>> CVSROOT: /usr/cvs<br>> Changes by: jkrell@birch. 11/01/05 15:34:55<br>><span class="ecxApple-converted-space"> </span><br>> Modified files:<br>> cm3/m3-libs/m3core/src/C/Common/: Csetjmp.i3<span class="ecxApple-converted-space"> </span><br>> cm3/m3-libs/m3core/src/C/I386_CYGWIN/: Csetjmp.i3<span class="ecxApple-converted-space"> </span><br>> cm3/m3-libs/m3core/src/C/I386_MINGW/: Csetjmp.i3<span class="ecxApple-converted-space"> </span><br>> cm3/m3-libs/m3core/src/C/I386_NT/: Csetjmp.i3<span class="ecxApple-converted-space"> </span><br>> cm3/m3-libs/m3core/src/C/NT386/: Csetjmp.i3<span class="ecxApple-converted-space"> </span><br>> cm3/m3-libs/m3core/src/runtime/ex_frame/: RTExFrame.m3<span class="ecxApple-converted-space"> </span><br>> cm3/m3-libs/m3core/src/unix/Common/: Uconstants.c<span class="ecxApple-converted-space"> </span><br>> cm3/m3-sys/m3cc/gcc/gcc/m3cg/: parse.c<span class="ecxApple-converted-space"> </span><br>> cm3/m3-sys/m3front/src/misc/: Marker.m3<span class="ecxApple-converted-space"> </span><br>> cm3/m3-sys/m3front/src/stmts/: TryFinStmt.m3 TryStmt.m3<span class="ecxApple-converted-space"> </span><br>> cm3/m3-sys/m3middle/src/: M3RT.i3 M3RT.m3 Target.i3 Target.m3<span class="ecxApple-converted-space"> </span><br>><span class="ecxApple-converted-space"> </span><br>> Log message:<br>> use: extern INTEGER Csetjmp__Jumpbuf_size /* = sizeof(jmp_buf);<br>> alloca(Csetjmp__Jumpbuf_size)<br>><span class="ecxApple-converted-space"> </span><br>> to allocate jmp_buf<br>><span class="ecxApple-converted-space"> </span><br>> - eliminates a large swath of target-dependent code<br>> - allows for covering up the inability to declare<br>> types with alignment > 64 bits<br>><span class="ecxApple-converted-space"> </span><br>> It is, granted, a little bit slower, in an already prety slow path.<br>> Note that alloca isn't actually a function call, at least with gcc backend.<br>><span class="ecxApple-converted-space"> </span><br><span><jmpbuf_alloca.txt></span></div></span></blockquote></div><br></div></div></div></div></span><br class="ecxApple-interchange-newline"></blockquote></div><br></div></span><br class="ecxApple-interchange-newline"></blockquote></div><br></div></div></span><br class="ecxApple-interchange-newline"></blockquote></div><br> </body>
</html>