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 1.5.4 #39351

Merged
merged 18 commits into from
Feb 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
fd3af72
Fix segfault in static_show, by using correct `vt` instead of `typeof…
NHDaly Nov 19, 2020
fd30588
update to utf8proc 2.6 (#38551)
stevengj Nov 25, 2020
65f39a7
update to utf8proc 2.6.1 (#38900)
stevengj Dec 16, 2020
8dbf798
added automatic keyword assignment support to test macro (#38270)
DebadityaPal Jan 7, 2021
ae8c3a0
aotcompile: avoid cache lookup when disallowed (#39265)
vtjnash Jan 18, 2021
4f70156
Merge pull request #38679 from JuliaLang/tb/excstack_without_handler
maleadt Dec 4, 2020
24a4637
fix fields description of Module type (#37645)
vtjnash Sep 21, 2020
d179f48
fix #38386, macro defining empty function with escaped name (#38402)
JeffBezanson Nov 23, 2020
94af03e
Fix === and objectid of object with undef inline immutable field (#37…
yuyichao Sep 16, 2020
b9ba10a
fix #37872, avoid cycles in codegen for `===`
JeffBezanson Oct 6, 2020
a4ac1f9
fix #37880, overflow in shift amount range check in codegen (#37891)
JeffBezanson Oct 6, 2020
9fc38b8
restore explicit module field to LineNumberNode
vtjnash Aug 27, 2020
7b05f42
coverage: ensure definition line is also counted
vtjnash Jan 22, 2021
8684c3d
[release-1.5] Backport libuv patch to include `DELETE` winacl patch
staticfloat Jan 22, 2021
1c3326f
improve performance of disabling finalizers in locks
JeffBezanson Jan 8, 2021
cb75d49
fix failing `enable_finalizers` test
JeffBezanson Jan 20, 2021
c39f8c5
Set NDEBUG when LLVM assertions are disabled
ararslan Feb 19, 2021
81c044a
Correctly propagate LLVM assert flags with BB
ararslan Feb 22, 2021
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
12 changes: 12 additions & 0 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,18 @@ $(foreach proj,$(BB_PROJECTS),$(eval $(call SET_BB_DEFAULT,$(proj))))
# Use the Assertions build
BINARYBUILDER_LLVM_ASSERTS ?= 0

# XXX: Ensure assertion/debug flags are properly propagated in the absence of
# assert-enabled LLVM builds from BinaryBuilder. Note that this does not apply
# to Julia master, which has corresponding assert-enabled LLVM builds.
ifeq ($(USE_BINARYBUILDER_LLVM),1)
ifeq ($(BINARYBUILDER_LLVM_ASSERTS),0)
override LLVM_ASSERTIONS := 0
endif
endif

ifeq ($(LLVM_ASSERTIONS),0)
CXX_DISABLE_ASSERTION += -DNDEBUG
endif


# OS specific stuff
Expand Down
26 changes: 21 additions & 5 deletions base/boot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#abstract type Vararg{T} end

#mutable struct Symbol
# #opaque
## opaque
#end

#mutable struct TypeName
Expand Down Expand Up @@ -53,28 +53,43 @@
#abstract type DenseArray{T,N} <: AbstractArray{T,N} end

#mutable struct Array{T,N} <: DenseArray{T,N}
## opaque
#end

#mutable struct Module
# name::Symbol
## opaque
#end

#mutable struct SimpleVector
## opaque
#end

#mutable struct String
## opaque
#end

#mutable struct Method
#...
#end

#mutable struct MethodInstance
#...
#end

#mutable struct CodeInstance
#...
#end

#mutable struct CodeInfo
#...
#end

#mutable struct TypeMapLevel
#...
#end

#mutable struct TypeMapEntry
#...
#end

#abstract type Ref{T} end
Expand All @@ -93,7 +108,8 @@
#end

#struct LineInfoNode
# method::Any
# module::Module
# method::Symbol
# file::Symbol
# line::Int
# inlined_at::Int
Expand Down Expand Up @@ -379,8 +395,8 @@ eval(Core, :(PiNode(val, typ) = $(Expr(:new, :PiNode, :val, :typ))))
eval(Core, :(PhiCNode(values::Array{Any, 1}) = $(Expr(:new, :PhiCNode, :values))))
eval(Core, :(UpsilonNode(val) = $(Expr(:new, :UpsilonNode, :val))))
eval(Core, :(UpsilonNode() = $(Expr(:new, :UpsilonNode))))
eval(Core, :(LineInfoNode(@nospecialize(method), file::Symbol, line::Int, inlined_at::Int) =
$(Expr(:new, :LineInfoNode, :method, :file, :line, :inlined_at))))
eval(Core, :(LineInfoNode(mod::Module, @nospecialize(method), file::Symbol, line::Int, inlined_at::Int) =
$(Expr(:new, :LineInfoNode, :mod, :method, :file, :line, :inlined_at))))

Module(name::Symbol=:anonymous, std_imports::Bool=true) = ccall(:jl_f_new_module, Ref{Module}, (Any, Bool), name, std_imports)

Expand Down
25 changes: 12 additions & 13 deletions base/compiler/ssair/inlining.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ struct InliningTodo
sparams::Vector{Any} # The static parameters we computed for this call site
metharg # ::Type
# The LineTable and IR of the inlinee
linetable::Vector{LineInfoNode}
ir::IRCode
# If the function being inlined is a single basic block we can use a
# simpler inlining algorithm. This flag determines whether that's allowed
Expand Down Expand Up @@ -307,8 +306,8 @@ function ir_inline_item!(compact::IncrementalCompact, idx::Int, argexprs::Vector
linetable_offset = length(linetable)
# Append the linetable of the inlined function to our line table
inlined_at = Int(compact.result_lines[idx])
for entry in item.linetable
push!(linetable, LineInfoNode(entry.method, entry.file, entry.line,
for entry in item.ir.linetable
push!(linetable, LineInfoNode(entry.module, entry.method, entry.file, entry.line,
(entry.inlined_at > 0 ? entry.inlined_at + linetable_offset : inlined_at)))
end
if item.isva
Expand Down Expand Up @@ -734,23 +733,23 @@ function analyze_method!(idx::Int, sig::Signature, @nospecialize(metharg), meths

@timeit "inline IR inflation" begin
ir2 = inflate_ir(src, mi)
# prepare inlining linetable with method instance information
inline_linetable = Vector{LineInfoNode}(undef, length(src.linetable))
for i = 1:length(src.linetable)
entry = src.linetable[i]
if entry.inlined_at === 0 && entry.method === method
entry = LineInfoNode(mi, entry.file, entry.line, entry.inlined_at)
end
inline_linetable[i] = entry
end
# #optional: prepare inlining linetable with method instance information
# inline_linetable = ir2.linetable
# for i = 1:length(inline_linetable)
# entry = inline_linetable[i]
# if entry.inlined_at === 0 && entry.method === method
# entry = LineInfoNode(entry.module, mi, entry.file, entry.line, entry.inlined_at)
# inline_linetable[i] = entry
# end
# end
end
#verify_ir(ir2)

return InliningTodo(idx,
na > 0 && method.isva,
isinvoke, na,
method, Any[methsp...], metharg,
inline_linetable, ir2, linear_inline_eligible(ir2))
ir2, linear_inline_eligible(ir2))
end

# Neither the product iterator not CartesianIndices are available
Expand Down
6 changes: 3 additions & 3 deletions base/compiler/tfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -925,11 +925,11 @@ function fieldtype_tfunc(@nospecialize(s0), @nospecialize(name))
if s0 === Any || s0 === Type || DataType ⊑ s0 || UnionAll ⊑ s0
return Type
end
# fieldtype only accepts Types, errors on `Module`
if isa(s0, Const) && (!(isa(s0.val, DataType) || isa(s0.val, UnionAll) || isa(s0.val, Union)) || s0.val === Module)
# fieldtype only accepts Types
if isa(s0, Const) && !(isa(s0.val, DataType) || isa(s0.val, UnionAll) || isa(s0.val, Union))
return Bottom
end
if s0 == Type{Module} || s0 == Type{Union{}} || isa(s0, Conditional)
if (s0 isa Type && s0 == Type{Union{}}) || isa(s0, Conditional)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sacha0 - i also did this backport, here (oops, we collided. I'm happy to drop that now that you've done it 😊):
backports-release-1.5...NHDaly:nhd-backports-release-1.5-manual

And i wasn't sure whether to pull over the isa Type change as well. Technically that was added in dcc0696, as part of (#36596), so i wasn't sure whether to backport it as well. Supposedly it's just a code cleanup, but i'm not sure if it holds in isolation from the rest of the commit.

I think the closest transformation keeping in spirit of the change we're backporting from (#37645) would be just to drop the Module part, since that's all they did in the original PR? Like this, perhaps?:

Suggested change
if (s0 isa Type && s0 == Type{Union{}}) || isa(s0, Conditional)
if s0 == Type{Union{}} || isa(s0, Conditional)

PROBABLY fine either way, but since i see you made a different decision than I made when attempting the manual bisect, I wanted to just bring this up! :)

Copy link
Member

@NHDaly NHDaly Jan 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wondered the same, but err'd to adding the isa Type guard as == Type{Union{}} cannot be true unless the guard is true, and if the latter is true then the former must be true as well, so this transformation should be functionally identical modulo some additional safety with the guard (against == Type{Union{}} throwing something for non-Type s0s)? Either way is fine by me though :).

return Bottom
end

Expand Down
2 changes: 1 addition & 1 deletion base/compiler/typeinfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ function typeinf_ext(mi::MethodInstance, params::Params)
tree.slotflags = fill(0x00, nargs)
tree.ssavaluetypes = 1
tree.codelocs = Int32[1]
tree.linetable = [LineInfoNode(method, method.file, Int(method.line), 0)]
tree.linetable = [LineInfoNode(method.module, method.name, method.file, Int(method.line), 0)]
tree.inferred = true
tree.ssaflags = UInt8[0]
tree.pure = true
Expand Down
15 changes: 14 additions & 1 deletion base/gcutils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,20 @@ the current Task. Finalizers will only run when the counter is at zero. (Set
`true` for enabling, `false` for disabling). They may still run concurrently on
another Task or thread.
"""
enable_finalizers(on::Bool) = ccall(:jl_gc_enable_finalizers, Cvoid, (Ptr{Cvoid}, Int32,), C_NULL, on)
enable_finalizers(on::Bool) = on ? enable_finalizers() : disable_finalizers()

function enable_finalizers()
Base.@_inline_meta
ccall(:jl_gc_enable_finalizers_internal, Cvoid, ())
if unsafe_load(cglobal(:jl_gc_have_pending_finalizers, Cint)) != 0
ccall(:jl_gc_run_pending_finalizers, Cvoid, (Ptr{Cvoid},), C_NULL)
end
end

function disable_finalizers()
Base.@_inline_meta
ccall(:jl_gc_disable_finalizers_internal, Cvoid, ())
end

"""
GC.@preserve x1 x2 ... xn expr
Expand Down
8 changes: 4 additions & 4 deletions base/lock.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function trylock(rl::ReentrantLock)
if rl.reentrancy_cnt == 0
rl.locked_by = t
rl.reentrancy_cnt = 1
GC.enable_finalizers(false)
GC.disable_finalizers()
got = true
elseif t === notnothing(rl.locked_by)
rl.reentrancy_cnt += 1
Expand Down Expand Up @@ -87,7 +87,7 @@ function lock(rl::ReentrantLock)
if rl.reentrancy_cnt == 0
rl.locked_by = t
rl.reentrancy_cnt = 1
GC.enable_finalizers(false)
GC.disable_finalizers()
break
elseif t === notnothing(rl.locked_by)
rl.reentrancy_cnt += 1
Expand Down Expand Up @@ -128,7 +128,7 @@ function unlock(rl::ReentrantLock)
rethrow()
end
end
GC.enable_finalizers(true)
GC.enable_finalizers()
end
unlock(rl.cond_wait)
return
Expand All @@ -150,7 +150,7 @@ function unlockall(rl::ReentrantLock)
rethrow()
end
end
GC.enable_finalizers(true)
GC.enable_finalizers()
unlock(rl.cond_wait)
return n
end
Expand Down
10 changes: 5 additions & 5 deletions base/locks-mt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ Base.assert_havelock(l::SpinLock) = islocked(l) ? nothing : Base.concurrency_vio
function lock(l::SpinLock)
while true
if _get(l) == 0
GC.enable_finalizers(false)
GC.disable_finalizers()
p = _xchg!(l, 1)
if p == 0
return
end
GC.enable_finalizers(true)
GC.enable_finalizers()
end
ccall(:jl_cpu_pause, Cvoid, ())
# Temporary solution before we have gc transition support in codegen.
Expand All @@ -76,20 +76,20 @@ end

function trylock(l::SpinLock)
if _get(l) == 0
GC.enable_finalizers(false)
GC.disable_finalizers()
p = _xchg!(l, 1)
if p == 0
return true
end
GC.enable_finalizers(true)
GC.enable_finalizers()
end
return false
end

function unlock(l::SpinLock)
_get(l) == 0 && error("unlock count must match lock count")
_set!(l, 0)
GC.enable_finalizers(true)
GC.enable_finalizers()
ccall(:jl_cpu_wake, Cvoid, ())
return
end
Expand Down
2 changes: 1 addition & 1 deletion deps/Versions.make
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CURL_BB_REL = 1
LIBGIT2_VER = 0.28.2
LIBGIT2_BB_REL = 1
LIBUV_VER = 1.29.1
LIBUV_BB_REL = 9
LIBUV_BB_REL = 12
OBJCONV_VER = 2.49.0
OBJCONV_BB_REL = 0
ZLIB_VER = 1.2.11
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a5532dcc43089e5c3590903c647dd532
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
36bb45035c0a52a7c826b2b6574cd220c91d46f2a71b4b023514a0f6ad9132c072bdb09e83127c36c96ad03eff63d04d231c6aef716eeb51f13d2eb3d5625e54
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3ebd2aaf5c2deedf89cb04f72e88f4e3
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3198642bee9b06b48c99102f4f4a24d7d8bfc7691d890a3596ecb433ea75c1b0d4d9ff55161735bbfae071f2e570ef16f6b14ba350a822bd451324069eee19aa
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2e5e802747e9101c4c70bd88d98f0aa7
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a21fb98e33cd901ec1bfc79163687f6cb6dac02406fb3ebd33c6d8b63309b66cbe850c9da608bbc1a61a967a4309dafc308431d40c6ba8beab837e345f526f5e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0661f12762e2f2bbc90bce17d90fdbcf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a0f40ca80578d3d9e6b94a7f11d292ecd52de90374645c8fa8607e28b9f421709fbbba941ee3e7c9fba88abfe87daf6d265dbe8fcaf0e2faf1b83d8b5ab8a9a7
1 change: 1 addition & 0 deletions deps/checksums/LibUV.v2.0.0-12.i686-linux-gnu.tar.gz/md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5adc7739a9c5d4568870e2852c85485b
Loading