diff --git a/pkgs/compiler-lib/compiler/demodularizer/main.rkt b/pkgs/compiler-lib/compiler/demodularizer/main.rkt index 36e8a140fb..b6fc0989a9 100644 --- a/pkgs/compiler-lib/compiler/demodularizer/main.rkt +++ b/pkgs/compiler-lib/compiler/demodularizer/main.rkt @@ -35,7 +35,7 @@ (path-add-suffix file-to-batch #"_merged.zo"))) ;; Transformations - (define path-cache (make-hash)) + (define path-cache (make-hasheq)) (log-info "Removing dependencies") (define-values (batch-nodep top-lang-info top-self-modidx get-modvar-rewrite) @@ -74,4 +74,4 @@ merged-zo-path (lambda () (zo-marshal-to batch-mod (current-output-port))) - #:exists 'replace)))) \ No newline at end of file + #:exists 'replace)))) diff --git a/pkgs/compiler-lib/compiler/demodularizer/merge.rkt b/pkgs/compiler-lib/compiler/demodularizer/merge.rkt index c90cdc1c1f..04de2e30a9 100644 --- a/pkgs/compiler-lib/compiler/demodularizer/merge.rkt +++ b/pkgs/compiler-lib/compiler/demodularizer/merge.rkt @@ -68,13 +68,18 @@ [(struct module-variable (modidx sym pos phase constantness)) (match rw [(struct modvar-rewrite (self-modidx provide->toplevel)) - (log-debug (format "Rewriting ~a of ~S" pos (mpi->path* modidx))) + (log-debug (format "Rewriting ~a@~a of ~S" sym pos (mpi->path* modidx))) + (define tl (provide->toplevel sym pos)) + (log-debug (format "Rewriting ~a@~a of ~S to ~S" sym pos (mpi->path* modidx) tl)) (match-define (toplevel-offset-rewriter rewrite-fun meta) (hash-ref MODULE-TOPLEVEL-OFFSETS self-modidx (lambda () (error 'compute-new-modvar "toplevel offset not yet computed: ~S" self-modidx)))) - (log-debug (format "Rewriting ~a of ~S from ~S" pos (mpi->path* modidx) meta)) - (rewrite-fun (provide->toplevel sym pos))])])) + (log-debug (format "Rewriting ~a@~a of ~S (which is ~a) with ~S" sym pos (mpi->path* modidx) tl meta)) + (define res (rewrite-fun tl)) + (log-debug (format "Rewriting ~a@~a of ~S (which is ~a) with ~S and got ~S" + sym pos (mpi->path* modidx) tl meta res)) + res])])) (define (filter-rewritable-module-variable? toplevel-offset mod-toplevels) (define-values @@ -86,7 +91,7 @@ (match tl [(and mv (struct module-variable (modidx sym pos phase constantness))) (define rw ((current-get-modvar-rewrite) modidx)) - ; XXX We probably don't need to deal with #f phase + ;; XXX We probably don't need to deal with #f phase (unless (or (not phase) (zero? phase)) (error 'eliminate-module-variables "Non-zero phases not supported: ~S" mv)) (cond diff --git a/pkgs/compiler-lib/compiler/demodularizer/nodep.rkt b/pkgs/compiler-lib/compiler/demodularizer/nodep.rkt index 75e1a4eecb..019584d076 100644 --- a/pkgs/compiler-lib/compiler/demodularizer/nodep.rkt +++ b/pkgs/compiler-lib/compiler/demodularizer/nodep.rkt @@ -124,13 +124,14 @@ (define (construct-provide->toplevel prefix provides) (define provide-ht (make-hasheq)) (for ([tl (prefix-toplevels prefix)] - [i (in-naturals)]) + [i (in-naturals)]) (when (symbol? tl) (hash-set! provide-ht (intern tl) i))) (lambda (sym pos) - (log-debug (format "Looking up ~S@~a in ~S" sym pos prefix)) + (define isym (intern sym)) + (log-debug (format "Looking up ~S@~a [~S] in ~S" sym pos isym prefix)) (define res - (hash-ref provide-ht (intern sym) + (hash-ref provide-ht isym (lambda () (error 'provide->toplevel "Cannot find ~S in ~S" sym prefix)))) (log-debug (format "Looked up ~S@~a and got ~v" sym pos res)) @@ -142,14 +143,15 @@ unexported max-let-depth dummy lang-info internal-context flags pre-submodules post-submodules)) (define new-prefix prefix) - ; Cache all the mpi paths + ;; Cache all the mpi paths (for-each (match-lambda [(and mv (struct module-variable (modidx sym pos phase constantness))) (mpi->path! modidx)] [tl (void)]) (prefix-toplevels new-prefix)) - (log-debug (format "[~S] module-variables: ~S" name (length (filter module-variable? (prefix-toplevels new-prefix))))) + (define mvs (filter module-variable? (prefix-toplevels new-prefix))) + (log-debug (format "[~S] module-variables: ~S - ~S" name (length mvs) mvs)) (values (make-modvar-rewrite self-modidx (construct-provide->toplevel new-prefix provides)) lang-info (append (requires->modlist requires phase) diff --git a/pkgs/racket-pkgs/racket-test/tests/racket/benchmarks/shootout/nothing.rkt b/pkgs/racket-pkgs/racket-test/tests/racket/benchmarks/shootout/nothing.rkt deleted file mode 100644 index e5a3b58314..0000000000 --- a/pkgs/racket-pkgs/racket-test/tests/racket/benchmarks/shootout/nothing.rkt +++ /dev/null @@ -1,2 +0,0 @@ -#lang racket/base -1