Skip to content

Commit ecfec85

Browse files
authored
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
1 parent 9cddfda commit ecfec85

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

stdlib/REPL/src/precompile.jl

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,18 @@ end
202202

203203
let
204204
if Base.generating_output() && Base.JLOptions().use_pkgimages != 0
205-
repl_workload()
206-
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Any, Char})
207-
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Any, Int})
208-
precompile(Tuple{typeof(Base.delete!), Base.Set{Any}, String})
209-
precompile(Tuple{typeof(Base.:(==)), Char, String})
210-
#for child in copy(Base.newly_inferred)
211-
# precompile((child::Base.CodeInstance).def)
212-
#end
205+
# Bare-bones PrecompileTools.jl
206+
# Do we need latestworld-if-toplevel here
207+
ccall(:jl_tag_newly_inferred_enable, Cvoid, ())
208+
try
209+
repl_workload()
210+
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Any, Char})
211+
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Any, Int})
212+
precompile(Tuple{typeof(Base.delete!), Base.Set{Any}, String})
213+
precompile(Tuple{typeof(Base.:(==)), Char, String})
214+
finally
215+
ccall(:jl_tag_newly_inferred_disable, Cvoid, ())
216+
end
213217
end
214218
end
215219

0 commit comments

Comments
 (0)