From 2f7510bf7f42b1553c7f5932e09f24dcd13d95d5 Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Tue, 13 Oct 2020 09:53:30 -0400 Subject: [PATCH] Address some review --- base/compiler/ssair/inlining.jl | 7 ++++--- base/compiler/tfuncs.jl | 2 +- base/compiler/typeinfer.jl | 3 +-- src/julia.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/base/compiler/ssair/inlining.jl b/base/compiler/ssair/inlining.jl index dc9478afdec37..2e8e85a41bdf8 100644 --- a/base/compiler/ssair/inlining.jl +++ b/base/compiler/ssair/inlining.jl @@ -1089,6 +1089,10 @@ function process_simple!(ir::IRCode, todo::Vector{Pair{Int, Any}}, idx::Int, sta push!(todo, idx=>InliningTodo(nothing, ResolvedInliningSpec(ir′, linear_inline_eligible(ir′)))) return nothing end + # Refuse to inline OpaqueClosures we can't see, to preserve the + # possibility of functions higher in the call stack seeing this + # and performing the inlining. + return nothing end sig = with_atype(sig) @@ -1223,9 +1227,6 @@ function assemble_inline_todo!(ir::IRCode, state::InliningState) ir.stmts[idx][:inst] = quoted(calltype.val) continue end - # Refuse to inline OpaqueClosures we can't see otherwise, to preserve the - # possibility of functions higher in the call stack seeing this - # and performing the inlining. continue end diff --git a/base/compiler/tfuncs.jl b/base/compiler/tfuncs.jl index 463aa2bdd37b0..24b7036c133df 100644 --- a/base/compiler/tfuncs.jl +++ b/base/compiler/tfuncs.jl @@ -1378,7 +1378,7 @@ function _opaque_closure_tfunc(@nospecialize(arg), @nospecialize(lb), @nospecial argt, argt_exact = instanceof_tfunc(arg) lbt, lb_exact = instanceof_tfunc(lb) if !lb_exact - lbt = Union{} + lbt = Union{} end ubt, ub_exact = instanceof_tfunc(ub) diff --git a/base/compiler/typeinfer.jl b/base/compiler/typeinfer.jl index 2c624f4a0d11c..34e51227cef9c 100644 --- a/base/compiler/typeinfer.jl +++ b/base/compiler/typeinfer.jl @@ -378,8 +378,7 @@ function finish_opaque_closure!(clos::PartialOpaque, mod::Module, interp::Abstra argtypes = Any[argt.parameters...] pushfirst!(argtypes, clos.env) if isdispatchtuple(argt) - # If we don't need to track specializations, just infer this here - # right now. + # If we don't need to track specializations, just infer this here right now. result = InferenceResult(Core.OpaqueClosure, argtypes) state = InferenceState(result, copy(clos.ci), false, interp) typeinf_local(interp, state) diff --git a/src/julia.h b/src/julia.h index 65149354ff732..b82b62eb8049d 100644 --- a/src/julia.h +++ b/src/julia.h @@ -351,7 +351,7 @@ struct _jl_method_instance_t { uint8_t inInference; // flags to tell if inference is running on this object }; -// YACK - Yet another kind of closure. +// OpaqueClosure typedef struct jl_opaque_closure_t { JL_DATA_TYPE jl_value_t *env;