Skip to content

Commit c7504f7

Browse files
committed
Various fixes
1 parent 1cccfae commit c7504f7

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/workloads.jl

+8-7
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ function workload_enabled(mod::Module)
1212
end
1313
end
1414

15-
@noinline function precompile_newly_inferred(cis)
15+
cache_newly_inferred() = ccall(:jl_set_newly_inferred, Cvoid, (Any,), newly_inferred)
16+
17+
@noinline function precompile_newly_inferred()
1618
ccall(:jl_set_newly_inferred, Cvoid, (Any,), nothing) # ensure we drop internally references to both newly_inferred arrays so that it is safe to access them here
17-
for child in cis # set the must-precompile bit on all new code
19+
for child in newly_inferred # set the must-precompile bit on all new code
1820
precompile_mi((child::Base.CodeInstance).def)
1921
end
20-
append!(Base.newly_inferred, cis) # request the new code be included in the serialized file
21-
empty!(cis)
22+
append!(Base.newly_inferred, newly_inferred) # request the new code be included in the serialized file
23+
empty!(newly_inferred)
2224
nothing
2325
end
2426

@@ -59,13 +61,12 @@ macro compile_workload(ex::Expr)
5961
end
6062
end
6163
ex = quote
62-
ccall(:jl_set_newly_inferred, Cvoid, (Any,), newly_inferred)
64+
$PrecompileTools.cache_newly_inferred()
6365
try
6466
$ex
6567
finally
66-
ccall(:jl_set_newly_inferred, Cvoid, (Any,), nothing)
68+
$PrecompileTools.precompile_newly_inferred()
6769
end
68-
$PrecompileTools.precompile_newly_inferred(newly_inferred)
6970
end
7071
return quote
7172
if $iscompiling || $PrecompileTools.verbose[]

test/runtests.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ using Base: specializations
2222
for mi in specializations(m)
2323
mi === nothing && continue
2424
sig = Base.unwrap_unionall(mi.specTypes)
25-
if sig.parameters[2] == PC_A.MyType && sig.parameters[3] == Vector{PC_A.MyType}
25+
if sig == Tuple{typeof(PC_A.call_findfirst), PC_A.MyType, Vector{PC_A.MyType}}
2626
count += 1
2727
end
2828
end

0 commit comments

Comments
 (0)