Skip to content

Commit

Permalink
hot-path optimize replace_getfield!
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Mar 2, 2016
1 parent f67203c commit af81431
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3511,10 +3511,7 @@ function alloc_elim_pass(ast::Expr, sv::VarInfo)
end
end

function replace_getfield!(ast, e::ANY, tupname, vals, field_names, sv, i0)
if !isa(e,Expr)
return
end
function replace_getfield!(ast, e::Expr, tupname, vals, field_names, sv, i0)
for i = i0:length(e.args)
a = e.args[i]
if isa(a,Expr) && is_known_call(a, getfield, sv) &&
Expand Down Expand Up @@ -3548,8 +3545,8 @@ function replace_getfield!(ast, e::ANY, tupname, vals, field_names, sv, i0)
end
end
e.args[i] = val
else
replace_getfield!(ast, a, tupname, vals, field_names, sv, 1)
elseif isa(a, Expr)
replace_getfield!(ast, a::Expr, tupname, vals, field_names, sv, 1)
end
end
end
Expand Down

0 comments on commit af81431

Please sign in to comment.