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

Add missing entry to invalidation log #49449

Merged
merged 2 commits into from
Apr 21, 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
20 changes: 10 additions & 10 deletions src/staticdata_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1022,18 +1022,18 @@ static int jl_verify_graph_edge(size_t *maxvalids2_data, jl_array_t *edges, size
if (idx != childidx) {
if (max_valid < maxvalids2_data[childidx])
maxvalids2_data[childidx] = max_valid;
if (_jl_debug_method_invalidation && max_valid != ~(size_t)0) {
jl_method_instance_t *mi = (jl_method_instance_t*)jl_array_ptr_ref(edges, childidx * 2);
jl_value_t *loctag = NULL;
JL_GC_PUSH1(&loctag);
jl_array_ptr_1d_push(_jl_debug_method_invalidation, (jl_value_t*)mi);
loctag = jl_cstr_to_string("verify_methods");
jl_array_ptr_1d_push(_jl_debug_method_invalidation, loctag);
jl_array_ptr_1d_push(_jl_debug_method_invalidation, (jl_value_t*)cause);
JL_GC_POP();
}
}
visited->items[childidx] = (void*)1;
if (_jl_debug_method_invalidation && max_valid != ~(size_t)0) {
jl_method_instance_t *mi = (jl_method_instance_t*)jl_array_ptr_ref(edges, childidx * 2);
jl_value_t *loctag = NULL;
JL_GC_PUSH1(&loctag);
jl_array_ptr_1d_push(_jl_debug_method_invalidation, (jl_value_t*)mi);
loctag = jl_cstr_to_string("verify_methods");
jl_array_ptr_1d_push(_jl_debug_method_invalidation, loctag);
jl_array_ptr_1d_push(_jl_debug_method_invalidation, (jl_value_t*)cause);
JL_GC_POP();
}
}
return 0;
}
Expand Down
10 changes: 9 additions & 1 deletion test/precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -857,9 +857,13 @@ precompile_test_harness("code caching") do dir

# This will be invalidated if StaleC is loaded
useA() = $StaleA.stale("hello")
useA2() = useA()

# force precompilation
useA()
begin
Base.Experimental.@force_compile
useA2()
end

## Reporting tests
call_nbits(x::Integer) = $StaleA.nbits(x)
Expand Down Expand Up @@ -940,6 +944,10 @@ precompile_test_harness("code caching") do dir
@test invalidations[j-1] == "insert_backedges_callee"
@test isa(invalidations[j-2], Type)
@test isa(invalidations[j+1], Vector{Any}) # [nbits(::UInt8)]
m = only(methods(MB.useA2))
mi = only(Base.specializations(m))
@test !hasvalid(mi, world)
@test mi ∈ invalidations

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