add compile-omit-concatenate-support

Perform slightly less work on every fasl or unfasl of compiled code
that does not need to support `concatenate-object-files`.

original commit: 410985b062a3e2a4cc48da583167254d4adad2d2
This commit is contained in:
Matthew Flatt 2020-07-12 19:17:31 -06:00
parent fd3b903c1c
commit 9e1c89b575
4 changed files with 21 additions and 2 deletions

View File

@ -2404,6 +2404,18 @@ referenced libraries are known to be present and already invoked, and
only when it's worth saving the small overhead of representing and
running the check.
%----------------------------------------------------------------------------
\entryheader
\formdef{compile-omit-concatenate-support}{\categorythreadparameter}{compile-omit-concatenate-support}
\listlibraries
\endentryheader
\noindent
This boolean-valued parameter determines whether code compiled to a
file or port includes information needed to support
\scheme{concatenate-object-files}. Omitting the information can
provide minor space and load-time savings for small compiled objects.
\section{Source Directories and Files\label{SECTSYSTEMSOURCE}}

View File

@ -214,6 +214,9 @@
[(maximum) (constant COMPRESS-MAX)]
[else ($oops who "~s is not a supported level" x)]))]))
(define-who compile-omit-concatenate-support
($make-thread-parameter #f (lambda (x) (and x #t))))
(define-who debug-level
($make-thread-parameter
1

View File

@ -780,8 +780,11 @@
[(revisit-stuff) x (c-print-fasl x op (constant fasl-type-revisit))]
[else (c-print-fasl x op (constant fasl-type-visit-revisit))]))
final*))
; inserting #t after lpinfo as an end-of-header marker
(append lpinfo** (cons (list `(object #t)) final**)))))))))
(append lpinfo**
(if (compile-omit-concatenate-support)
final**
;; inserting #t after lpinfo as an end-of-header marker
(cons (list `(object #t)) final**))))))))))
(define (new-extension new-ext fn)
(let ([old-ext (path-extension fn)])

View File

@ -1230,6 +1230,7 @@
(compile [sig [(sub-ptr) (sub-ptr environment) -> (ptr ...)]] [flags])
(compile-file [sig [(pathname) (pathname pathname) (pathname pathname sub-symbol) -> (void)]] [flags true])
(compile-library [sig [(pathname) (pathname pathname) (pathname pathname sub-symbol) -> (void)]] [flags true])
(compile-omit-concatenate-support [sig [() -> (boolean)] [(ptr) -> (void)]] [flags unrestricted])
(compile-port [sig [(textual-input-port binary-output-port) (textual-input-port binary-output-port maybe-sfd) (textual-input-port binary-output-port maybe-sfd maybe-binary-output-port) (textual-input-port binary-output-port maybe-sfd maybe-binary-output-port maybe-textual-output-port) (textual-input-port binary-output-port maybe-sfd maybe-binary-output-port maybe-textual-output-port sub-symbol) (textual-input-port binary-output-port maybe-sfd maybe-binary-output-port maybe-textual-output-port sub-symbol maybe-binary-output-port) -> (void)]] [flags true])
(compile-program [sig [(pathname) (pathname pathname) (pathname pathname sub-symbol) -> (list)]] [flags true])
(compile-script [sig [(pathname) (pathname pathname) (pathname pathname sub-symbol) -> (void)]] [flags true])