[gambit-list] Guile's new compiler

Marc Feeley feeley at iro.umontreal.ca
Fri Nov 6 08:19:06 EST 2015


% cd gsc
% ./igsc.scm 
loading "~~/gsc/_host.scm"
loading "~~/gsc/_utils.scm"
loading "~~/gsc/_source.scm"
loading "~~/gsc/_parms.scm"
loading "~~/gsc/_env.scm"
loading "~~/gsc/_ptree1.scm"
loading "~~/gsc/_ptree2.scm"
loading "~~/gsc/_gvm.scm"
loading "~~/gsc/_back.scm"
loading "~~/gsc/_front.scm"
loading "~~/gsc/_prims.scm"
loading "~~/gsc/_assert.scm"
loading "~~/gsc/_asm.scm"
loading "~~/gsc/_x86.scm"
loading "~~/gsc/_codegen.scm"
loading "~~/gsc/_t-univ.scm"
loading "~~/gsc/_t-c-1.scm"
loading "~~/gsc/_t-c-3.scm"
loading "~~/gsc/_t-c-2.scm"
loading "~~/gsc/_gsclib.scm"
loading "~~/gsc/_gsc.scm"
loading "~~/gsc/_gscdebug.scm"
Gambit v4.8.1

> (trace c#br)
> (compile-file-to-target "crap.scm")
| > (c#br '(PTREE: 10) '() 'need #f)
| (PTREE: 10)
| > (c#br '(PTREE: (pp (let ((temp.0 n) (temp.1 n)) (if (and ('#<procedure #2...
| | > (c#br '(PTREE: pp) '() 'need #f)
| | (PTREE: pp)
| | > (c#br '(PTREE: (let ((temp.0 n) (temp.1 n)) (if (and ('#<procedure #2 #...
| | | > (c#br '(PTREE: n) '((#((var-tag) temp.1 (PTREE: (lambda (temp.0 temp....
| | | (PTREE: 10)
| | | > (c#br '(PTREE: n) '((#((var-tag) temp.1 (PTREE: (lambda (temp.0 temp....
| | | (PTREE: 10)
| | | > (c#br '(PTREE: (if (and ('#<procedure #2 ##fixnum?> temp.1) ('#<proce...
| | | | > (c#br '(PTREE: (and ('#<procedure #2 ##fixnum?> temp.1) ('#<procedu...
| | | | | > (c#br '(PTREE: ('#<procedure #2 ##fixnum?> temp.1)) '((#((var-tag...
| | | | | | > (c#br '(PTREE: '#<procedure #2 ##fixnum?>) '((#((var-tag) temp....
| | | | | | (PTREE: '#<procedure #2 ##fixnum?>)
| | | | | | > (c#br '(PTREE: temp.1) '((#((var-tag) temp.1 (PTREE: (lambda (t...
| | | | | | (PTREE: 10)
| | | | | (PTREE: #t)
| | | | > (c#br '(PTREE: ('#<procedure #2 ##fixnum?> temp.0)) '((#((var-tag) ...
| | | | | > (c#br '(PTREE: '#<procedure #2 ##fixnum?>) '((#((var-tag) temp.1 ...
| | | | | (PTREE: '#<procedure #2 ##fixnum?>)
| | | | | > (c#br '(PTREE: temp.0) '((#((var-tag) temp.1 (PTREE: (lambda (tem...
| | | | | (PTREE: 10)
| | | | (PTREE: #t)
| | | > (c#br '(PTREE: (if ('#<procedure #3 ##eqv?> temp.1 0) 0 (let ((temp.2...
| | | | > (c#br '(PTREE: ('#<procedure #3 ##eqv?> temp.1 0)) '((#((var-tag) t...
| | | | | > (c#br '(PTREE: '#<procedure #3 ##eqv?>) '((#((var-tag) temp.1 (PT...
| | | | | (PTREE: '#<procedure #3 ##eqv?>)
| | | | | > (c#br '(PTREE: temp.1) '((#((var-tag) temp.1 (PTREE: (lambda (tem...
| | | | | (PTREE: 10)
| | | | | > (c#br '(PTREE: 0) '((#((var-tag) temp.1 (PTREE: (lambda (temp.0 t...
| | | | | (PTREE: 0)
| | | | (PTREE: #f)
| | | > (c#br '(PTREE: (let ((temp.2 (if ('#<procedure #3 ##eqv?> temp.1 -1) ...
| | | | > (c#br '(PTREE: (if ('#<procedure #3 ##eqv?> temp.1 -1) ('#<procedur...
| | | | | > (c#br '(PTREE: ('#<procedure #3 ##eqv?> temp.1 -1)) '((#((var-tag...
| | | | | | > (c#br '(PTREE: '#<procedure #3 ##eqv?>) '((#((var-tag) temp.1 (...
| | | | | | (PTREE: '#<procedure #3 ##eqv?>)
| | | | | | > (c#br '(PTREE: temp.1) '((#((var-tag) temp.1 (PTREE: (lambda (t...
| | | | | | (PTREE: 10)
| | | | | | > (c#br '(PTREE: -1) '((#((var-tag) temp.1 (PTREE: (lambda (temp....
| | | | | | (PTREE: -1)
| | | | | (PTREE: #f)
| | | | > (c#br '(PTREE: ('#<procedure #5 ##fx*?> temp.0 temp.1)) '((#((var-t...
| | | | | > (c#br '(PTREE: '#<procedure #5 ##fx*?>) '((#((var-tag) temp.1 (PT...
| | | | | (PTREE: '#<procedure #5 ##fx*?>)
| | | | | > (c#br '(PTREE: temp.0) '((#((var-tag) temp.1 (PTREE: (lambda (tem...
| | | | | (PTREE: 10)
| | | | | > (c#br '(PTREE: temp.1) '((#((var-tag) temp.1 (PTREE: (lambda (tem...
| | | | | (PTREE: 10)
| | | | (PTREE: 100)
| | | | > (c#br '(PTREE: (if temp.2 temp.2 ('#<procedure #6 *> temp.0 temp.1)...
| | | | | > (c#br '(PTREE: temp.2) '((#((var-tag) temp.2 (PTREE: (lambda (tem...
| | | | | (PTREE: 100)
| | | | > (c#br '(PTREE: temp.2) '((#((var-tag) temp.2 (PTREE: (lambda (temp....
| | | | (PTREE: 100)
| | | (PTREE: 100)
| | (PTREE: 100)
| (PTREE: (pp 100))
"/Users/feeley/gambit/work/gsc/crap.c"
> 

Marc

P.S. I had to fix a small problem in igsc.scm, so you’ll have to pull my last commit.

> On Nov 6, 2015, at 1:32 AM, Bradley Lucier <lucier at math.purdue.edu> wrote:
> 
> On 11/05/2015 07:29 AM, Marc Feeley wrote:
>> I haven’t looked into the details of why, but it is the transformations in gsc/_ptree2.scm that are involved in the inlining.  Perhaps you could trace the code to see where the inlining is cut short.
> 
> How do you run the compiler through the interpreter so that we can trace the routines in _ptree2.scm and see the input and output in a reasonable way?
> 
> Brad




More information about the Gambit-list mailing list