expander: fix tracking of MPIs for cross-submodule inlining
This commit is contained in:
parent
40219b88f3
commit
55a27e01a6
|
@ -2262,6 +2262,29 @@ case of module-leve bindings; it doesn't cover local bindings.
|
||||||
(require 'check-shadowing-in-other-phase-b)
|
(require 'check-shadowing-in-other-phase-b)
|
||||||
b)
|
b)
|
||||||
|
|
||||||
|
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; Make sure that cross-module inlinign doesn't
|
||||||
|
;; lose track of shifts for module path indices
|
||||||
|
|
||||||
|
(module likely-inlines-across-two-submodules racket/base
|
||||||
|
(provide result)
|
||||||
|
|
||||||
|
(module a racket/base
|
||||||
|
(provide get-x)
|
||||||
|
(define x 5)
|
||||||
|
(set! x x)
|
||||||
|
(define (get-x) x))
|
||||||
|
|
||||||
|
(module b racket/base
|
||||||
|
(require (submod ".." a))
|
||||||
|
(provide get-x2)
|
||||||
|
(define (get-x2) (get-x)))
|
||||||
|
|
||||||
|
(require 'b)
|
||||||
|
(define result (get-x2)))
|
||||||
|
|
||||||
|
(test 5 dynamic-require ''likely-inlines-across-two-submodules 'result)
|
||||||
|
|
||||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(report-errs)
|
(report-errs)
|
||||||
|
|
|
@ -404,7 +404,7 @@
|
||||||
(values phase
|
(values phase
|
||||||
(module-linklet-info linklet
|
(module-linklet-info linklet
|
||||||
(hash-ref phase-to-link-module-uses phase #f)
|
(hash-ref phase-to-link-module-uses phase #f)
|
||||||
self
|
(compiled-in-memory-original-self cim)
|
||||||
#f ; inspector is the same as the module being compiled
|
#f ; inspector is the same as the module being compiled
|
||||||
(compiled-in-memory-compile-time-inspector cim)
|
(compiled-in-memory-compile-time-inspector cim)
|
||||||
(and phase-to-extra-inspectorsss
|
(and phase-to-extra-inspectorsss
|
||||||
|
|
|
@ -172,13 +172,13 @@
|
||||||
(define module-uses (hash-ref phase-to-link-modules phase-level))
|
(define module-uses (hash-ref phase-to-link-modules phase-level))
|
||||||
(define-values (import-module-instances import-instances)
|
(define-values (import-module-instances import-instances)
|
||||||
(for/lists (mis is) ([mu (in-list module-uses)])
|
(for/lists (mis is) ([mu (in-list module-uses)])
|
||||||
(namespace-module-use->module+linklet-instances
|
(namespace-module-use->module+linklet-instances
|
||||||
ns mu
|
ns mu
|
||||||
#:shift-from original-self
|
#:shift-from original-self
|
||||||
#:shift-to self
|
#:shift-to self
|
||||||
#:phase-shift
|
#:phase-shift
|
||||||
(phase+ (phase- phase-level (module-use-phase mu))
|
(phase+ (phase- phase-level (module-use-phase mu))
|
||||||
phase-shift))))
|
phase-shift))))
|
||||||
|
|
||||||
(check-require-access phase-linklet #:skip-imports 2
|
(check-require-access phase-linklet #:skip-imports 2
|
||||||
module-uses import-module-instances insp
|
module-uses import-module-instances insp
|
||||||
|
|
|
@ -522,7 +522,7 @@
|
||||||
(cond
|
(cond
|
||||||
[(not (expand-context-to-parsed? init-ctx))
|
[(not (expand-context-to-parsed? init-ctx))
|
||||||
;; Shift the "self" reference that we have been using for expansion
|
;; Shift the "self" reference that we have been using for expansion
|
||||||
;; to a generic and constant (for a particualr submodule path)
|
;; to a generic and constant (for a particular submodule path)
|
||||||
;; "self", so that we can reocognize it for compilation or to shift
|
;; "self", so that we can reocognize it for compilation or to shift
|
||||||
;; back on any future re-expansion:
|
;; back on any future re-expansion:
|
||||||
(define generic-self (make-generic-self-module-path-index self))
|
(define generic-self (make-generic-self-module-path-index self))
|
||||||
|
|
|
@ -35670,7 +35670,8 @@ static const char *startup_source =
|
||||||
" phase-to-link-module-uses_5"
|
" phase-to-link-module-uses_5"
|
||||||
" phase_93"
|
" phase_93"
|
||||||
" #f)"
|
" #f)"
|
||||||
" self_25"
|
"(compiled-in-memory-original-self"
|
||||||
|
" cim_10)"
|
||||||
" #f"
|
" #f"
|
||||||
"(compiled-in-memory-compile-time-inspector"
|
"(compiled-in-memory-compile-time-inspector"
|
||||||
" cim_10)"
|
" cim_10)"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user