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

pkgimage: use faster flags to jl_matching_methods #48841

Merged
merged 2 commits into from
Mar 4, 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: 2 additions & 2 deletions src/staticdata_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ static void jl_collect_edges(jl_array_t *edges, jl_array_t *ext_targets, jl_arra
sig = callee;
int ambig = 0;
matches = jl_matching_methods((jl_tupletype_t*)sig, jl_nothing,
-1, 0, world, &min_valid, &max_valid, &ambig);
INT32_MAX, 0, world, &min_valid, &max_valid, &ambig);
if (matches == jl_nothing) {
callee_ids = NULL; // invalid
break;
Expand Down Expand Up @@ -868,7 +868,7 @@ static jl_array_t *jl_verify_edges(jl_array_t *targets, size_t minworld)
int ambig = 0;
// TODO: possibly need to included ambiguities too (for the optimizer correctness)?
matches = jl_matching_methods((jl_tupletype_t*)sig, jl_nothing,
-1, 0, minworld, &min_valid, &max_valid, &ambig);
jl_array_len(expected), 0, minworld, &min_valid, &max_valid, &ambig);
if (matches == jl_nothing) {
max_valid = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion test/precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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 isa(invalidations[j+1], Vector{Any}) # [nbits(::UInt8)]
@test invalidations[j+1] === nothing || isa(invalidations[j+1], Vector{Any}) # [nbits(::UInt8)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole point of this test was to ensure that we could identify the cause of the invalidation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be very costly to decide, which is why we don't here on deserialization, cutting off the search as soon as we show that there is more than one reason, without knowing what they are.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to be able to find the source of invalidations, otherwise how can we fix them? But #48982 may provide a solution.


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