Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jameson Nash <[email protected]>
  • Loading branch information
timholy and vtjnash authored Aug 2, 2022
1 parent c610c97 commit e620c90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 3 additions & 5 deletions base/compiler/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -803,10 +803,8 @@ function collect_const_args(argtypes::Vector{Any})
end

function invoke_signature(invokesig::Vector{Any})
unwrapconst(x) = isa(x, Const) ? x.val : x

f, argtyps = unwrapconst(invokesig[2]), unwrapconst(invokesig[3])
return Tuple{typeof(f), unwrap_unionall(argtyps).parameters...}
ft, argtyps = widenconst(invokesig[2]), instanceof_tfunc(widenconst(invokesig[3]))[1]
return rewrap_unionall(Tuple{typeof(f), unwrap_unionall(argtyps).parameters...}, argtyps)
end

function concrete_eval_call(interp::AbstractInterpreter,
Expand Down Expand Up @@ -1627,7 +1625,7 @@ function abstract_invoke(interp::AbstractInterpreter, (; fargs, argtypes)::ArgIn
ti = tienv[1]; env = tienv[2]::SimpleVector
result = abstract_call_method(interp, method, ti, env, false, sv)
(; rt, edge, effects) = result
edge !== nothing && add_backedge!(edge::MethodInstance, sv, argtypes)
edge !== nothing && add_backedge!(edge::MethodInstance, sv, types)
match = MethodMatch(ti, env, method, argtype <: method.sig)
res = nothing
sig = match.spec_types
Expand Down
4 changes: 0 additions & 4 deletions base/compiler/utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,6 @@ end

const empty_backedge_iter = BackedgeIterator(Any[])

function BackedgeIterator(mi::MethodInstance)
isdefined(mi, :backedges) || return empty_backedge_iter
return BackedgeIterator(mi.backedges)
end

function iterate(iter::BackedgeIterator, i::Int=1)
backedges = iter.backedges
Expand Down

0 comments on commit e620c90

Please sign in to comment.