Skip to content

Commit

Permalink
Record more fields via Core.Compiler.Timings (SnoopCompiler snoopi_de…
Browse files Browse the repository at this point in the history
…ep) (#38416)

Adds more fields to `InferenceFrameInfo`, via `@snoopi_deep`:
 - `limited::Bool`: If true, the result of this frame will *not be
   cached*
 - `nargs::Int`: The number of arguments in the slottypes.
  • Loading branch information
NHDaly committed Nov 19, 2020
1 parent 18c759f commit aee4c26
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion base/compiler/typeinfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ struct InferenceFrameInfo
world::UInt64
sptypes::Vector{Any}
slottypes::Vector{Any}
nargs::Int
limited::Bool
end

function _typeinf_identifier(frame::Core.Compiler.InferenceState)
Expand All @@ -35,6 +37,8 @@ function _typeinf_identifier(frame::Core.Compiler.InferenceState)
frame.world,
copy(frame.sptypes),
copy(frame.slottypes),
frame.nargs,
frame.limited,
)
return mi_info
end
Expand Down Expand Up @@ -81,7 +85,7 @@ function reset_timings()
empty!(_timings)
push!(_timings, Timing(
# The MethodInstance for ROOT(), and default empty values for other fields.
InferenceFrameInfo(ROOTmi, 0x0, Any[], Any[Core.Const(ROOT)]),
InferenceFrameInfo(ROOTmi, 0x0, Any[], Any[Core.Const(ROOT)], 1, false),
_time_ns()))
return nothing
end
Expand Down

0 comments on commit aee4c26

Please sign in to comment.