<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'>On the last point -- I'm willing to generate C++ instead of C. Does that help?<div>I think it probably does.</div><div><br><div><br></div><div>On Win32 I could still generate C. And, not important, but Ultrix, OSF/1, and OpenVMS I</div><div>think all support what Win32 support -- not a coincidence..</div><div><br></div><div><br></div><div>One thing I'm missing is I don't know really know how exceptions are lowered currently.</div><div>Like, what does the runtime data look like for the "filtering".</div><div>I should know better..</div><div><br></div><div><br></div><div>I think we can also essentially claim all targets have a stack walker.</div><div>One way or another -- libunwind, NT RtlUnwindEx, etc.</div><div><br></div><div><br></div><div> - Jay<br><br><br><br><div><hr id="stopSpelling">Subject: Re: [M3devel] higher level M3CG modeling of jmpbuf/setjmp/longjmp or exception handling?<br>From: hosking@purdue.edu<br>Date: Thu, 30 Jul 2015 14:04:14 +1000<br>CC: m3devel@elegosoft.com<br>To: jay.krell@cornell.edu<br><br>I agree that lifting the abstraction level for exceptions in the front-end would be a good idea.<div>It would allow us to more effectively make use of specialized target exception handling, e.g., from LLVM.</div><div>That suggests we at least lift to the LLVM level of abstraction, but I don’t know how easy that will be to generate from for the C backend.</div><div><br></div><div><div><div><blockquote><div>On Jul 30, 2015, at 10:38 AM, Jay K <<a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a>> wrote:</div><br class="ecxApple-interchange-newline"><div><div dir="ltr" style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><div>I don't have one precise proposal, but somehow,</div><div>jmpbuf/setjmp/longjmp should be represented in a higher level in m3cg</div><div>or maybe "even higher level", exception handling.</div><div><br></div><div><br></div><div>There are multiple optimization opportunties and multiple</div><div>opportunities to move/remove target-dependent code.</div><div><br></div><div><br></div><div><br></div><div>In particular m3middle/m3front should not know jmpbuf size.</div><div>Generated C should not have jmpbuf sizes embedded in it.</div><div><br></div><div><br></div><div>gcc has a "builtin" jmpbuf/setjmp/longjmp notion, for use by exception</div><div>handling, that llvm replicates, that is optimized, like to not</div><div>save/restore unused registers.</div><div><br></div><div><br></div><div>Or, yes, there is my alloca proposal, which doesn't solve as much, but does help.</div><div><br></div><div><br></div><div>In particular, the C backend just wants to know something is a "jmpbuf"</div><div>so it can #include <setjmp.h> in the generated code and produce a</div><div>jmpbuf instead of an array of bytes and call setjmp/longjmp or _setjmp/_longjmp.</div><div><br></div><div><br></div><div>Or even better, a C++ backend wants to somehow module Modula-3 exceptions</div><div>as C++ exceptions.</div><div><br></div><div><br></div><div>Or, possibly, the Win32 C backend could model Modula-3 exceptions using</div><div>"structured exception handling" -- advantage over C++ exceptions is portability</div><div>to kernel mode.</div><div><br></div><div><br></div><div>Thoughts?</div><div> - Jay</div><br><br></div><span style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline !important;">_______________________________________________</span><br style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><span style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline !important;">M3devel mailing list</span><br style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><a href="mailto:M3devel@elegosoft.com" style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;">M3devel@elegosoft.com</a><br style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><a href="https://mail.elegosoft.com/cgi-bin/mailman/listinfo/m3devel" style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;" target="_blank">https://mail.elegosoft.com/cgi-bin/mailman/listinfo/m3devel</a></div></blockquote></div><br></div></div></div></div></div> </div></body>
</html>