Skip to content

Commit 213feae

Browse files
authored
Backports for Julia 1.10.8 (#56653)
2 parents 4976d05 + 4d7bdbf commit 213feae

File tree

44 files changed

+365
-41
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+365
-41
lines changed

base/abstractdict.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ Return an iterator over all keys in a dictionary.
8686
When the keys are stored internally in a hash table,
8787
as is the case for `Dict`,
8888
the order in which they are returned may vary.
89-
But `keys(a)` and `values(a)` both iterate `a` and
90-
return the elements in the same order.
89+
But `keys(a)`, `values(a)` and `pairs(a)` all iterate `a`
90+
and return the elements in the same order.
9191
9292
# Examples
9393
```jldoctest
@@ -112,8 +112,8 @@ Return an iterator over all values in a collection.
112112
When the values are stored internally in a hash table,
113113
as is the case for `Dict`,
114114
the order in which they are returned may vary.
115-
But `keys(a)` and `values(a)` both iterate `a` and
116-
return the elements in the same order.
115+
But `keys(a)`, `values(a)` and `pairs(a)` all iterate `a`
116+
and return the elements in the same order.
117117
118118
# Examples
119119
```jldoctest
@@ -136,6 +136,10 @@ values(a::AbstractDict) = ValueIterator(a)
136136
Return an iterator over `key => value` pairs for any
137137
collection that maps a set of keys to a set of values.
138138
This includes arrays, where the keys are the array indices.
139+
When the entries are stored internally in a hash table,
140+
as is the case for `Dict`, the order in which they are returned may vary.
141+
But `keys(a)`, `values(a)` and `pairs(a)` all iterate `a`
142+
and return the elements in the same order.
139143
140144
# Examples
141145
```jldoctest

base/binaryplatforms.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ const arch_mapping = Dict(
593593
"armv7l" => "arm(v7l)?", # if we just see `arm-linux-gnueabihf`, we assume it's `armv7l`
594594
"armv6l" => "armv6l",
595595
"powerpc64le" => "p(ower)?pc64le",
596+
"riscv64" => "(rv64|riscv64)",
596597
)
597598
# Keep this in sync with `CPUID.ISAs_by_family`
598599
# These are the CPUID side of the microarchitectures targeted by GCC flags in BinaryBuilder.jl

base/compiler/ssair/domtree.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,8 @@ end
644644
Compute the nearest common (post-)dominator of `a` and `b`.
645645
"""
646646
function nearest_common_dominator(domtree::GenericDomTree, a::BBNumber, b::BBNumber)
647+
a == 0 && return a
648+
b == 0 && return b
647649
alevel = domtree.nodes[a].level
648650
blevel = domtree.nodes[b].level
649651
# W.l.g. assume blevel <= alevel

base/compiler/ssair/passes.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,6 +1294,7 @@ function try_resolve_finalizer!(ir::IRCode, idx::Int, finalizer_idx::Int, defuse
12941294
end
12951295
all(check_defuse, defuse.uses) || return nothing
12961296
all(check_defuse, defuse.defs) || return nothing
1297+
bb_insert_block != 0 || return nothing # verify post-dominator of all uses exists
12971298

12981299
# Check #3
12991300
dominates(domtree, finalizer_bb, bb_insert_block) || return nothing

base/docs/basedocs.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ kw"new"
14411441
"""
14421442
where
14431443
1444-
The `where` keyword creates a type that is an iterated union of other types, over all
1444+
The `where` keyword creates a [`UnionAll`](@ref) type, which may be thought of as an iterated union of other types, over all
14451445
values of some variable. For example `Vector{T} where T<:Real` includes all [`Vector`](@ref)s
14461446
where the element type is some kind of `Real` number.
14471447
@@ -3296,6 +3296,9 @@ unused and delete the entire benchmark code).
32963296
!!! compat "Julia 1.8"
32973297
This method was added in Julia 1.8.
32983298
3299+
!!! compat "Julia 1.8"
3300+
This method was added in Julia 1.8.
3301+
32993302
# Examples
33003303
33013304
```julia

base/loading.jl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,12 @@ end
613613
## generic project & manifest API ##
614614

615615
const project_names = ("JuliaProject.toml", "Project.toml")
616-
const manifest_names = ("JuliaManifest.toml", "Manifest.toml")
616+
const manifest_names = (
617+
"JuliaManifest-v$(VERSION.major).$(VERSION.minor).toml",
618+
"Manifest-v$(VERSION.major).$(VERSION.minor).toml",
619+
"JuliaManifest.toml",
620+
"Manifest.toml",
621+
)
617622
const preferences_names = ("JuliaLocalPreferences.toml", "LocalPreferences.toml")
618623

619624
function locate_project_file(env::String)
@@ -1215,6 +1220,7 @@ function run_module_init(mod::Module, i::Int=1)
12151220
end
12161221

12171222
function run_package_callbacks(modkey::PkgId)
1223+
(modkey == precompilation_target) && return nothing
12181224
run_extension_callbacks(modkey)
12191225
assert_havelock(require_lock)
12201226
unlock(require_lock)
@@ -1338,7 +1344,7 @@ function _insert_extension_triggers(parent::PkgId, extensions::Dict{String, Any}
13381344
# TODO: Better error message if this lookup fails?
13391345
uuid_trigger = UUID(totaldeps[trigger]::String)
13401346
trigger_id = PkgId(uuid_trigger, trigger)
1341-
if !haskey(Base.loaded_modules, trigger_id) || haskey(package_locks, trigger_id)
1347+
if !haskey(Base.loaded_modules, trigger_id) || haskey(package_locks, trigger_id) || (trigger_id == precompilation_target)
13421348
trigger1 = get!(Vector{ExtensionId}, EXT_DORMITORY, trigger_id)
13431349
push!(trigger1, gid)
13441350
else
@@ -1350,6 +1356,7 @@ end
13501356

13511357
loading_extension::Bool = false
13521358
precompiling_extension::Bool = false
1359+
precompilation_target::Union{Nothing,PkgId} = nothing
13531360
function run_extension_callbacks(extid::ExtensionId)
13541361
assert_havelock(require_lock)
13551362
succeeded = try
@@ -2342,6 +2349,7 @@ function create_expr_cache(pkg::PkgId, input::String, output::String, output_o::
23422349
write(io.in, """
23432350
empty!(Base.EXT_DORMITORY) # If we have a custom sysimage with `EXT_DORMITORY` prepopulated
23442351
Base.precompiling_extension = $(loading_extension)
2352+
Base.precompilation_target = $(pkg_str(pkg))
23452353
Base.include_package_for_output($(pkg_str(pkg)), $(repr(abspath(input))), $(repr(depot_path)), $(repr(dl_load_path)),
23462354
$(repr(load_path)), $deps, $(repr(source_path(nothing))))
23472355
""")

base/mathconstants.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ end
2929
Base.@assume_effects :foldable function (::Type{T})(x::_KnownIrrational, r::RoundingMode) where {T<:Union{Float32,Float64}}
3030
Base._irrational_to_float(T, x, r)
3131
end
32-
Base.@assume_effects :foldable function rationalize(::Type{T}, x::_KnownIrrational; tol::Real=0) where {T<:Integer}
32+
Base.@assume_effects :foldable function Base.rationalize(::Type{T}, x::_KnownIrrational; tol::Real=0) where {T<:Integer}
3333
Base._rationalize_irrational(T, x, tol)
3434
end
3535
Base.@assume_effects :foldable function Base.lessrational(rx::Rational, x::_KnownIrrational)

base/meta.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,15 @@ function _partially_inline!(@nospecialize(x), slot_replacements::Vector{Any},
365365
return x
366366
end
367367
if isa(x, Core.ReturnNode)
368+
# Unreachable doesn't have val defined
369+
if !isdefined(x, :val)
370+
return x
371+
else
368372
return Core.ReturnNode(
369373
_partially_inline!(x.val, slot_replacements, type_signature, static_param_values,
370374
slot_offset, statement_offset, boundscheck),
371375
)
376+
end
372377
end
373378
if isa(x, Core.GotoIfNot)
374379
return Core.GotoIfNot(

base/special/exp.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ end
216216
small_part = muladd(jU, expm1b_kernel(base, r), jL) + jU
217217

218218
if !(abs(x) <= SUBNORM_EXP(base, T))
219+
isnan(x) && return x
219220
x >= MAX_EXP(base, T) && return Inf
220221
x <= MIN_EXP(base, T) && return 0.0
221222
if k <= -53
@@ -243,6 +244,7 @@ end
243244
hi, lo = Base.canonicalize2(1.0, kern)
244245
small_part = fma(jU, hi, muladd(jU, (lo+xlo), very_small))
245246
if !(abs(x) <= SUBNORM_EXP(base, T))
247+
isnan(x) && return x
246248
x >= MAX_EXP(base, T) && return Inf
247249
x <= MIN_EXP(base, T) && return 0.0
248250
if k <= -53

deps/checksums/Pkg-06f7a7e5bb0fedc20455060d6778f5a66851c026.tar.gz/md5

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)