Skip to content

Commit e048dc4

Browse files
KristofferCtimholy
authored andcommitted
inline the one method getlhs (#315)
1 parent c8ccd64 commit e048dc4

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/commands.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function finish_stack!(@nospecialize(recurse), frame::Frame, rootistoplevel::Boo
6565
frame.callee = nothing
6666
pc = frame.pc
6767
if isassign(frame, pc)
68-
lhs = getlhs(pc)
68+
lhs = SSAValue(pc)
6969
do_assignment!(frame, lhs, ret)
7070
else
7171
stmt = pc_expr(frame, pc)

src/interpret.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Implements a simple interpreter for julia's lowered AST
22

3-
getlhs(pc) = SSAValue(pc)
4-
53
isassign(frame) = isassign(frame, frame.pc)
64
isassign(frame, pc) = (pc in frame.framecode.used)
75

@@ -352,7 +350,7 @@ function maybe_assign!(frame, @nospecialize(stmt), @nospecialize(val))
352350
lhs = stmt.args[1]
353351
do_assignment!(frame, lhs, val)
354352
elseif isassign(frame, pc)
355-
lhs = getlhs(pc)
353+
lhs = SSAValue(pc)
356354
do_assignment!(frame, lhs, val)
357355
end
358356
return nothing
@@ -538,7 +536,7 @@ function step_expr!(@nospecialize(recurse), frame, @nospecialize(node), istoplev
538536
if !@isdefined(rhs)
539537
@show frame node
540538
end
541-
lhs = getlhs(pc)
539+
lhs = SSAValue(pc)
542540
do_assignment!(frame, lhs, rhs)
543541
end
544542
return (frame.pc = pc + 1)

test/utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using JuliaInterpreter
22
using JuliaInterpreter: Frame, @lookup
33
using JuliaInterpreter: finish_and_return!, evaluate_call!, step_expr!, shouldbreak,
4-
do_assignment!, getlhs, isassign, pc_expr, handle_err, get_return,
4+
do_assignment!, SSAValue, isassign, pc_expr, handle_err, get_return,
55
moduleof, prepare_thunk
66
using Base.Meta: isexpr
77
using Test, Random, SHA
@@ -64,7 +64,7 @@ function evaluate_limited!(@nospecialize(recurse), frame::Frame, nstmts::Int, is
6464
try
6565
rhs = evaluate_call!(limexec!, frame, stmt)
6666
isa(rhs, Aborted) && return rhs, refnstmts[]
67-
lhs = getlhs(pc)
67+
lhs = SSAValue(pc)
6868
do_assignment!(frame, lhs, rhs)
6969
new_pc = pc + 1
7070
catch err

0 commit comments

Comments
 (0)