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