[cffi-devel] more compiler macro optimizations
Hoehle, Joerg-Cyril
Joerg-Cyril.Hoehle at t-systems.com
Fri Dec 23 14:12:19 UTC 2005
Hi,
here are more patches:
- (too) few tests to verify left-to-right evaluation (side-effects)
I remember UFFI/Corman once had a bug in this area.
- with-foreign-object always inlines constant types
- clisp %mem-set (thanks for all the patch) optimizer
Now disassembly of some of the foreign-value tests look great: CFFI is almost completely compiled away!
Still there's more work to do w.r.t. optimizations, but I'll talk about that next year (struct access, strings ...).
NB You may wish not to apply the second %mem-set patch (where I introduce ffi::write-memory-as). It appears that, as a side effect of %MEM-SET only getting called from the MEM-REF setf-expander, that all values have already been saved in local variables, thus the low-level function cannot disturb order of evaluation (all it sees is (%MEM-SET #:G1000 #:G1001 #:1002 ...)). But relying on that is not proper engineering. It's just good to know.
I didn't review compiler-macro forms in *.lisp for possibly breaking the left to right evaluation rule. Never mind a review, some tests should be added. Reviews happen once, tests remain.
Regards,
Jörg Höhle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Joerg5.patch.gz
Type: application/octet-stream
Size: 13509 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20051223/ec40939e/attachment.obj>
More information about the cffi-devel
mailing list