[M3commit] CVS Update: cm3

Jay Krell jkrell at elego.de
Sat Sep 22 02:20:38 CEST 2012


CVSROOT:	/usr/cvs
Changes by:	jkrell at birch.	12/09/22 02:20:37

Modified files:
	cm3/m3-sys/m3middle/src/: M3CG_MultiPass.i3 M3CG_MultiPass.m3 

Log message:
	significant work in progress on data structures
	useful to backends -- storing up all the m3cg
	in memory, to be looped over/played back, in order
	to get it into the order needed
	
	This is a LOT of tedious work.
	It was SO much easier to do in m3cc via the preprocessor.
	A macro processor can be incredibly useful. Really.
	
	Three or so modes are allowed for (which does increase the tedium).
	One can loop over the array of refs and use ISTYPE/NARROW/LOOPHOLE.
	ISTYPE/NARROW would be unnecessarily slow, LOOPHOLE would be fast
	One can loop pver and switch on a type tag (not all filled in).
	One can pass in a M3CG and the data will all be passed to
	its appropriate functions (work in progress).
	And then pass in a different M3CG, that shares state with the first.
	Like, "mini" M3CGs that do nothing (inherit from M3CG_DoNothing)
	but pay attention to only a few functions, like e.g. to accumulate
	a list of all struct sizes.
	
	I will probably use that last option.
	
	This will give us the power to fix several things:
	- support arbitrary struct sizes as parameters
	- pass and esp. return structs by value letting the C compiler do the work,
	as well as being ABI compliant (what we haven't isn't a violation per se,
	for our code, as you can write your C this way; it is a violation for <*extern*> though.)
	- only declare/implement static helper functions that we use
	- support uplevel locals in nested blocks -- to enable building the whole system!
	- forward declare all imports ahead of all functions, and therefore
	- just once
	- honor begin/end_block; stop tacking numbers onto identifiers
	- maybe honor free_temp
	- generate valid C++ for the module globals (w/o an extra indirection)
	- possibly use real structs and infer real field accesses
	- maybe more (there is more to improve, not sure if this stuff
	needed for it; e.g. move globals out of the "segment" would be nice
	remove obviously unused functions; fix shifts by greater than size
	(requires symbolic expressions instead of strings)
	- much better stock debugging! (due to the structs)
	`




More information about the M3commit mailing list