summaryrefslogtreecommitdiff
path: root/module/ice-9/boot-9.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2021-03-23 21:11:44 +0100
committerAndy Wingo <wingo@pobox.com>2021-05-11 21:39:07 +0200
commitcbfad75fa6caee89793090efa1a81e2b3a2bfe11 (patch)
tree23e8b01d268477f02783242ce9f91a153e25393e /module/ice-9/boot-9.scm
parenta892791b43a68a80f2caeab49b123bc828324969 (diff)
downloadguile-cbfad75fa6caee89793090efa1a81e2b3a2bfe11.tar.gz
Add support for recording inlinable module exports
* module/language/tree-il/inlinable-exports.scm: New module. * am/bootstrap.am: * module/Makefile.am: * module/language/tree-il/optimize.scm (make-optimizer): * module/system/base/optimize.scm (available-optimizations): Wire up new module. * module/ice-9/boot-9.scm (module): Add inlinable-exports field. (define-module*): Add #:inlinable-exports kwarg.
Diffstat (limited to 'module/ice-9/boot-9.scm')
-rw-r--r--module/ice-9/boot-9.scm16
1 files changed, 12 insertions, 4 deletions
diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index 944061707..2323b1ec5 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -2513,7 +2513,8 @@ name extensions listed in %load-extensions."
public-interface
filename
next-unique-id
- (replacements #:no-setter))))
+ (replacements #:no-setter)
+ inlinable-exports)))
;; make-module &opt size uses binder
@@ -2539,7 +2540,7 @@ initial uses list, or binding procedure."
'()
(make-weak-key-hash-table) #f
(make-hash-table) #f #f #f 0
- (make-hash-table)))
+ (make-hash-table) #f))
@@ -3380,7 +3381,8 @@ error if selected binding does not exist in the used module."
(define* (define-module* name
#:key filename pure version (imports '()) (exports '())
(replacements '()) (re-exports '()) (re-export-replacements '())
- (autoloads '()) (duplicates #f) transformer declarative?)
+ (autoloads '()) (duplicates #f) transformer declarative?
+ inlinable-exports)
(define (list-of pred l)
(or (null? l)
(and (pair? l) (pred (car l)) (list-of pred (cdr l)))))
@@ -3446,6 +3448,12 @@ error if selected binding does not exist in the used module."
(sym (car (last-pair transformer))))
(set-module-transformer! module (module-ref iface sym))))
+ (when inlinable-exports
+ (unless (procedure? inlinable-exports)
+ (error "expected inlinable-exports to be a procedure" inlinable-exports))
+ (set-module-inlinable-exports! (module-public-interface module)
+ inlinable-exports))
+
(run-hook module-defined-hook module)
module))
@@ -3481,7 +3489,7 @@ error if selected binding does not exist in the used module."
#:warning "Failed to autoload ~a in ~a:\n" sym name))))
(module-constructor (make-hash-table 0) '() b #f #f name 'autoload #f
(make-hash-table 0) '() (make-weak-value-hash-table) #f
- (make-hash-table 0) #f #f #f 0 (make-hash-table 0))))
+ (make-hash-table 0) #f #f #f 0 (make-hash-table 0) #f)))
(define (module-autoload! module . args)
"Have @var{module} automatically load the module named @var{name} when one