Skip to content

Commit ae798cd

Browse files
authored
Revert storage of method instance in LineInfoNode (#50546)
Due to #50082, reverting the causative portion from #41099, which stored MethodInstances in LineInfoNodes.
1 parent 3c5b3c0 commit ae798cd

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

base/compiler/ssair/inlining.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ function ir_inline_linetable!(linetable::Vector{LineInfoNode}, inlinee_ir::IRCod
329329
# Append the linetable of the inlined function to our line table
330330
topline::Int32 = linetable_offset + Int32(1)
331331
coverage_by_path = JLOptions().code_coverage == 3
332-
push!(linetable, LineInfoNode(inlinee_def.module, inlinee, inlinee_def.file, inlinee_def.line, inlined_at))
332+
push!(linetable, LineInfoNode(inlinee_def.module, inlinee_def.name, inlinee_def.file, inlinee_def.line, inlined_at))
333333
oldlinetable = inlinee_ir.linetable
334334
extra_coverage_line = zero(Int32)
335335
for oldline in eachindex(oldlinetable)

base/compiler/typeinfer.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ function typeinf_ext(interp::AbstractInterpreter, mi::MethodInstance)
10071007
tree.slotflags = fill(IR_FLAG_NULL, nargs)
10081008
tree.ssavaluetypes = 1
10091009
tree.codelocs = Int32[1]
1010-
tree.linetable = LineInfoNode[LineInfoNode(method.module, mi, method.file, method.line, Int32(0))]
1010+
tree.linetable = LineInfoNode[LineInfoNode(method.module, method.name, method.file, method.line, Int32(0))]
10111011
tree.ssaflags = UInt8[0]
10121012
set_inlineable!(tree, true)
10131013
tree.parent = mi

test/stacktraces.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,16 @@ trace = (try; f(3); catch; stacktrace(catch_backtrace()); end)[1:3]
9191
can_inline = Bool(Base.JLOptions().can_inline)
9292
for (frame, func, inlined) in zip(trace, [g,h,f], (can_inline, can_inline, false))
9393
@test frame.func === typeof(func).name.mt.name
94-
@test frame.linfo.def.module === which(func, (Any,)).module
95-
@test frame.linfo.def === which(func, (Any,))
96-
@test frame.linfo.specTypes === Tuple{typeof(func), Int}
94+
# broken until #50082 can be addressed
95+
if inlined
96+
@test frame.linfo.def.module === which(func, (Any,)).module broken=true
97+
@test frame.linfo.def === which(func, (Any,)) broken=true
98+
@test frame.linfo.specTypes === Tuple{typeof(func), Int} broken=true
99+
else
100+
@test frame.linfo.def.module === which(func, (Any,)).module
101+
@test frame.linfo.def === which(func, (Any,))
102+
@test frame.linfo.specTypes === Tuple{typeof(func), Int}
103+
end
97104
# line
98105
@test frame.file === Symbol(@__FILE__)
99106
@test !frame.from_c

0 commit comments

Comments
 (0)