Skip to content

Commit 31ea1d4

Browse files
authored
Merge pull request #45 from JuliaDebug/kc/plain
get rid of no-op "plain"
2 parents 8026031 + 43aa6a8 commit 31ea1d4

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/JuliaInterpreter.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,6 @@ function optimize!(code::CodeInfo, mod::Module)
534534
return code
535535
end
536536

537-
plain(stmt) = stmt
538-
539537
function prepare_locals(framecode, argvals::Vector{Any})
540538
if isa(framecode.scope, Method)
541539
meth, code = framecode.scope::Method, framecode.code
@@ -707,7 +705,7 @@ end
707705

708706
function maybe_step_through_wrapper!(stack)
709707
length(stack[1].code.code.code) < 2 && return stack
710-
last = plain(stack[1].code.code.code[end-1])
708+
last = stack[1].code.code.code[end-1]
711709
isexpr(last, :(=)) && (last = last.args[2])
712710
stack1 = stack[1]
713711
is_kw = stack1.code.scope isa Method && startswith(String(Base.unwrap_unionall(stack1.code.scope.sig).parameters[1].name.name), "#kw")

src/interpret.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ Step through statements of `frame` until the next statement satifies `predicate(
516516
"""
517517
function next_until!(f, stack, frame, pc::JuliaProgramCounter=frame.pc[], istoplevel::Bool=false)
518518
while (pc = _step_expr!(stack, frame, pc, istoplevel)) != nothing
519-
f(plain(pc_expr(frame, pc))) && (frame.pc[] = pc; return pc)
519+
f(pc_expr(frame, pc)) && (frame.pc[] = pc; return pc)
520520
end
521521
return nothing
522522
end
@@ -554,7 +554,7 @@ function find_used(code::CodeInfo)
554554
used = BitSet()
555555
stmts = code.code
556556
for stmt in stmts
557-
Core.Compiler.scan_ssa_use!(push!, used, plain(stmt))
557+
Core.Compiler.scan_ssa_use!(push!, used, stmt)
558558
if isexpr(stmt, :struct_type) # this one is missed
559559
for a in stmt.args
560560
Core.Compiler.scan_ssa_use!(push!, used, a)
@@ -580,7 +580,7 @@ function next_line!(stack, frame, dbstack = nothing)
580580
while location(frame, pc) == initial
581581
# If this is a return node, interrupt execution. This is the same
582582
# special case as in `s`.
583-
expr = plain(pc_expr(frame, pc))
583+
expr = pc_expr(frame, pc)
584584
(!first && isexpr(expr, :return)) && return pc
585585
first = false
586586
# If this is a goto node, step it and reevaluate
@@ -592,7 +592,7 @@ function next_line!(stack, frame, dbstack = nothing)
592592
# confuses the logic here, just step into the first call that's not a builtin
593593
while true
594594
dbstack[1] = JuliaStackFrame(JuliaFrameCode(frame.code; wrapper = true), frame, pc)
595-
call_expr = plain(pc_expr(frame, pc))
595+
call_expr = pc_expr(frame, pc)
596596
isexpr(call_expr, :(=)) && (call_expr = call_expr.args[2])
597597
call_expr = Expr(:call, map(x->@lookup(frame, x), call_expr.args)...)
598598
new_frame = enter_call_expr(call_expr)
@@ -617,7 +617,7 @@ end
617617

618618
function maybe_next_call!(stack, frame, pc)
619619
call_or_return(node) = is_call(node) || isexpr(node, :return)
620-
call_or_return(plain(pc_expr(frame, pc))) ||
620+
call_or_return(pc_expr(frame, pc)) ||
621621
(pc = next_until!(call_or_return, stack, frame, pc, false))
622622
pc
623623
end

0 commit comments

Comments
 (0)