[M3devel] factoring jmpbuf size via alloca(global constant)?

Jay K jay.krell at cornell.edu
Fri Dec 31 08:11:24 CET 2010


The more I think about this, the more I like it.

However there might be a better option.
Gcc has some notion of built-in setjmp.
For that matter, maybe using the gcc exception handling mechanism isn't difficult?


 - Jay

From: jay.krell at cornell.edu
To: m3devel at elegosoft.com
Subject: factoring jmpbuf size via alloca(global constant)?
Date: Thu, 30 Dec 2010 14:28:31 +0000








factoring out jmpbuf size?


Hey, um, how about something like this:


somefile.c:
 #include <setjmp.h>
 extern const int sizeof_jmpbuf = sizeof(jmp_buf);
 

where the frontend would allocate a local jmp_buf,
instead issue a call to alloca(sizeof_jmpbuf),
actually reading the constant out of the global.


Yes I know this is a deoptimization.
It is already slow.
We hope hope hope to replace it all anyway.


This would remove lots of target-specific code in Target.m3.


Related, I'm again trying removing from m3core the knowledge
of the size/alignment of jmpbuf. Or rather, to see if it really
needs it.


 - Jay

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20101231/6dad9cfb/attachment-0002.html>


More information about the M3devel mailing list