Skip to content

Commit

Permalink
Address some review
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno authored and JeffBezanson committed Oct 14, 2020
1 parent 6d1c37d commit 2f7510b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
7 changes: 4 additions & 3 deletions base/compiler/ssair/inlining.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion base/compiler/tfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions base/compiler/typeinfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/julia.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2f7510b

Please sign in to comment.