Skip to content

Commit 997b49f

Browse files
authored
Backports for 1.10.2 (#53405)
Backported PRs: - [x] #53205 <!-- Profile: add notes to `print()` docs --> - [x] #53170 <!-- Remove outdated discussion about externally changing module bindings --> - [x] #53228 <!-- SubArray: avoid invalid elimination of singleton indices --> - [x] #51361 <!-- code_warntype docs: more neutral reference to @code_warntype --> - [x] #50480 <!-- Document --heap-size-hint in Command-line Interface --> - [x] #53301 <!-- Fix typo in `Sys.total_memory` docstring. --> - [x] #53354 <!-- fix code coverage bug in tail position and `else` --> - [x] #53388 <!-- Fix documentation: thread pool of main thread --> - [x] #53429 <!-- Subtype: skip slow-path in `local_∀_∃_subtype` if inputs contain no ∃ typevar. --> - [x] #53437 <!-- Add debug variant of loader_trampolines.o --> Need manual backport: - [ ] #52505 <!-- fix alignment of emit_unbox_store copy --> - [ ] #53373 <!-- fix sysimage-native-code=no option with pkgimages --> - [ ] #53439 <!-- staticdata: fix assert from partially disabled native code --> Contains multiple commits, manual intervention needed: - [ ] #52913 <!-- Added docstring for Artifacts.jl --> - [ ] #53218 <!-- Fix interpreter_exec.jl test --> Non-merged PRs with backport label: - [ ] #53424 <!-- yet more atomics & cache-line fixes on work-stealing queue --> - [ ] #53125 <!-- coverage: count coverage where explicitly requested by inference only --> - [ ] #52694 <!-- Reinstate similar for AbstractQ for backward compatibility --> - [ ] #51479 <!-- prevent code loading from lookin in the versioned environment when building Julia -->
2 parents 7790d6f + 5d971b9 commit 997b49f

File tree

26 files changed

+203
-88
lines changed

26 files changed

+203
-88
lines changed

base/compiler/ssair/inlining.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1811,7 +1811,9 @@ function ssa_substitute!(insert_node!::Inserter,
18111811
spvals_ssa::Union{Nothing, SSAValue},
18121812
linetable_offset::Int32, boundscheck::Symbol)
18131813
subst_inst[:flag] &= ~IR_FLAG_INBOUNDS
1814-
subst_inst[:line] += linetable_offset
1814+
if subst_inst[:line] != 0
1815+
subst_inst[:line] += linetable_offset
1816+
end
18151817
return ssa_substitute_op!(insert_node!, subst_inst,
18161818
val, arg_replacements, spsig, spvals, spvals_ssa, boundscheck)
18171819
end

base/compiler/ssair/passes.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,8 +1205,12 @@ function try_inline_finalizer!(ir::IRCode, argexprs::Vector{Any}, idx::Int,
12051205
ssa_rename[ssa.id]
12061206
end
12071207
stmt′ = ssa_substitute_op!(InsertBefore(ir, SSAValue(idx)), inst, stmt′, argexprs, mi.specTypes, mi.sparam_vals, sp_ssa, :default)
1208+
newline = inst[:line]
1209+
if newline != 0
1210+
newline += linetable_offset
1211+
end
12081212
ssa_rename[idx′] = insert_node!(ir, idx,
1209-
NewInstruction(inst; stmt=stmt′, line=inst[:line]+linetable_offset),
1213+
NewInstruction(inst; stmt=stmt′, line=newline),
12101214
attach_after)
12111215
end
12121216

base/subarray.jl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ _maybe_reshape_parent(A::AbstractArray, ::NTuple{1, Bool}) = reshape(A, Val(1))
127127
_maybe_reshape_parent(A::AbstractArray{<:Any,1}, ::NTuple{1, Bool}) = reshape(A, Val(1))
128128
_maybe_reshape_parent(A::AbstractArray{<:Any,N}, ::NTuple{N, Bool}) where {N} = A
129129
_maybe_reshape_parent(A::AbstractArray, ::NTuple{N, Bool}) where {N} = reshape(A, Val(N))
130+
# The trailing singleton indices could be eliminated after bounds checking.
131+
rm_singleton_indices(ndims::Tuple, J1, Js...) = (J1, rm_singleton_indices(IteratorsMD._splitrest(ndims, index_ndims(J1)), Js...)...)
132+
rm_singleton_indices(::Tuple{}, ::ScalarIndex, Js...) = rm_singleton_indices((), Js...)
133+
rm_singleton_indices(::Tuple) = ()
134+
130135
"""
131136
view(A, inds...)
132137
@@ -173,15 +178,12 @@ julia> view(2:5, 2:3) # returns a range as type is immutable
173178
3:4
174179
```
175180
"""
176-
function view(A::AbstractArray{<:Any,N}, I::Vararg{Any,M}) where {N,M}
181+
function view(A::AbstractArray, I::Vararg{Any,M}) where {M}
177182
@inline
178183
J = map(i->unalias(A,i), to_indices(A, I))
179184
@boundscheck checkbounds(A, J...)
180-
if length(J) > ndims(A) && J[N+1:end] isa Tuple{Vararg{Int}}
181-
# view([1,2,3], :, 1) does not need to reshape
182-
return unsafe_view(A, J[1:N]...)
183-
end
184-
unsafe_view(_maybe_reshape_parent(A, index_ndims(J...)), J...)
185+
J′ = rm_singleton_indices(ntuple(Returns(true), Val(ndims(A))), J...)
186+
unsafe_view(_maybe_reshape_parent(A, index_ndims(J′...)), J′...)
185187
end
186188

187189
# Ranges implement getindex to return recomputed ranges; use that for views, too (when possible)

base/sysinfo.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ free_memory() = ccall(:uv_get_available_memory, UInt64, ())
276276
277277
Get the total memory in RAM (including that which is currently used) in bytes.
278278
This amount may be constrained, e.g., by Linux control groups. For the unconstrained
279-
amount, see `Sys.physical_memory()`.
279+
amount, see `Sys.total_physical_memory()`.
280280
"""
281281
function total_memory()
282282
constrained = ccall(:uv_get_constrained_memory, UInt64, ())

cli/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ LIB_DOBJS := $(BUILDDIR)/loader_lib.dbg.obj
4747
# If this is an architecture that supports dynamic linking, link in a trampoline definition
4848
ifneq (,$(wildcard $(SRCDIR)/trampolines/trampolines_$(ARCH).S))
4949
LIB_OBJS += $(BUILDDIR)/loader_trampolines.o
50-
LIB_DOBJS += $(BUILDDIR)/loader_trampolines.o
50+
LIB_DOBJS += $(BUILDDIR)/loader_trampolines.dbg.obj
5151
endif
5252

5353
default: release
@@ -64,6 +64,8 @@ $(BUILDDIR)/loader_exe.dbg.obj : $(SRCDIR)/loader_exe.c $(HEADERS) $(JULIAHOME)/
6464
@$(call PRINT_CC, $(CC) $(DEBUGFLAGS) $(LOADER_CFLAGS) -c $< -o $@)
6565
$(BUILDDIR)/loader_trampolines.o : $(SRCDIR)/trampolines/trampolines_$(ARCH).S $(HEADERS) $(SRCDIR)/trampolines/common.h
6666
@$(call PRINT_CC, $(CC) $(SHIPFLAGS) $(LOADER_CFLAGS) $< -c -o $@)
67+
$(BUILDDIR)/loader_trampolines.dbg.obj : $(SRCDIR)/trampolines/trampolines_$(ARCH).S $(HEADERS) $(SRCDIR)/trampolines/common.h
68+
@$(call PRINT_CC, $(CC) $(DEBUGFLAGS) $(LOADER_CFLAGS) $< -c -o $@)
6769

6870
# Debugging target to help us see what kind of code is being generated for our trampolines
6971
dump-trampolines: $(SRCDIR)/trampolines/trampolines_$(ARCH).S
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
193abc96d1ea3a83096ba8401acbc5fa
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
17f7567be44c2ff3e2c567311cd716191127d0d0f9a4a226d7c06003a5b455343dd8e308032f942bb0a5b95e4b5defc530cc2cda9dfff482aab6f688080c20e7

deps/checksums/NetworkOptions-aab83e5dd900c874826d430e25158dff43559d78.tar.gz/md5

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

deps/checksums/NetworkOptions-aab83e5dd900c874826d430e25158dff43559d78.tar.gz/sha512

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

doc/src/manual/command-line-interface.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ The following is a complete list of command-line switches available when launchi
142142
|`--output-incremental={yes\|no*}` |Generate an incremental output file (rather than complete)|
143143
|`--trace-compile={stderr,name}` |Print precompile statements for methods compiled during execution or save to a path|
144144
|`--image-codegen` |Force generate code in imaging mode|
145+
|`--heap-size-hint=<size>` |Forces garbage collection if memory usage is higher than that value. The memory hint might be specified in megabytes (e.g., 500M) or gigabytes (e.g., 1G)|
145146

146147

147148
!!! compat "Julia 1.1"

0 commit comments

Comments
 (0)