~ chicken-core (chicken-5) f674d1310a9aa780bd1edc9316e092c062572dde
commit f674d1310a9aa780bd1edc9316e092c062572dde
Author: Felix <bunny351@gmail.com>
AuthorDate: Sun Oct 25 13:05:07 2009 +0100
Commit: Felix <bunny351@gmail.com>
CommitDate: Sun Oct 25 13:05:07 2009 +0100
-debug C for compiler syntax
diff --git a/TODO b/TODO
index ca07e02b..df959929 100644
--- a/TODO
+++ b/TODO
@@ -254,6 +254,7 @@ Date: Sun Oct 11 11:37:06 2009 +0200
*** what MacScheme called "benchmark-mode" (assume self-calls are recursion)
*** needs declaration or option, >= -O2
*** can be implemented like in the extended-llists opt. above
+*** this should actually already work in local mode (toplevel defs are known, after all)
** compiler-support for get-keyword ?
*** what when a function with keyword args gets inlined?
@@ -271,3 +272,17 @@ Date: Sun Oct 11 11:37:06 2009 +0200
** The benchmarks are meaningless - find real ones.
*** check Feeley's benchmarks (slatex, compiler)
+
+** speculative inlining
+
+(define-compiler-syntax + ; "mostly-fixnum-flonum" case
+ (syntax-rules ()
+ ((_ x y)
+ (let ((t1 x)
+ (t2 y))
+ (if (and (fixnum? t1) (fixnum? t2))
+ (or (##core#inline "C_i_o_fixnum_plus" t1 t2)
+ (##core#inline_allocate ("C_a_i_plus" 4) t1 t2) )
+ (if (and (flonum? t1) (flonum? t2))
+ (##core#inline_allocate ("C_a_i_flonum_plus" 4) t1 t2)
+ (##core#inline_allocate ("C_a_i_plus" 4) t1 t2) ) ) ) ) ) )
diff --git a/batch-driver.scm b/batch-driver.scm
index 8dbe388c..f4f65010 100644
--- a/batch-driver.scm
+++ b/batch-driver.scm
@@ -449,7 +449,7 @@
'((##core#undefined))) ] )
(when (and (pair? compiler-syntax-statistics)
- (debugging 'o "applied compiler syntax:"))
+ (debugging 'C "applied compiler syntax:"))
(for-each
(lambda (cs) (printf " ~a\t\t~a~%" (car cs) (cdr cs)))
compiler-syntax-statistics))
diff --git a/manual/Using the compiler b/manual/Using the compiler
index 7a751e2f..a40536db 100644
--- a/manual/Using the compiler
+++ b/manual/Using the compiler
@@ -41,6 +41,7 @@ Possible options are:
t show time needed for compilation
b show breakdown of time needed for each compiler pass
o show performed optimizations
+ C show applications of compiler syntax
r show invocation parameters
s show program-size information and other statistics
a show node-matching during simplification
Trap