diff --git a/RecipesPipeline/deps/SnoopCompile/precompile/1.7/precompile_RecipesPipeline.jl b/RecipesPipeline/deps/SnoopCompile/precompile/1.7/precompile_RecipesPipeline.jl index eb1a31fee..008136e2c 100644 --- a/RecipesPipeline/deps/SnoopCompile/precompile/1.7/precompile_RecipesPipeline.jl +++ b/RecipesPipeline/deps/SnoopCompile/precompile/1.7/precompile_RecipesPipeline.jl @@ -13,6 +13,57 @@ macro warnpcfail(ex::Expr) end +const __bodyfunction__ = Dict{Method,Any}() + +# Find keyword "body functions" (the function that contains the body +# as written by the developer, called after all missing keyword-arguments +# have been assigned values), in a manner that doesn't depend on +# gensymmed names. +# `mnokw` is the method that gets called when you invoke it without +# supplying any keywords. +function __lookup_kwbody__(mnokw::Method) + function getsym(arg) + isa(arg, Symbol) && return arg + @assert isa(arg, GlobalRef) + return arg.name + end + + f = get(__bodyfunction__, mnokw, nothing) + if f === nothing + fmod = mnokw.module + # The lowered code for `mnokw` should look like + # %1 = mkw(kwvalues..., #self#, args...) + # return %1 + # where `mkw` is the name of the "active" keyword body-function. + ast = Base.uncompressed_ast(mnokw) + if isa(ast, Core.CodeInfo) && length(ast.code) >= 2 + callexpr = ast.code[end-1] + if isa(callexpr, Expr) && callexpr.head == :call + fsym = callexpr.args[1] + if isa(fsym, Symbol) + f = getfield(fmod, fsym) + elseif isa(fsym, GlobalRef) + if fsym.mod === Core && fsym.name === :_apply + f = getfield(mnokw.module, getsym(callexpr.args[2])) + elseif fsym.mod === Core && fsym.name === :_apply_iterate + f = getfield(mnokw.module, getsym(callexpr.args[3])) + else + f = getfield(fsym.mod, fsym.name) + end + else + f = missing + end + else + f = missing + end + else + f = missing + end + __bodyfunction__[mnokw] = f + end + return f +end + function _precompile_() ccall(:jl_generating_output, Cint, ()) == 1 || return nothing Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),AbstractDict{Symbol, Any},AbstractMatrix}) @@ -22,12 +73,13 @@ function _precompile_() Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),AbstractDict{Symbol, Any},GroupBy,Any,Any}) Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),AbstractDict{Symbol, Any},GroupBy,Any}) Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),AbstractDict{Symbol, Any},Type{SliceIt},Any,Any,Any}) - Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),AbstractDict{Symbol, Any},Type{typeof(sin)},typeof(sin)}) Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),AbstractDict{Symbol, Any},Vector{Function},Number,Number}) Base.precompile(Tuple{typeof(_apply_type_recipe),Any,AbstractArray,Any}) Base.precompile(Tuple{typeof(_apply_type_recipe),Any,Surface,Any}) Base.precompile(Tuple{typeof(_compute_xyz),Vector{Float64},Function,Nothing,Bool}) + Base.precompile(Tuple{typeof(_compute_xyz),Vector{String},Vector{String},Nothing,Bool}) Base.precompile(Tuple{typeof(_extract_group_attributes),Vector{String}}) + Base.precompile(Tuple{typeof(_prepare_series_data),Matrix{Union{Missing, Float64}}}) Base.precompile(Tuple{typeof(_process_seriesrecipe),Any,Any}) Base.precompile(Tuple{typeof(_process_seriesrecipes!),Any,Any}) Base.precompile(Tuple{typeof(_scaled_adapted_grid),Function,Symbol,Symbol,Float64,Irrational{:π}}) @@ -48,4 +100,9 @@ function _precompile_() Base.precompile(Tuple{typeof(unzip),Vector{Tuple{Int64, Real}}}) Base.precompile(Tuple{typeof(unzip),Vector{Tuple{Vector{Float64}, Vector{Float64}}}}) isdefined(RecipesPipeline, Symbol("#11#12")) && Base.precompile(Tuple{getfield(RecipesPipeline, Symbol("#11#12")),Int64}) + let fbody = try __lookup_kwbody__(which(_extract_group_attributes, (Vector{String},Vector{Float64},))) catch missing end + if !ismissing(fbody) + precompile(fbody, (Function,typeof(_extract_group_attributes),Vector{String},Vector{Float64},)) + end +end end