Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix InterpreterIP reference #404

Merged
merged 3 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,16 @@ jobs:
- '1.10'
- '1'
- 'pre'
- 'nightly'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
show-versioninfo: ${{ matrix.version == 'nightly' }}
- uses: actions/cache@v4
env:
Expand Down
7 changes: 6 additions & 1 deletion src/parcel_snoop_inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ isROOT(node::InferenceTimingNode) = isROOT(node.mi_timing)
getroot(node::InferenceTimingNode) = isdefined(node.parent, :parent) ? getroot(node.parent) : node

# Record instruction pointers we've already looked up (performance optimization)
const lookups = Dict{Union{UInt, Core.Compiler.InterpreterIP}, Vector{StackTraces.StackFrame}}()
const lookups = if isdefined(Core.Compiler, :InterpreterIP)
Dict{Union{UInt, Core.Compiler.InterpreterIP}, Vector{StackTraces.StackFrame}}()
else
# Julia 1.12+
Dict{Union{UInt, Base.InterpreterIP}, Vector{StackTraces.StackFrame}}()
end
lookups_key(ip) = ip
lookups_key(ip::Ptr{Nothing}) = UInt(ip)

Expand Down
Loading