<html><head><base href="x-msg://716/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">The trampoline is purely a method for constructing a closure that can be passed.  So long as we are using the same mechanism to grab the static chain we should be working similarly.  We just need to emulate the effect of the trampoline on the rest of gcc.<div><br>
<br><div><div>On Nov 19, 2010, at 11:21 AM, Jay K wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div class="hmmessage" style="font-size: 10pt; font-family: Tahoma; ">Good question. I can look into that. But notice that it will *definitely* be different. But maybe not<br>in a critical way -- they use trampolines.<br><br> - Jay<br><br><hr id="stopSpelling">From:<span class="Apple-converted-space"> </span><a href="mailto:hosking@cs.purdue.edu">hosking@cs.purdue.edu</a><br>Date: Fri, 19 Nov 2010 09:39:00 -0500<br>To:<span class="Apple-converted-space"> </span><a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a><br>CC:<span class="Apple-converted-space"> </span><a href="mailto:m3devel@elegosoft.com">m3devel@elegosoft.com</a><br>Subject: Re: [M3devel] nested functions vs. setjmp vs. inlining<br><br>This is a shame.<div>1. gcc supports nested functions.</div><div>2. gcc supports inlining.</div><div>3. gcc should work with both nested functions and inlining.</div><div><br></div><div>If gcc can handle all of this for C but not M3 then we must be doing something wrong.</div><div>Can we see how similar code fragments behave when expressed in C?<br><br><div><div>On Nov 19, 2010, at 4:12 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; ">parse.c:<br>/* don't inline anything, to fix:<br>elego/m3msh/src/M3MiniShell.m3: In function 'M3MiniShell__ProcessParameters':<br>elego/m3msh/src/M3MiniShell.m3:608:0: error: variable '_nonlocal_var_rec.188' might be clobbered by 'longjmp' or 'vfork'<br>*/<br><br><br>I'm very welling to make an extra pass through the IR, and only turn off inlining if I see both nested functions and calls to setjmp/longjmp/fork/vfork.<br>Oh, and a use of a static link.<br>I wouldn't check for their intersection.<br>Most modules wouldn't have any nested functions. And then sometimes nested functions are only nested to limit their use.<br><br>I tried selectively disabling inlining. No luck.<br>  I might try again, but don't plan on success there.<br><br><br>OK?<br><br><br>Fixing this "properly" I'm not keen on doing right now either, as I already spent a while trying to figure out how and failed.<br>(not to mention my keenness for evading this issue entirely, such as by using C or having the frontend transform away nested functions...)<br><br><br> - Jay<br></div></span></blockquote></div><br></div></div></span><br class="Apple-interchange-newline"></blockquote></div><br></div></body></html>