@@ -15,12 +15,11 @@ UP_ARROW = "\e[A"
15
15
DOWN_ARROW = " \e [B"
16
16
17
17
hardcoded_precompile_statements = """
18
- # used by JuliaInterpreter.jl and Revise.jl
18
+ # used by Revise.jl
19
19
@assert precompile(Tuple{typeof(Base.parse_cache_header), String})
20
- @assert precompile(Tuple{typeof(pushfirst!), Vector{Any}, Function})
21
- @assert precompile(Tuple{typeof(push!), Set{Module}, Module})
22
- @assert precompile(Tuple{typeof(push!), Set{Method}, Method})
23
- @assert precompile(Tuple{typeof(empty!), Set{Any}})
20
+ @assert precompile(Base.read_dependency_src, (String, String))
21
+ @assert precompile(Base.CoreLogging.current_logger_for_env, (Base.CoreLogging.LogLevel, String, Module))
22
+
24
23
# used by Requires.jl
25
24
@assert precompile(Tuple{typeof(get!), Type{Vector{Function}}, Dict{Base.PkgId,Vector{Function}}, Base.PkgId})
26
25
@assert precompile(Tuple{typeof(haskey), Dict{Base.PkgId,Vector{Function}}, Base.PkgId})
@@ -56,10 +55,34 @@ cd("complet_path\t\t$CTRL_C
56
55
"""
57
56
58
57
precompile_script = """
59
- # Used by Revise
58
+ # Used by Revise & its dependencies
59
+ delete!(push!(Set{Module}(), Base), Main)
60
+ m = first(methods(+))
61
+ delete!(push!(Set{Method}(), m), m)
62
+ empty!(Set())
63
+ push!(push!(Set{Union{GlobalRef,Symbol}}(), :two), GlobalRef(Base, :two))
60
64
(setindex!(Dict{String,Base.PkgId}(), Base.PkgId(Base), "file.jl"))["file.jl"]
65
+ (setindex!(Dict{Symbol,Vector{Int}}(), [1], :two))[:two]
61
66
(setindex!(Dict{Base.PkgId,String}(), "file.jl", Base.PkgId(Base)))[Base.PkgId(Base)]
67
+ (setindex!(Dict{Union{GlobalRef,Symbol}, Vector{Int}}(), [1], :two))[:two]
68
+ (setindex!(IdDict{Type, Union{Missing, Vector{Tuple{LineNumberNode, Expr}}}}(), missing, Int))[Int]
69
+ Dict{Symbol, Union{Nothing, Bool, Symbol}}(:one => false)[:one]
70
+ Dict(Base => [:(1+1)])[Base]
71
+ Dict(:one => [1])[:one]
72
+ Dict("abc" => Set())["abc"]
73
+ pushfirst!([], sum)
62
74
get(Base.pkgorigins, Base.PkgId(Base), nothing)
75
+ sort!([1,2,3])
76
+ unique!([1,2,3])
77
+ cumsum([1,2,3])
78
+ append!(Int[], BitSet())
79
+ isempty(BitSet())
80
+ delete!(BitSet([1,2]), 3)
81
+ deleteat!(Int32[1,2,3], [1,3])
82
+ deleteat!(Any[1,2,3], [1,3])
83
+ Core.svec(1, 2) == Core.svec(3, 4)
84
+ copy(Core.Compiler.retrieve_code_info(Core.Compiler.specialize_method(which(+, (Int, Int)), [Int, Int], Core.svec())))
85
+ any(t->t[1].line > 1, [(LineNumberNode(2,:none),:(1+1))])
63
86
"""
64
87
65
88
julia_exepath () = joinpath (Sys. BINDIR:: String , Base. julia_exename ())
@@ -72,21 +95,26 @@ if have_repl
72
95
"""
73
96
end
74
97
75
- # This is disabled because it doesn't give much benefit
76
- # and the code in Distributed is poorly typed causing many invalidations
77
- #=
78
98
Distributed = get (Base. loaded_modules,
79
99
Base. PkgId (Base. UUID (" 8ba89e20-285c-5b6f-9357-94700520ee1b" ), " Distributed" ),
80
100
nothing )
81
101
if Distributed != = nothing
102
+ hardcoded_precompile_statements *= """
103
+ @assert precompile(Tuple{typeof(Distributed.remotecall),Function,Int,Module,Vararg{Any, 100}})
104
+ @assert precompile(Tuple{typeof(Distributed.procs)})
105
+ @assert precompile(Tuple{typeof(Distributed.finalize_ref), Distributed.Future})
106
+ """
107
+ # This is disabled because it doesn't give much benefit
108
+ # and the code in Distributed is poorly typed causing many invalidations
109
+ #=
82
110
precompile_script *= """
83
111
using Distributed
84
112
addprocs(2)
85
113
pmap(x->iseven(x) ? 1 : 0, 1:4)
86
114
@distributed (+) for i = 1:100 Int(rand(Bool)) end
87
115
"""
88
- end
89
116
=#
117
+ end
90
118
91
119
92
120
Artifacts = get (Base. loaded_modules,
@@ -121,6 +149,7 @@ if FileWatching !== nothing
121
149
hardcoded_precompile_statements *= """
122
150
@assert precompile(Tuple{typeof(FileWatching.watch_file), String, Float64})
123
151
@assert precompile(Tuple{typeof(FileWatching.watch_file), String, Int})
152
+ @assert precompile(Tuple{typeof(FileWatching._uv_hook_close), FileWatching.FileMonitor})
124
153
"""
125
154
end
126
155
0 commit comments