Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjust to the :enter IR changes made in JuliaLang/julia#52300 #599

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/interpret.jl
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@
end
maybe_assign!(frame, @nospecialize(val)) = maybe_assign!(frame, pc_expr(frame), val)


function eval_rhs(@nospecialize(recurse), frame, node::Expr)
head = node.head
if head === :new
Expand Down Expand Up @@ -399,6 +398,7 @@
val = (node.args[1]::QuoteNode).value
return isa(val, Expr) ? copy(val) : val
elseif head === :enter
# XXX This seems to be dead code
return length(frame.framedata.exception_frames)
elseif head === :boundscheck
return true
Expand Down Expand Up @@ -565,6 +565,9 @@
elseif istoplevel && isa(node, LineNumberNode)
elseif istoplevel && isa(node, Symbol)
rhs = getfield(moduleof(frame), node)
elseif @static (isdefined(Core.IR, :EnterNode) && true) && isa(node, Core.IR.EnterNode)
rhs = node.catch_dest
push!(data.exception_frames, rhs)

Check warning on line 570 in src/interpret.jl

View check run for this annotation

Codecov / codecov/patch

src/interpret.jl#L569-L570

Added lines #L569 - L570 were not covered by tests
else
rhs = @lookup(frame, node)
end
Expand Down
10 changes: 5 additions & 5 deletions src/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,10 @@ function renumber_ssa!(stmts::Vector{Any}, ssalookup)
stmts[i] = SSAValue(ssalookup[stmt.id])
elseif isa(stmt, NewSSAValue)
stmts[i] = SSAValue(stmt.id)
elseif isexpr(stmt, :enter)
stmt.args[end] = jumplookup(ssalookup, stmt.args[1]::Int)
elseif isa(stmt, Expr)
stmt = replace_ssa(stmt, ssalookup)
if stmt.head === :enter
stmt.args[end] = jumplookup(ssalookup, stmt.args[1]::Int)
end
stmts[i] = stmt
stmts[i] = replace_ssa(stmt, ssalookup)
elseif isa(stmt, GotoIfNot)
cond = stmt.cond
if isa(cond, SSAValue)
Expand All @@ -71,6 +69,8 @@ function renumber_ssa!(stmts::Vector{Any}, ssalookup)
if isa(val, SSAValue)
stmts[i] = ReturnNode(SSAValue(ssalookup[val.id]))
end
elseif @static (isdefined(Core.IR, :EnterNode) && true) && isa(stmt, Core.IR.EnterNode)
stmts[i] = Core.IR.EnterNode(jumplookup(ssalookup, stmt.catch_dest))
end
end
return stmts
Expand Down
Loading