Skip to content

Commit 649a5c8

Browse files
vchuravyKristofferC
authored andcommitted
Reinstate PrecompileTools-esque caching for REPL (#59850)
REPL precompile scripts runs a workload and might thus encounter code in other standard libraries that needs to be precompiled. Before #54899 we had a bespoke variant of PrecompileTools.jl. PrecompileTools was fixed with #57828 so we can now re-instate the support in REPL. Noticed by @tecosaur, while looking at #51811 (cherry picked from commit ecfec85)
1 parent 0be5439 commit 649a5c8

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

stdlib/REPL/src/precompile.jl

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,17 @@ end
191191

192192
let
193193
if Base.generating_output() && Base.JLOptions().use_pkgimages != 0
194-
repl_workload()
195-
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Any, Int})
196-
precompile(Tuple{typeof(Base.delete!), Base.Set{Any}, String})
197-
precompile(Tuple{typeof(Base.:(==)), Char, String})
198-
#for child in copy(Base.newly_inferred)
199-
# precompile((child::Base.CodeInstance).def)
200-
#end
194+
# Bare-bones PrecompileTools.jl
195+
# Do we need latestworld-if-toplevel here
196+
ccall(:jl_tag_newly_inferred_enable, Cvoid, ())
197+
try
198+
repl_workload()
199+
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Any, Int})
200+
precompile(Tuple{typeof(Base.delete!), Base.Set{Any}, String})
201+
precompile(Tuple{typeof(Base.:(==)), Char, String})
202+
finally
203+
ccall(:jl_tag_newly_inferred_disable, Cvoid, ())
204+
end
201205
end
202206
end
203207

0 commit comments

Comments
 (0)