@@ -15,16 +15,18 @@ UP_ARROW = "\e[A"
15
15
DOWN_ARROW = " \e [B"
16
16
17
17
hardcoded_precompile_statements = """
18
- @assert precompile(Tuple{typeof(Base.stale_cachefile), String, String})
19
- @assert precompile(Tuple{typeof(push!), Set{Module}, Module})
20
- @assert precompile(Tuple{typeof(push!), Set{Method}, Method})
21
- @assert precompile(Tuple{typeof(push!), Set{Base.PkgId}, Base.PkgId})
22
- @assert precompile(Tuple{typeof(getindex), Dict{Base.PkgId,String}, Base.PkgId})
23
- @assert precompile(Tuple{typeof(setindex!), Dict{String,Base.PkgId}, Base.PkgId, String})
18
+ # used by Revise.jl
19
+ @assert precompile(Tuple{typeof(Base.parse_cache_header), String})
20
+ @assert precompile(Tuple{typeof(pushfirst!), Vector{Any}, Function})
21
+ # used by Requires.jl
24
22
@assert precompile(Tuple{typeof(get!), Type{Vector{Function}}, Dict{Base.PkgId,Vector{Function}}, Base.PkgId})
23
+ @assert precompile(Tuple{typeof(haskey), Dict{Base.PkgId,Vector{Function}}, Base.PkgId})
24
+ @assert precompile(Tuple{typeof(delete!), Dict{Base.PkgId,Vector{Function}}, Base.PkgId})
25
+ @assert precompile(Tuple{typeof(push!), Vector{Function}, Function})
26
+ # miscellaneous
27
+ @assert precompile(Tuple{typeof(Base.require), Base.PkgId})
25
28
@assert precompile(Tuple{typeof(isassigned), Core.SimpleVector, Int})
26
- @assert precompile(Tuple{typeof(pushfirst!), Vector{Any}, Function})
27
- @assert precompile(Tuple{typeof(Base.parse_cache_header), String})
29
+ @assert precompile(Tuple{typeof(Base.Experimental.register_error_hint), Any, Type})
28
30
"""
29
31
30
32
precompile_script = """
@@ -43,6 +45,13 @@ f(x) = x03
43
45
f(1,2)
44
46
[][1]
45
47
cd("complet_path\t\t $CTRL_C
48
+ # Used by JuliaInterpreter
49
+ push!(Set{Module}(), Main)
50
+ push!(Set{Method}(), first(methods(collect)))
51
+ # Used by Revise
52
+ (setindex!(Dict{String,Base.PkgId}(), Base.PkgId(Base), "file.jl"))["file.jl"]
53
+ (setindex!(Dict{Base.PkgId,String}(), "file.jl", Base.PkgId(Base)))[Base.PkgId(Base)]
54
+ get(Base.pkgorigins, Base.PkgId(Base), nothing)
46
55
"""
47
56
48
57
julia_exepath () = joinpath (Sys. BINDIR, Base. julia_exename ())
@@ -100,6 +109,15 @@ if FileWatching !== nothing
100
109
"""
101
110
end
102
111
112
+ Libdl = get (Base. loaded_modules,
113
+ Base. PkgId (Base. UUID (" 8f399da3-3557-5675-b5ff-fb832c97cbdb" ), " Libdl" ),
114
+ nothing )
115
+ if Libdl != = nothing
116
+ hardcoded_precompile_statements *= """
117
+ precompile(Tuple{typeof(Libc.Libdl.dlopen), String})
118
+ """
119
+ end
120
+
103
121
function generate_precompile_statements ()
104
122
start_time = time_ns ()
105
123
debug_output = devnull # or stdout
0 commit comments