@@ -1518,7 +1518,7 @@ function _insert_extension_triggers(parent::PkgId, extensions::Dict{String, Any}
15181518 uuid_trigger = UUID (totaldeps[trigger]:: String )
15191519 trigger_id = PkgId (uuid_trigger, trigger)
15201520 push! (trigger_ids, trigger_id)
1521- if ! haskey (explicit_loaded_modules , trigger_id) || haskey (package_locks, trigger_id)
1521+ if ! haskey (Base . loaded_modules , trigger_id) || haskey (package_locks, trigger_id)
15221522 trigger1 = get! (Vector{ExtensionId}, EXT_DORMITORY, trigger_id)
15231523 push! (trigger1, gid)
15241524 else
@@ -2392,9 +2392,8 @@ function __require_prelocked(uuidkey::PkgId, env=nothing)
23922392 insert_extension_triggers (uuidkey)
23932393 # After successfully loading, notify downstream consumers
23942394 run_package_callbacks (uuidkey)
2395- elseif ! haskey (explicit_loaded_modules, uuidkey)
2396- explicit_loaded_modules[uuidkey] = m
2397- run_package_callbacks (uuidkey)
2395+ else
2396+ newm = root_module (uuidkey)
23982397 end
23992398 return m
24002399end
@@ -2407,7 +2406,6 @@ end
24072406PkgOrigin () = PkgOrigin (nothing , nothing , nothing )
24082407const pkgorigins = Dict {PkgId,PkgOrigin} ()
24092408
2410- const explicit_loaded_modules = Dict {PkgId,Module} () # Emptied on Julia start
24112409const loaded_modules = Dict {PkgId,Module} () # available to be explicitly loaded
24122410const loaded_precompiles = Dict {PkgId,Vector{Module}} () # extended (complete) list of modules, available to be loaded
24132411const loaded_modules_order = Vector {Module} ()
@@ -2448,7 +2446,6 @@ end
24482446 end
24492447 maybe_loaded_precompile (key, module_build_id (m)) === nothing && push! (loaded_modules_order, m)
24502448 loaded_modules[key] = m
2451- explicit_loaded_modules[key] = m
24522449 module_keys[m] = key
24532450 end
24542451 nothing
@@ -2480,9 +2477,6 @@ loaded_modules_array() = @lock require_lock copy(loaded_modules_order)
24802477# after unreference_module, a subsequent require call will try to load a new copy of it, if stale
24812478# reload(m) = (unreference_module(m); require(m))
24822479function unreference_module (key:: PkgId )
2483- if haskey (explicit_loaded_modules, key)
2484- m = pop! (explicit_loaded_modules, key)
2485- end
24862480 if haskey (loaded_modules, key)
24872481 m = pop! (loaded_modules, key)
24882482 # need to ensure all modules are GC rooted; will still be referenced
@@ -3046,7 +3040,7 @@ function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, in
30463040 # build up the list of modules that we want the precompile process to preserve
30473041 if keep_loaded_modules
30483042 concrete_deps = copy (_concrete_dependencies)
3049- for (pkgreq, modreq) in loaded_modules # TODO : convert all relevant staleness heuristics to use explicit_loaded_modules instead
3043+ for (pkgreq, modreq) in loaded_modules
30503044 if ! (pkgreq === Main || pkgreq === Core || pkgreq === Base)
30513045 push! (concrete_deps, pkgreq => module_build_id (modreq))
30523046 end
0 commit comments