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

Backports release 1.11 #53472

Merged
merged 25 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7dad444
🤖 [master] Bump the SparseArrays stdlib from c9f7293 to cb602d7 (#53361)
DilumAluthgeBot Feb 16, 2024
913f7d5
allow external absint to hold custom data in `codeinst.inferred` (#53…
aviatesk Feb 17, 2024
008d109
add Base.wrap to docs
fatteneder Feb 15, 2024
162bbfb
silence warnings in tests introduced in #33593
fatteneder Feb 17, 2024
43dc98a
🤖 [master] Bump the Pkg stdlib from 6dd0e7c9e to 76070d295 (#53357)
DilumAluthgeBot Feb 19, 2024
d5dcb94
fix sysimage-native-code=no option with pkgimages (#53373)
vtjnash Feb 19, 2024
f287e8a
More consistent return value for annotations, take 2 (#53333)
tecosaur Feb 20, 2024
6af3596
fix code coverage bug in tail position and `else` (#53354)
JeffBezanson Feb 20, 2024
2d6c154
fix sysimage-native-code=yes option (#53407)
vtjnash Feb 21, 2024
2fdf5df
Fix documentation: thread pool of main thread (#53388)
carstenbauer Feb 21, 2024
06e52c5
Fix synchronization issue on the GC scheduler (#53355)
gbaraldi Feb 22, 2024
d57e7f7
Subtype: skip slow-path in `local_∀_∃_subtype` if inputs contain no ∃…
N5N3 Feb 22, 2024
63ebed7
Add debug variant of loader_trampolines.o (#53437)
fingolfin Feb 23, 2024
99ad63e
Add annotate! method for AnnotatedIOBuffer (#53284)
tecosaur Feb 23, 2024
d49cdf5
[MozillaCACerts_jll] Update to v2023-12-12 (#53466)
giordano Feb 25, 2024
923789b
[LibGit2_jll] Update to v1.7.2 (#53467)
giordano Feb 26, 2024
103f96f
add being able to pass a `CacheFlags()` to `isprecompiled` to verify …
KristofferC Feb 19, 2024
00cbe4a
when loading code for internal purposes, load stdlib files directly(#…
vtjnash Feb 23, 2024
945c93f
Add `Sys.isreadable, Sys.iswriteable`, update `ispath` (#53320)
fatteneder Feb 20, 2024
4141f35
staticdata: fix assert from partially disabled native code (#53439)
vtjnash Feb 23, 2024
7a95a0c
Prevent tainting native code loading from propagating (#53457)
vchuravy Feb 25, 2024
ba189d8
Add update mechanism for Terminfo, and common user-alias data (#53285)
fingolfin Feb 23, 2024
0f0f8eb
minor fixes on test/precompile.jl (#53476)
aviatesk Feb 27, 2024
7ef180e
protect against PkgId and UUID being imported and losing Base prefix …
IanButterworth Feb 22, 2024
d6bbf85
post-opt analysis: fix conditional successor visitation logic (#53518)
aviatesk Mar 1, 2024
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
3 changes: 1 addition & 2 deletions base/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,7 @@ function profile_printing_listener(cond::Base.AsyncCondition)
profile = nothing
try
while _trywait(cond)
# this call to require is mostly legal, only because Profile has no dependencies and is usually in LOAD_PATH
profile = @something(profile, require(PkgId(UUID("9abbd945-dff8-562f-b5e8-e1ebf5ef1b79"), "Profile")))::Module
profile = @something(profile, require_stdlib(PkgId(UUID("9abbd945-dff8-562f-b5e8-e1ebf5ef1b79"), "Profile")))::Module
invokelatest(profile.peek_report[])
if Base.get_bool_env("JULIA_PROFILE_PEEK_HEAP_SNAPSHOT", false) === true
println(stderr, "Saving heap snapshot...")
Expand Down
7 changes: 4 additions & 3 deletions base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ function exec_options(opts)
# Load Distributed module only if any of the Distributed options have been specified.
distributed_mode = (opts.worker == 1) || (opts.nprocs > 0) || (opts.machine_file != C_NULL)
if distributed_mode
let Distributed = require(PkgId(UUID((0x8ba89e20_285c_5b6f, 0x9357_94700520ee1b)), "Distributed"))
let Distributed = require_stdlib(PkgId(UUID((0x8ba89e20_285c_5b6f, 0x9357_94700520ee1b)), "Distributed"))
Core.eval(MainInclude, :(const Distributed = $Distributed))
Core.eval(Main, :(using Base.MainInclude.Distributed))
end
Expand Down Expand Up @@ -386,7 +386,8 @@ function load_InteractiveUtils(mod::Module=Main)
# load interactive-only libraries
if !isdefined(MainInclude, :InteractiveUtils)
try
let InteractiveUtils = require(PkgId(UUID(0xb77e0a4c_d291_57a0_90e8_8db25a27a240), "InteractiveUtils"))
# TODO: we have to use require_stdlib here because it is a dependency of REPL, but we would sort of prefer not to
let InteractiveUtils = require_stdlib(PkgId(UUID(0xb77e0a4c_d291_57a0_90e8_8db25a27a240), "InteractiveUtils"))
Core.eval(MainInclude, :(const InteractiveUtils = $InteractiveUtils))
end
catch ex
Expand All @@ -401,7 +402,7 @@ end
function load_REPL()
# load interactive-only libraries
try
return Base.require(PkgId(UUID(0x3fa0cd96_eef1_5676_8a61_b3b8758bbffb), "REPL"))
return Base.require_stdlib(PkgId(UUID(0x3fa0cd96_eef1_5676_8a61_b3b8758bbffb), "REPL"))
catch ex
@warn "Failed to import REPL" exception=(ex, catch_backtrace())
end
Expand Down
21 changes: 14 additions & 7 deletions base/compiler/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -534,17 +534,22 @@ function any_stmt_may_throw(ir::IRCode, bb::Int)
return false
end

function conditional_successors_may_throw(lazypostdomtree::LazyPostDomtree, ir::IRCode, bb::Int)
function visit_conditional_successors(callback, lazypostdomtree::LazyPostDomtree, ir::IRCode, bb::Int)
visited = BitSet((bb,))
worklist = Int[bb]
while !isempty(worklist)
thisbb = pop!(worklist)
thisbb = popfirst!(worklist)
for succ in ir.cfg.blocks[thisbb].succs
succ in visited && continue
push!(visited, succ)
postdominates(get!(lazypostdomtree), succ, thisbb) && continue
any_stmt_may_throw(ir, succ) && return true
push!(worklist, succ)
if postdominates(get!(lazypostdomtree), succ, bb)
# this successor is not conditional, so no need to visit it further
continue
elseif callback(succ)
return true
else
push!(worklist, succ)
end
end
end
return false
Expand Down Expand Up @@ -836,8 +841,10 @@ function ((; sv)::ScanStmt)(inst::Instruction, lstmt::Int, bb::Int)
# inconsistent region.
if !sv.result.ipo_effects.terminates
sv.all_retpaths_consistent = false
elseif conditional_successors_may_throw(sv.lazypostdomtree, sv.ir, bb)
# Check if there are potential throws that require
elseif visit_conditional_successors(sv.lazypostdomtree, sv.ir, bb) do succ::Int
return any_stmt_may_throw(sv.ir, succ)
end
# check if this `GotoIfNot` leads to conditional throws, which taints consistency
sv.all_retpaths_consistent = false
else
(; cfg, domtree) = get!(sv.lazyagdomtree)
Expand Down
4 changes: 3 additions & 1 deletion base/compiler/ssair/inlining.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1818,7 +1818,9 @@ end

function ssa_substitute!(insert_node!::Inserter, subst_inst::Instruction, @nospecialize(val),
ssa_substitute::SSASubstitute)
subst_inst[:line] += ssa_substitute.linetable_offset
if subst_inst[:line] != 0
subst_inst[:line] += ssa_substitute.linetable_offset
end
return ssa_substitute_op!(insert_node!, subst_inst, val, ssa_substitute)
end

Expand Down
6 changes: 5 additions & 1 deletion base/compiler/ssair/passes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1519,8 +1519,12 @@ function try_inline_finalizer!(ir::IRCode, argexprs::Vector{Any}, idx::Int,
ssa_rename[ssa.id]
end
stmt′ = ssa_substitute_op!(InsertBefore(ir, SSAValue(idx)), inst, stmt′, ssa_substitute)
newline = inst[:line]
if newline != 0
newline += ssa_substitute.linetable_offset
end
ssa_rename[idx′] = insert_node!(ir, idx,
NewInstruction(inst; stmt=stmt′, line=inst[:line]+ssa_substitute.linetable_offset),
NewInstruction(inst; stmt=stmt′, line=newline),
attach_after)
end

Expand Down
9 changes: 3 additions & 6 deletions base/compiler/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -373,20 +373,17 @@ end
function NativeInterpreter(world::UInt = get_world_counter();
inf_params::InferenceParams = InferenceParams(),
opt_params::OptimizationParams = OptimizationParams())
curr_max_world = get_world_counter()
# Sometimes the caller is lazy and passes typemax(UInt).
# we cap it to the current world age for correctness
if world == typemax(UInt)
world = get_world_counter()
world = curr_max_world
end

# If they didn't pass typemax(UInt) but passed something more subtly
# incorrect, fail out loudly.
@assert world <= get_world_counter()

@assert world <= curr_max_world
method_table = CachedMethodTable(InternalMethodTable(world))

inf_cache = Vector{InferenceResult}() # Initially empty cache

return NativeInterpreter(world, method_table, inf_cache, inf_params, opt_params)
end

Expand Down
Loading