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

Ensure accurate invalidation logging data #48982

Merged
merged 3 commits into from
Mar 17, 2023
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: 3 additions & 1 deletion src/staticdata_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,8 +869,10 @@ static jl_array_t *jl_verify_edges(jl_array_t *targets, size_t minworld)
assert(jl_is_array(expected));
int ambig = 0;
// TODO: possibly need to included ambiguities too (for the optimizer correctness)?
// len + 1 is to allow us to log causes of invalidation (SnoopCompile's @snoopr)
matches = jl_matching_methods((jl_tupletype_t*)sig, jl_nothing,
jl_array_len(expected), 0, minworld, &min_valid, &max_valid, &ambig);
_jl_debug_method_invalidation ? INT32_MAX : jl_array_len(expected),
0, minworld, &min_valid, &max_valid, &ambig);
if (matches == jl_nothing) {
max_valid = 0;
}
Expand Down
4 changes: 2 additions & 2 deletions test/precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ precompile_test_harness("code caching") do dir
mi = m.specializations[1]
@test hasvalid(mi, world) # was compiled with the new method

# Reporting test
# Reporting test (ensure SnoopCompile works)
@test all(i -> isassigned(invalidations, i), eachindex(invalidations))
m = only(methods(MB.call_nbits))
for mi in m.specializations
Expand All @@ -936,7 +936,7 @@ precompile_test_harness("code caching") do dir
j = findfirst(==(tagbad), invalidations)
@test invalidations[j-1] == "insert_backedges_callee"
@test isa(invalidations[j-2], Type)
@test invalidations[j+1] === nothing || isa(invalidations[j+1], Vector{Any}) # [nbits(::UInt8)]
@test isa(invalidations[j+1], Vector{Any}) # [nbits(::UInt8)]

m = only(methods(MB.map_nbits))
@test !hasvalid(m.specializations[1], world+1) # insert_backedges invalidations also trigger their backedges
Expand Down