jli  Linuxx86_641.10.3v1.10.30b4590a5507d3f3046e5bafc007cacbbfc9b310bxPrecompileTools@jj*gnVU b78@/opt/julia/packages/PrecompileTools/L8A3n/src/PrecompileTools.jl$#APreferences.jl!!Preferences:/opt/julia/packages/PrecompileTools/L8A3n/src/workloads.jl$#A>/opt/julia/packages/PrecompileTools/L8A3n/src/invalidations.jl$#Ao CoremуJ5Basemу]J5MainmуJ5ArgToolsBń x(mуF K5 Artifactsmr-V3|mу K5Base64UlD*_mу> K5CRC32c\y.jmуj K5 FileWatchingXzsy`{,zmуh& K5LibdluVW59˗,mу-" K5LoggingT{VhUXM=mуrU" K5MmapP~:xg,Omу|' K5NetworkOptionsC0YW,mуʠ, K5SHAQ<$!<%mу1 K5 Serialization [)*k1mу-G K5Sockets1V$ bdސݗmуYBY K5UnicodeP>I>Nrmуeszo K5 LinearAlgebraSm7̏mуuux K5 OpenBLAS_jll[(Śb6EcQ FmуDux K5libblastrampoline_jllLSۆ }lxӠmу^} K5MarkdownZPn7z`smу/Ed~ K5Printfg^cX׸QDmу;h K5Random_ɢ?\Ymу? K5TarOi>աmу!t, K5DatesEY8pj2 mуX K5FuturebS;3{I xVMmуsD K5InteractiveUtilsWL ~@'ZmуVg K5LibGit2Z[&RPTv3EКRmу8J K5 LibGit2_jll YXg}]$mуD K5 MbedTLS_jllAX 3ȡ_mу- K5 LibSSH2_jlloTZk)߆= v"1.6" using Preferences end export @setup_workload, @compile_workload, @recompile_invalidations const verbose = Ref(false) # if true, prints all the precompiles const have_inference_tracking = isdefined(Core.Compiler, :__set_measure_typeinf) const have_force_compile = isdefined(Base, :Experimental) && isdefined(Base.Experimental, Symbol("#@force_compile")) function precompile_mi(mi) precompile(mi.specTypes) # TODO: Julia should allow one to pass `mi` directly (would handle `invoke` properly) verbose[] && println(mi) return end include("workloads.jl") if VERSION >= v"1.9.0-rc2" include("invalidations.jl") else macro recompile_invalidations(ex::Expr) return esc(ex) end end end :/opt/julia/packages/PrecompileTools/L8A3n/src/workloads.jlw function workload_enabled(mod::Module) try if load_preference(@__MODULE__, "precompile_workloads", true) return load_preference(mod, "precompile_workload", true) else return false end catch true end end """ check_edges(node) Recursively ensure that all callees of `node` are precompiled. This is (rarely) necessary because sometimes there is no backedge from callee to caller (xref https://github.com/JuliaLang/julia/issues/49617), and `staticdata.c` relies on the backedge to trace back to a MethodInstance that is tagged `mi.precompiled`. """ function check_edges(node) parentmi = node.mi_info.mi for child in node.children childmi = child.mi_info.mi if !(isdefined(childmi, :backedges) && parentmi ∈ childmi.backedges) precompile_mi(childmi) end check_edges(child) end end function precompile_roots(roots) @assert have_inference_tracking for child in roots precompile_mi(child.mi_info.mi) check_edges(child) end end """ @compile_workload f(args...) `precompile` (and save in the compile_workload file) any method-calls that occur inside the expression. All calls (direct or indirect) inside a `@compile_workload` block will be cached. `@compile_workload` has three key features: 1. code inside runs only when the package is being precompiled (i.e., a `*.ji` precompile compile_workload file is being written) 2. the interpreter is disabled, ensuring your calls will be compiled 3. both direct and indirect callees will be precompiled, even for methods defined in other packages and even for runtime-dispatched callees (requires Julia 1.8 and above). !!! note For comprehensive precompilation, ensure the first usage of a given method/argument-type combination occurs inside `@compile_workload`. In detail: runtime-dispatched callees are captured only when type-inference is executed, and they are inferred only on first usage. Inferrable calls that trace back to a method defined in your package, and their *inferrable* callees, will be precompiled regardless of "ownership" of the callees (Julia 1.8 and higher). Consequently, this recommendation matters only for: - direct calls to methods defined in Base or other packages OR - indirect runtime-dispatched calls to such methods. """ macro compile_workload(ex::Expr) local iscompiling = if Base.VERSION < v"1.6" :(ccall(:jl_generating_output, Cint, ()) == 1) else :((ccall(:jl_generating_output, Cint, ()) == 1 && $PrecompileTools.workload_enabled(@__MODULE__))) end if have_force_compile ex = quote begin Base.Experimental.@force_compile $(esc(ex)) end end else # Use the hack on earlier Julia versions that blocks the interpreter ex = quote while false end $(esc(ex)) end end if have_inference_tracking ex = quote Core.Compiler.Timings.reset_timings() Core.Compiler.__set_measure_typeinf(true) try $ex finally Core.Compiler.__set_measure_typeinf(false) Core.Compiler.Timings.close_current_timer() end $PrecompileTools.precompile_roots(Core.Compiler.Timings._timings[1].children) end end return quote if $iscompiling || $PrecompileTools.verbose[] $ex end end end """ @setup_workload begin vars = ... ⋮ end Run the code block only during package precompilation. `@setup_workload` is often used in combination with [`@compile_workload`](@ref), for example: @setup_workload begin vars = ... @compile_workload begin y = f(vars...) g(y) ⋮ end end `@setup_workload` does not force compilation (though it may happen anyway) nor intentionally capture runtime dispatches (though they will be precompiled anyway if the runtime-callee is for a method belonging to your package). """ macro setup_workload(ex::Expr) local iscompiling = if Base.VERSION < v"1.6" :(ccall(:jl_generating_output, Cint, ()) == 1) else :((ccall(:jl_generating_output, Cint, ()) == 1 && $PrecompileTools.workload_enabled(@__MODULE__))) end # Ideally we'd like a `let` around this to prevent namespace pollution, but that seem to # trigger inference & codegen in undesirable ways (see #16). return quote if $iscompiling || $PrecompileTools.verbose[] $(esc(ex)) end end end >/opt/julia/packages/PrecompileTools/L8A3n/src/invalidations.jlA """ @recompile_invalidations begin using PkgA ⋮ end Recompile any invalidations that occur within the given expression. This is generally intended to be used by users in creating "Startup" packages to ensure that the code compiled by package authors is not invalidated. """ macro recompile_invalidations(expr) # use QuoteNode instead of esc(Expr(:quote)) so that $ is not permitted as usual (instead of having this macro work like `@eval`) return :(recompile_invalidations($__module__, $(QuoteNode(expr)))) end function recompile_invalidations(__module__::Module, @nospecialize expr) list = ccall(:jl_debug_method_invalidation, Any, (Cint,), 1) try Core.eval(__module__, expr) finally ccall(:jl_debug_method_invalidation, Any, (Cint,), 0) end if ccall(:jl_generating_output, Cint, ()) == 1 foreach(precompile_mi, invalidation_leaves(list)) end nothing end function invalidation_leaves(invlist) umis = Set{Core.MethodInstance}() # `queued` is a queue of length 0 or 1 of invalidated MethodInstances. # We wait to read the `depth` to find out if it's a leaf. queued, depth = nothing, 0 function cachequeued(item, nextdepth) if queued !== nothing && nextdepth <= depth push!(umis, queued) end queued, depth = item, nextdepth end i, ilast = firstindex(invlist), lastindex(invlist) while i <= ilast item = invlist[i] if isa(item, Core.MethodInstance) if i < lastindex(invlist) nextitem = invlist[i+1] if nextitem == "invalidate_mt_cache" cachequeued(nothing, 0) i += 2 continue end if nextitem ∈ ("jl_method_table_disable", "jl_method_table_insert", "verify_methods") cachequeued(nothing, 0) push!(umis, item) end if isa(nextitem, Integer) cachequeued(item, nextitem) i += 2 continue end end end if (isa(item, Method) || isa(item, Type)) && queued !== nothing push!(umis, queued) queued, depth = nothing, 0 end i += 1 end return umis end utm*N