Skip to content

Commit

Permalink
Backports for 1.10.3 (#53714)
Browse files Browse the repository at this point in the history
Backported PRs:
- [x] #50759 <!-- Fix outdated usage of scrubbing for log test failures
-->
- [x] #51830 <!-- Add version string to sysimg triple -->
- [x] #53273 <!-- [REPL] Fix typo in using/import completion -->
- [x] #53499 <!-- Avoid compiler warning about redefining jl_globalref_t
-->
- [x] #53424 <!-- yet more atomics & cache-line fixes on work-stealing
queue -->
- [x] #53596 <!-- build: remove extra .a file -->
- [x] #53516 <!-- permit NamedTuple{<:Any, Union{}} to be created -->
- [x] #53643 <!-- Bump CSL to 1.1.1 to fix libgomp bug -->
- [x] #53655 <!-- Change tbaa of ptr_phi to tbaa_value  -->
- [x] #53391 <!-- Default to the medium code model in x86 linux -->
- [x] #53809 <!-- Add missing GC_POP() in emit_cfunction -->
- [x] #53961 <!-- `LazyString` in `LinearAlgebra.checksquare` error
message -->
- [x] #52913 <!-- Added docstring for Artifacts.jl -->
- [x] #53553 <!-- typeintersect: fix `UnionAll` unaliasing bug caused by
  • Loading branch information
KristofferC authored Apr 22, 2024
2 parents bd47eca + 5cf5146 commit c7bceb6
Show file tree
Hide file tree
Showing 47 changed files with 331 additions and 202 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ else ifeq ($(JULIA_BUILD_MODE),debug)
-$(INSTALL_M) $(build_libdir)/libjulia-internal-debug.dll.a $(DESTDIR)$(libdir)/
endif
-$(INSTALL_M) $(wildcard $(build_private_libdir)/*.a) $(DESTDIR)$(private_libdir)/
-rm -f $(DESTDIR)$(private_libdir)/sys-o.a

# We have a single exception; we want 7z.dll to live in private_libexecdir,
# not bindir, so that 7z.exe can find it.
Expand Down
4 changes: 2 additions & 2 deletions base/boot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -624,8 +624,8 @@ eval(Core, :(NamedTuple{names}(args::Tuple) where {names} =

using .Intrinsics: sle_int, add_int

eval(Core, :(NamedTuple{names,T}(args::T) where {names, T <: Tuple} =
$(Expr(:splatnew, :(NamedTuple{names,T}), :args))))
eval(Core, :((NT::Type{NamedTuple{names,T}})(args::T) where {names, T <: Tuple} =
$(Expr(:splatnew, :NT, :args))))

# constructors for built-in types

Expand Down
2 changes: 1 addition & 1 deletion base/compiler/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2565,7 +2565,7 @@ function refine_partial_type(@nospecialize t)
# if the first/second parameter of `NamedTuple` is known to be empty,
# the second/first argument should also be empty tuple type,
# so refine it here
return Const(NamedTuple())
return Const((;))
end
return t
end
Expand Down
19 changes: 8 additions & 11 deletions base/namedtuple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,24 +112,24 @@ Core.NamedTuple

if nameof(@__MODULE__) === :Base

@eval function NamedTuple{names,T}(args::Tuple) where {names, T <: Tuple}
@eval function (NT::Type{NamedTuple{names,T}})(args::Tuple) where {names, T <: Tuple}
if length(args) != length(names::Tuple)
throw(ArgumentError("Wrong number of arguments to named tuple constructor."))
end
# Note T(args) might not return something of type T; e.g.
# Tuple{Type{Float64}}((Float64,)) returns a Tuple{DataType}
$(Expr(:splatnew, :(NamedTuple{names,T}), :(T(args))))
$(Expr(:splatnew, :NT, :(T(args))))
end

function NamedTuple{names, T}(nt::NamedTuple) where {names, T <: Tuple}
function (NT::Type{NamedTuple{names, T}})(nt::NamedTuple) where {names, T <: Tuple}
if @generated
Expr(:new, :(NamedTuple{names, T}),
Any[ :(let Tn = fieldtype(T, $n),
Expr(:new, :NT,
Any[ :(let Tn = fieldtype(NT, $n),
ntn = getfield(nt, $(QuoteNode(names[n])))
ntn isa Tn ? ntn : convert(Tn, ntn)
end) for n in 1:length(names) ]...)
else
NamedTuple{names, T}(map(Fix1(getfield, nt), names))
NT(map(Fix1(getfield, nt), names))
end
end

Expand All @@ -145,14 +145,11 @@ function NamedTuple{names}(nt::NamedTuple) where {names}
end
end

NamedTuple{names, T}(itr) where {names, T <: Tuple} = NamedTuple{names, T}(T(itr))
NamedTuple{names}(itr) where {names} = NamedTuple{names}(Tuple(itr))
(NT::Type{NamedTuple{names, T}})(itr) where {names, T <: Tuple} = NT(T(itr))
(NT::Type{NamedTuple{names}})(itr) where {names} = NT(Tuple(itr))

NamedTuple(itr) = (; itr...)

# avoids invalidating Union{}(...)
NamedTuple{names, Union{}}(itr::Tuple) where {names} = throw(MethodError(NamedTuple{names, Union{}}, (itr,)))

end # if Base

# Like NamedTuple{names, T} as a constructor, but omits the additional
Expand Down
9 changes: 6 additions & 3 deletions base/reshapedarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ offset_if_vec(i::Integer, axs::Tuple) = i

@inline function isassigned(A::ReshapedArrayLF, index::Int)
@boundscheck checkbounds(Bool, A, index) || return false
@inbounds ret = isassigned(parent(A), index)
indexparent = index - firstindex(A) + firstindex(parent(A))
@inbounds ret = isassigned(parent(A), indexparent)
ret
end
@inline function isassigned(A::ReshapedArray{T,N}, indices::Vararg{Int, N}) where {T,N}
Expand All @@ -241,7 +242,8 @@ end

@inline function getindex(A::ReshapedArrayLF, index::Int)
@boundscheck checkbounds(A, index)
@inbounds ret = parent(A)[index]
indexparent = index - firstindex(A) + firstindex(parent(A))
@inbounds ret = parent(A)[indexparent]
ret
end
@inline function getindex(A::ReshapedArray{T,N}, indices::Vararg{Int,N}) where {T,N}
Expand All @@ -265,7 +267,8 @@ end

@inline function setindex!(A::ReshapedArrayLF, val, index::Int)
@boundscheck checkbounds(A, index)
@inbounds parent(A)[index] = val
indexparent = index - firstindex(A) + firstindex(parent(A))
@inbounds parent(A)[indexparent] = val
val
end
@inline function setindex!(A::ReshapedArray{T,N}, val, indices::Vararg{Int,N}) where {T,N}
Expand Down
2 changes: 1 addition & 1 deletion deps/JuliaSyntax.version
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
JULIASYNTAX_BRANCH = main
JULIASYNTAX_BRANCH = release-0.4
JULIASYNTAX_SHA1 = 4f1731d6ce7c2465fc21ea245110b7a39f34658a
JULIASYNTAX_GIT_URL := https://github.com/JuliaLang/JuliaSyntax.jl.git
JULIASYNTAX_TAR_URL = https://api.github.com/repos/JuliaLang/JuliaSyntax.jl/tarball/$1

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d2ccb9b91b0700bfb5ac7c01a03b4322
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
051223ab45dce692c0bbea0755cc0057bb3322a40659c092007799932a10cc23e80ee6b88fa0d86f28af5e7fe5a455cc9fb8267c76af0cd2b425cf2718629e91

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9ebc3751d48af21e9f932cfcb3b18781
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
adeedc81fee8360d427e3870d7b7861d0e653128c59c877ab1173284f19506ff2beeea063281ced3f5411be6a25dcca7c566e16eba21b7e91bbdcb2f5de8e268

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
75f38189d82446a19495d79daf5e2ed8
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f3bddf45ae180a00f51d04b5307b993220be7ddaef01cd36bc921a19e70c8268f302d39dd08b8fe7367763fde61c05fb9dab80d5374cc029262ce3640bab5037
Loading

0 comments on commit c7bceb6

Please sign in to comment.