Skip to content

Commit e12f065

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

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
@@ -330,7 +330,7 @@ function ir_inline_linetable!(linetable::Vector{LineInfoNode}, inlinee_ir::IRCod
330330
# Append the linetable of the inlined function to our line table
331331
topline::Int32 = linetable_offset + Int32(1)
332332
coverage_by_path = JLOptions().code_coverage == 3
333-
push!(linetable, LineInfoNode(inlinee_def.module, inlinee, inlinee_def.file, inlinee_def.line, inlined_at))
333+
push!(linetable, LineInfoNode(inlinee_def.module, inlinee_def.name, inlinee_def.file, inlinee_def.line, inlined_at))
334334
oldlinetable = inlinee_ir.linetable
335335
extra_coverage_line = zero(Int32)
336336
for oldline in eachindex(oldlinetable)

base/compiler/typeinfer.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ function typeinf_ext(interp::AbstractInterpreter, mi::MethodInstance)
10151015
tree.slotflags = fill(IR_FLAG_NULL, nargs)
10161016
tree.ssavaluetypes = 1
10171017
tree.codelocs = Int32[1]
1018-
tree.linetable = LineInfoNode[LineInfoNode(method.module, mi, method.file, method.line, Int32(0))]
1018+
tree.linetable = LineInfoNode[LineInfoNode(method.module, method.name, method.file, method.line, Int32(0))]
10191019
tree.ssaflags = UInt8[0]
10201020
set_inlineable!(tree, true)
10211021
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)