Skip to content

Commit a3fc60a

Browse files
authored
Merge branch 'master' into gb/fix-multiversioning
2 parents 17f831f + a6c656e commit a3fc60a

File tree

107 files changed

+3097
-1063
lines changed

Some content is hidden

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

107 files changed

+3097
-1063
lines changed

NEWS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ Language changes
2323
allows users to safely tear down background state (such as closing Timers and sending
2424
disconnect notifications to heartbeat tasks) and cleanup other resources when the program
2525
wants to begin exiting.
26+
* Code coverage and malloc tracking is no longer generated during the package precompilation stage.
27+
Further, during these modes pkgimage caches are now used for packages that are not being tracked.
28+
Meaning that coverage testing (the default for `julia-actions/julia-runtest`) will by default use
29+
pkgimage caches for all other packages than the package being tested, likely meaning faster test
30+
execution. ([#52123])
2631

2732
Compiler/Runtime improvements
2833
-----------------------------
@@ -58,6 +63,9 @@ New library functions
5863

5964
New library features
6065
--------------------
66+
67+
* `invmod(n, T)` where `T` is a native integer type now computes the modular inverse of `n` in the modular integer ring that `T` defines ([#52180]).
68+
* `invmod(n)` is an abbreviation for `invmod(n, typeof(n))` for native integer types ([#52180]).
6169
* `replace(string, pattern...)` now supports an optional `IO` argument to
6270
write the output to a stream rather than returning a string ([#48625]).
6371
* `sizehint!(s, n)` now supports an optional `shrink` argument to disable shrinking ([#51929]).

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ and then use the command prompt to change into the resulting julia directory. By
9393
Julia. However, most users should use the [most recent stable version](https://github.com/JuliaLang/julia/releases)
9494
of Julia. You can get this version by running:
9595

96-
git checkout v1.9.3
96+
git checkout v1.9.4
9797

9898
To build the `julia` executable, run `make` from within the julia directory.
9999

base/array.jl

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ const DenseVecOrMat{T} = Union{DenseVector{T}, DenseMatrix{T}}
124124
@_safeindex
125125
126126
This internal macro converts:
127-
- `getindex(xs::Tuple, )` -> `__inbounds_getindex(args...)`
128-
- `setindex!(xs::Vector, args...)` -> `__inbounds_setindex!(xs, args...)`
127+
- `getindex(xs::Tuple, i::Int)` -> `__safe_getindex(xs, i)`
128+
- `setindex!(xs::Vector{T}, x, i::Int)` -> `__safe_setindex!(xs, x, i)`
129129
to tell the compiler that indexing operations within the applied expression are always
130130
inbounds and do not need to taint `:consistent` and `:nothrow`.
131131
"""
@@ -143,10 +143,10 @@ function _safeindex(__module__, ex)
143143
for i = 2:length(lhs.args)
144144
args[i-1] = _safeindex(__module__, lhs.args[i])
145145
end
146-
return Expr(:call, GlobalRef(__module__, :__inbounds_setindex!), xs, _safeindex(__module__, rhs), args...)
146+
return Expr(:call, GlobalRef(__module__, :__safe_setindex!), xs, _safeindex(__module__, rhs), args...)
147147
end
148148
elseif ex.head === :ref # xs[i]
149-
return Expr(:call, GlobalRef(__module__, :__inbounds_getindex), ex.args...)
149+
return Expr(:call, GlobalRef(__module__, :__safe_getindex), ex.args...)
150150
end
151151
args = Vector{Any}(undef, length(ex.args))
152152
for i = 1:length(ex.args)
@@ -236,13 +236,15 @@ sizeof(a::Array) = length(a) * elsize(typeof(a)) # n.b. this ignores bitsunion b
236236

237237
function isassigned(a::Array, i::Int...)
238238
@inline
239+
@_noub_if_noinbounds_meta
239240
@boundscheck checkbounds(Bool, a, i...) || return false
240241
ii = _sub2ind(size(a), i...)
241242
return @inbounds isassigned(memoryref(a.ref, ii, false))
242243
end
243244

244245
function isassigned(a::Vector, i::Int) # slight compiler simplification for the most common case
245246
@inline
247+
@_noub_if_noinbounds_meta
246248
@boundscheck checkbounds(Bool, a, i) || return false
247249
return @inbounds isassigned(memoryref(a.ref, i, false))
248250
end
@@ -962,29 +964,23 @@ Dict{String, Int64} with 2 entries:
962964
function setindex! end
963965

964966
function setindex!(A::Array{T}, x, i::Int) where {T}
967+
@_noub_if_noinbounds_meta
965968
@boundscheck (i - 1)%UInt < length(A)%UInt || throw_boundserror(A, (i,))
966969
memoryrefset!(memoryref(A.ref, i, false), x isa T ? x : convert(T,x)::T, :not_atomic, false)
967970
return A
968971
end
969972
function setindex!(A::Array{T}, x, i1::Int, i2::Int, I::Int...) where {T}
970973
@inline
974+
@_noub_if_noinbounds_meta
971975
@boundscheck checkbounds(A, i1, i2, I...) # generally _to_linear_index requires bounds checking
972976
memoryrefset!(memoryref(A.ref, _to_linear_index(A, i1, i2, I...), false), x isa T ? x : convert(T,x)::T, :not_atomic, false)
973977
return A
974978
end
975979

976-
function __inbounds_setindex!(A::Array{T}, x, i::Int) where {T}
977-
@inline
978-
val = x isa T ? x : convert(T,x)::T
979-
memoryrefset!(memoryref(A.ref, i, false), val, :not_atomic, false)
980-
return A
981-
end
982-
function __inbounds_setindex!(A::Array{T}, x, i1::Int, i2::Int, I::Int...) where {T}
983-
@inline
984-
val = x isa T ? x : convert(T,x)::T
985-
memoryrefset!(memoryref(A.ref, _to_linear_index(A, i1, i2, I...), false), val, :not_atomic, false)
986-
return A
987-
end
980+
__safe_setindex!(A::Vector{T}, x::T, i::Int) where {T} = (@inline; @_nothrow_noub_meta;
981+
memoryrefset!(memoryref(A.ref, i, false), x, :not_atomic, false); return A)
982+
__safe_setindex!(A::Vector{T}, x, i::Int) where {T} = (@inline;
983+
__safe_setindex!(A, convert(T, x)::T, i))
988984

989985
# This is redundant with the abstract fallbacks but needed and helpful for bootstrap
990986
function setindex!(A::Array, X::AbstractArray, I::AbstractVector{Int})

base/boot.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@ macro _foldable_meta()
281281
#=:terminates_locally=#false,
282282
#=:notaskstate=#true,
283283
#=:inaccessiblememonly=#true,
284-
#=:noub=#true))
284+
#=:noub=#true,
285+
#=:noub_if_noinbounds=#false))
285286
end
286287

287288
macro inline() Expr(:meta, :inline) end
@@ -478,14 +479,14 @@ eval(Core, quote
478479
end)
479480

480481
function CodeInstance(
481-
mi::MethodInstance, @nospecialize(rettype), @nospecialize(inferred_const),
482+
mi::MethodInstance, @nospecialize(rettype), @nospecialize(exctype), @nospecialize(inferred_const),
482483
@nospecialize(inferred), const_flags::Int32, min_world::UInt, max_world::UInt,
483-
ipo_effects::UInt32, effects::UInt32, @nospecialize(argescapes#=::Union{Nothing,Vector{ArgEscapeInfo}}=#),
484+
ipo_effects::UInt32, effects::UInt32, @nospecialize(analysis_results),
484485
relocatability::UInt8)
485486
return ccall(:jl_new_codeinst, Ref{CodeInstance},
486-
(Any, Any, Any, Any, Int32, UInt, UInt, UInt32, UInt32, Any, UInt8),
487-
mi, rettype, inferred_const, inferred, const_flags, min_world, max_world,
488-
ipo_effects, effects, argescapes,
487+
(Any, Any, Any, Any, Any, Int32, UInt, UInt, UInt32, UInt32, Any, UInt8),
488+
mi, rettype, exctype, inferred_const, inferred, const_flags, min_world, max_world,
489+
ipo_effects, effects, analysis_results,
489490
relocatability)
490491
end
491492
GlobalRef(m::Module, s::Symbol) = ccall(:jl_module_globalref, Ref{GlobalRef}, (Any, Any), m, s)

base/c.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,6 @@ macro ccall(expr)
409409
return ccall_macro_lower(:ccall, ccall_macro_parse(expr)...)
410410
end
411411

412-
macro ccall_effects(effects::UInt8, expr)
412+
macro ccall_effects(effects::UInt16, expr)
413413
return ccall_macro_lower((:ccall, effects), ccall_macro_parse(expr)...)
414414
end

0 commit comments

Comments
 (0)