Skip to content

Commit 5dc2b5a

Browse files
topolaritykpamnany
authored andcommitted
Don't filter Core methods from newly-inferred list
Now that we re-export quite a lot from `Core` it seems sensible to remove. This allows constructors like `Tuple{Type{Vector{Foo}}, UndefInitializer, Tuple{Int}}` to precompile properly. Appears to have a minimal effect on the stdlib pkgimages: ```julia --- before.txt 2025-05-23 08:36:20.171870043 -0400 +++ after.txt 2025-05-22 14:48:49.003869097 -0400 @@ -47,7 +47,7 @@ 20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so 20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so 3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so -3.6M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so +3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so 28K ../julia/usr/share/julia/compiled/v1.13/MozillaCACerts_jll/pkgimage.so ```
1 parent 010d301 commit 5dc2b5a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

base/compiler/cicache.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ ranges. This struct abstracts over access to this cache.
1010
struct InternalCodeCache end
1111

1212
function setindex!(cache::InternalCodeCache, ci::CodeInstance, mi::MethodInstance)
13+
@assert ci.owner === cache.owner
14+
m = mi.def
15+
if isa(m, Method)
16+
ccall(:jl_push_newly_inferred, Cvoid, (Any,), ci)
17+
end
1318
ccall(:jl_mi_cache_insert, Cvoid, (Any, Any), mi, ci)
1419
return cache
1520
end

test/precompile.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1812,7 +1812,6 @@ precompile_test_harness("Issue #50538") do load_path
18121812
@test !isdefined(I50538, :undefglobal)
18131813
end
18141814

1815-
18161815
empty!(Base.DEPOT_PATH)
18171816
append!(Base.DEPOT_PATH, original_depot_path)
18181817
empty!(Base.LOAD_PATH)

0 commit comments

Comments
 (0)