summaryrefslogtreecommitdiff
path: root/module/system
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-02-06 17:44:51 +0100
committerLudovic Courtès <ludo@gnu.org>2022-02-07 12:23:35 +0100
commit2aed3c117c2d667ecca1e38a016f2cb4b524ab50 (patch)
tree0d798584dfa5e6bca9b9e8ce675369cbe90989b1 /module/system
parent032acdeac9dfe6b407a1fcbd9f00c3e1a0dd27aa (diff)
downloadguile-2aed3c117c2d667ecca1e38a016f2cb4b524ab50.tar.gz
psyntax: Pass source vectors to tree-il constructors.
Avoiding systematic conversion from source vectors to property alists saves 20% on the final heap size of a process doing: (compile-file FILE #:optimization-level 1) where FILE is large. * module/language/tree-il.scm (tree-il-src/ensure-alist): New procedure with setter. Export as 'tree-il-src'. * module/ice-9/psyntax.scm (build-void, build-call) (build-conditional, build-lexical-reference, build-lexical-assignment) (build-global-reference, build-global-assignment) (build-global-definition, build-simple-lambda, build-case-lambda) (build-lambda-case, build-primcall, build-primref) (build-data, build-sequence, build-let, build-named-let) (build-letrec, expand-body): Remove (sourcev->alist src) calls. * module/ice-9/psyntax-pp.scm: Regenerate. * module/language/tree-il/analyze.scm (shadowed-toplevel-analysis): Use 'tree-il-src' instead of accessing the 'src' slot directly. * module/system/vm/assembler.scm (link-debug): Adjust so PC can be followed by a vector or an alist.
Diffstat (limited to 'module/system')
-rw-r--r--module/system/vm/assembler.scm14
1 files changed, 10 insertions, 4 deletions
diff --git a/module/system/vm/assembler.scm b/module/system/vm/assembler.scm
index be1b79e34..77ffb5aa1 100644
--- a/module/system/vm/assembler.scm
+++ b/module/system/vm/assembler.scm
@@ -2821,10 +2821,16 @@ procedure with label @var{rw-init}. @var{rw-init} may be false. If
(let lp ((sources (asm-sources asm)) (out '()))
(match sources
- (((pc . s) . sources)
- (let ((file (assq-ref s 'filename))
- (line (assq-ref s 'line))
- (col (assq-ref s 'column)))
+ (((pc . location) . sources)
+ (let-values (((file line col)
+ ;; Usually CPS records contain a "source
+ ;; vector" coming from tree-il, but some might
+ ;; contain a source property alist.
+ (match location
+ (#(file line col) (values file line col))
+ (lst (values (assq-ref lst 'filename)
+ (assq-ref lst 'line)
+ (assq-ref lst 'column))))))
(lp sources
;; Guile line and column numbers are 0-indexed, but
;; they are 1-indexed for DWARF.