mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-14 23:50:19 +02:00
add <primcall> to tree-il
* libguile/expand.c: * libguile/expand.h (SCM_EXPANDED_PRIMCALL_TYPE_NAME): (SCM_EXPANDED_PRIMCALL_FIELD_NAMES): (SCM_EXPANDED_PRIMCALL_SRC): (SCM_EXPANDED_PRIMCALL_NAME): (SCM_EXPANDED_PRIMCALL_ARGS): (SCM_MAKE_EXPANDED_PRIMCALL): Add "primcall" Tree-IL type. * doc/ref/compiler.texi (Tree-IL): Update docs. * libguile/memoize.c (memoize): Memoizer for primcalls. * module/ice-9/psyntax.scm: Build primcalls, sometimes. Also change build-primref to just make a primitive-ref. * module/language/tree-il.scm: Add primcall to the exports, parsers, serializers, etc. * module/language/tree-il/analyze.scm: * module/language/tree-il/compile-glil.scm: * module/language/tree-il/fix-letrec.scm: * module/language/tree-il/inline.scm: * module/language/tree-il/primitives.scm: * module/language/elisp/compile-tree-il.scm: Add primcall support. * test-suite/tests/tree-il.test: Use primcalls sometimes.
This commit is contained in:
parent
7081d4f981
commit
a881a4ae3b
14 changed files with 7186 additions and 7090 deletions
|
@ -109,7 +109,7 @@
|
|||
;;; Build a call to a primitive procedure nicely.
|
||||
|
||||
(define (call-primitive loc sym . args)
|
||||
(make-call loc (make-primitive-ref loc sym) args))
|
||||
(make-primcall loc sym args))
|
||||
|
||||
;;; Error reporting routine for syntax/compilation problems or build
|
||||
;;; code for a runtime-error output.
|
||||
|
@ -118,9 +118,8 @@
|
|||
(apply error args))
|
||||
|
||||
(define (runtime-error loc msg . args)
|
||||
(make-call loc
|
||||
(make-primitive-ref loc 'error)
|
||||
(cons (make-const loc msg) args)))
|
||||
(make-primcall loc 'error
|
||||
(cons (make-const loc msg) args)))
|
||||
|
||||
;;; Generate code to ensure a global symbol is there for further use of
|
||||
;;; a given symbol. In general during the compilation, those needed are
|
||||
|
@ -151,12 +150,11 @@
|
|||
(call-primitive
|
||||
loc
|
||||
'with-fluids*
|
||||
(make-call loc
|
||||
(make-primitive-ref loc 'list)
|
||||
(map (lambda (sym)
|
||||
(make-module-ref loc module sym #t))
|
||||
syms))
|
||||
(make-call loc (make-primitive-ref loc 'list) vals)
|
||||
(make-primcall loc 'list
|
||||
(map (lambda (sym)
|
||||
(make-module-ref loc module sym #t))
|
||||
syms))
|
||||
(make-primcall loc 'list vals)
|
||||
(make-lambda loc
|
||||
'()
|
||||
(make-lambda-case #f '() #f #f #f '() '() body #f))))
|
||||
|
@ -828,11 +826,9 @@
|
|||
loc
|
||||
name
|
||||
function-slot
|
||||
(make-call
|
||||
loc
|
||||
(make-module-ref loc '(guile) 'cons #t)
|
||||
(list (make-const loc 'macro)
|
||||
(compile-lambda loc args body))))
|
||||
(make-primcall loc 'cons
|
||||
(list (make-const loc 'macro)
|
||||
(compile-lambda loc args body))))
|
||||
(make-const loc name)))))
|
||||
(compile (ensuring-globals loc bindings-data tree-il)
|
||||
#:from 'tree-il
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue