[M3devel] Target.Aligned_procedures (again)

Jay K jay.krell at cornell.edu
Tue Sep 15 10:44:31 CEST 2015


How about this:
To check for a closure: 1 Clear the lower bit of the address. Or maybe the lower 2 bits. 2 Check for a 4 byte -1. Not necessarily a full INTEGER.

Marker always consumes an INTEGER's worth of space, but only ever check 4 bytes.Clearing the lower bit is strictly to accommodate Thumb -- does it take alignment faults?The conditional branch in the current code, at least for 64bit non-amd64 platforms would be gone.All targets would be the same.

Clearing the lower two bits would make the address always aligned.The assumption is that if is a closure, it is already aligned and this is value preserving.If it is not a closure, this still yields a valid accessible address, just not the one to call.

Or too risky in terms of portability? Better to check for alignment, assume unaligned is not a closure, and just check for a full INTEGER -1?

Thank you, - Jay
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20150915/1f23d185/attachment-0001.html>


More information about the M3devel mailing list