Skip to content

Commit 712150c

Browse files
authored
Merge pull request #33075 from JuliaLang/backports-release-1.0
Backports for 1.0.5
2 parents 58db74d + b717256 commit 712150c

Some content is hidden

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

60 files changed

+548
-198
lines changed

Make.inc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -967,10 +967,7 @@ else ifeq ($(OS), Darwin)
967967
RPATH_ESCAPED_ORIGIN := $(RPATH_ORIGIN)
968968
RPATH_LIB := -Wl,-rpath,'@loader_path/julia/' -Wl,-rpath,'@loader_path/'
969969
else
970-
RPATH := -Wl,-rpath,'$$ORIGIN/$(build_libdir_rel)' -Wl,-rpath-link,$(build_shlibdir) -Wl,-z,origin
971-
ifeq ($(OS), FreeBSD)
972-
RPATH += -Wl,-rpath,'$$ORIGIN/$(build_private_libdir_rel)'
973-
endif
970+
RPATH := -Wl,-rpath,'$$ORIGIN/$(build_libdir_rel)' -Wl,-rpath,'$$ORIGIN/$(build_private_libdir_rel)' -Wl,-rpath-link,$(build_shlibdir) -Wl,-z,origin
974971
RPATH_ORIGIN := -Wl,-rpath,'$$ORIGIN' -Wl,-z,origin
975972
RPATH_ESCAPED_ORIGIN := -Wl,-rpath,'\$$\$$ORIGIN' -Wl,-z,origin -Wl,-rpath-link,$(build_shlibdir)
976973
RPATH_LIB := -Wl,-rpath,'$$ORIGIN/julia' -Wl,-rpath,'$$ORIGIN' -Wl,-z,origin

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,10 @@ ifeq ($(BUNDLE_DEBUG_LIBS),1)
339339
$(INSTALL_M) $(build_bindir)/julia-debug $(DESTDIR)$(bindir)/
340340
endif
341341
ifeq ($(OS),WINNT)
342-
-$(INSTALL_M) $(build_bindir)/*.dll $(DESTDIR)$(bindir)/
342+
-$(INSTALL_M) $(filter-out $(build_bindir)/libjulia-debug.dll,$(wildcard $(build_bindir)/*.dll)) $(DESTDIR)$(bindir)/
343343
-$(INSTALL_M) $(build_libdir)/libjulia.dll.a $(DESTDIR)$(libdir)/
344344
ifeq ($(BUNDLE_DEBUG_LIBS),1)
345+
-$(INSTALL_M) $(build_bindir)/libjulia-debug.dll $(DESTDIR)$(bindir)/
345346
-$(INSTALL_M) $(build_libdir)/libjulia-debug.dll.a $(DESTDIR)$(libdir)/
346347
endif
347348
-$(INSTALL_M) $(build_bindir)/libopenlibm.dll.a $(DESTDIR)$(libdir)/

base/compiler/ssair/legacy.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ function replace_code_newstyle!(ci::CodeInfo, ir::IRCode, nargs::Int)
6060
ci.linetable = ir.linetable
6161
ci.ssavaluetypes = ir.types
6262
ci.ssaflags = ir.flags
63+
for metanode in ir.meta
64+
push!(ci.code, metanode)
65+
push!(ci.codelocs, 1)
66+
push!(ci.ssavaluetypes, Any)
67+
push!(ci.ssaflags, 0x00)
68+
end
6369
# Translate BB Edges to statement edges
6470
# (and undo normalization for now)
6571
for i = 1:length(ci.code)

base/compiler/ssair/passes.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ function walk_to_defs(compact::IncrementalCompact, @nospecialize(defssa), @nospe
174174
found_def = false
175175
## Track which PhiNodes, SSAValue intermediaries
176176
## we forwarded through.
177-
visited = IdSet{Any}()
177+
visited = IdDict{Any, Any}()
178178
worklist_defs = Any[]
179179
worklist_constraints = Any[]
180180
leaves = Any[]
@@ -183,7 +183,7 @@ function walk_to_defs(compact::IncrementalCompact, @nospecialize(defssa), @nospe
183183
while !isempty(worklist_defs)
184184
defssa = pop!(worklist_defs)
185185
typeconstraint = pop!(worklist_constraints)
186-
push!(visited, defssa)
186+
visited[defssa] = typeconstraint
187187
def = compact[defssa]
188188
if isa(def, PhiNode)
189189
push!(visited_phinodes, defssa)
@@ -207,9 +207,15 @@ function walk_to_defs(compact::IncrementalCompact, @nospecialize(defssa), @nospe
207207
if isa(val, AnySSAValue)
208208
new_def, new_constraint = simple_walk_constraint(compact, val, typeconstraint)
209209
if isa(new_def, AnySSAValue)
210-
if !(new_def in visited)
210+
if !haskey(visited, new_def)
211211
push!(worklist_defs, new_def)
212212
push!(worklist_constraints, new_constraint)
213+
elseif !(new_constraint <: visited[new_def])
214+
# We have reached the same definition via a different
215+
# path, with a different type constraint. We may have
216+
# to redo some work here with the wider typeconstraint
217+
push!(worklist_defs, new_def)
218+
push!(worklist_constraints, tmerge(new_constraint, visited[new_def]))
213219
end
214220
continue
215221
end

base/complex.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -917,10 +917,14 @@ function atanh(z::Complex{T}) where T<:AbstractFloat
917917
return Complex(copysign(zero(x),x), copysign(oftype(y,pi)/2, y))
918918
end
919919
return Complex(real(1/z), copysign(oftype(y,pi)/2, y))
920-
elseif ax==1
920+
end
921+
β = copysign(one(T), x)
922+
z *= β
923+
x, y = reim(z)
924+
if x == 1
921925
if y == 0
922-
ξ = copysign(oftype(x,Inf),x)
923-
η = zero(y)
926+
ξ = oftype(x, Inf)
927+
η = y
924928
else
925929
ym = ay+ρ
926930
ξ = log(sqrt(sqrt(4+y*y))/sqrt(ym))
@@ -935,7 +939,7 @@ function atanh(z::Complex{T}) where T<:AbstractFloat
935939
end
936940
η = angle(Complex((1-x)*(1+x)-ysq, 2y))/2
937941
end
938-
Complex(ξ, η)
942+
β * Complex(ξ, η)
939943
end
940944
atanh(z::Complex) = atanh(float(z))
941945

base/file.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,13 @@ We can see the [`mtime`](@ref) has been modified by `touch`.
403403
function touch(path::AbstractString)
404404
f = open(path, JL_O_WRONLY | JL_O_CREAT, 0o0666)
405405
try
406-
t = time()
407-
futime(f,t,t)
406+
if Sys.isunix()
407+
ret = ccall(:futimes, Cint, (Cint, Ptr{Cvoid}), fd(f), C_NULL)
408+
systemerror(:futimes, ret != 0, extrainfo=path)
409+
else
410+
t = time()
411+
futime(f,t,t)
412+
end
408413
finally
409414
close(f)
410415
end

base/filesystem.jl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,19 @@ function close(f::File)
102102
return nothing
103103
end
104104

105-
# sendfile is the most efficient way to copy a file (or any file descriptor)
105+
# sendfile is the most efficient way to copy from a file descriptor
106106
function sendfile(dst::File, src::File, src_offset::Int64, bytes::Int)
107107
check_open(dst)
108108
check_open(src)
109-
err = ccall(:jl_fs_sendfile, Int32, (OS_HANDLE, OS_HANDLE, Int64, Csize_t),
110-
src.handle, dst.handle, src_offset, bytes)
111-
uv_error("sendfile", err)
109+
while true
110+
result = ccall(:jl_fs_sendfile, Int32, (OS_HANDLE, OS_HANDLE, Int64, Csize_t),
111+
src.handle, dst.handle, src_offset, bytes)
112+
uv_error("sendfile", result)
113+
nsent = result
114+
bytes -= nsent
115+
src_offset += nsent
116+
bytes <= 0 && break
117+
end
112118
nothing
113119
end
114120

base/float.jl

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -503,15 +503,18 @@ for Ti in (Int64,UInt64,Int128,UInt128)
503503
end
504504
end
505505
end
506+
for op in (:(==), :<, :<=)
507+
@eval begin
508+
($op)(x::Float16, y::Union{Int128,UInt128,Int64,UInt64}) = ($op)(Float64(x), Float64(y))
509+
($op)(x::Union{Int128,UInt128,Int64,UInt64}, y::Float16) = ($op)(Float64(x), Float64(y))
506510

507-
==(x::Float32, y::Union{Int32,UInt32}) = Float64(x)==Float64(y)
508-
==(x::Union{Int32,UInt32}, y::Float32) = Float64(x)==Float64(y)
509-
510-
<(x::Float32, y::Union{Int32,UInt32}) = Float64(x)<Float64(y)
511-
<(x::Union{Int32,UInt32}, y::Float32) = Float64(x)<Float64(y)
511+
($op)(x::Union{Float16,Float32}, y::Union{Int32,UInt32}) = ($op)(Float64(x), Float64(y))
512+
($op)(x::Union{Int32,UInt32}, y::Union{Float16,Float32}) = ($op)(Float64(x), Float64(y))
512513

513-
<=(x::Float32, y::Union{Int32,UInt32}) = Float64(x)<=Float64(y)
514-
<=(x::Union{Int32,UInt32}, y::Float32) = Float64(x)<=Float64(y)
514+
($op)(x::Float16, y::Union{Int16,UInt16}) = ($op)(Float32(x), Float32(y))
515+
($op)(x::Union{Int16,UInt16}, y::Float16) = ($op)(Float32(x), Float32(y))
516+
end
517+
end
515518

516519

517520
abs(x::Float16) = reinterpret(Float16, reinterpret(UInt16, x) & 0x7fff)

base/parse.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ function tryparse_internal(::Type{T}, s::AbstractString, startpos::Int, endpos::
120120
_Z = UInt32('Z')
121121
_z = UInt32('z')
122122
while n <= m
123-
_c = UInt32(c)
123+
# Fast path from `UInt32(::Char)`; non-ascii will be >= 0x80
124+
_c = reinterpret(UInt32, c) >> 24
124125
d::T = _0 <= _c <= _9 ? _c-_0 :
125126
_A <= _c <= _Z ? _c-_A+ UInt32(10) :
126127
_a <= _c <= _z ? _c-_a+a : base
@@ -139,7 +140,8 @@ function tryparse_internal(::Type{T}, s::AbstractString, startpos::Int, endpos::
139140
end
140141
(T <: Signed) && (n *= sgn)
141142
while !isspace(c)
142-
_c = UInt32(c)
143+
# Fast path from `UInt32(::Char)`; non-ascii will be >= 0x80
144+
_c = reinterpret(UInt32, c) >> 24
143145
d::T = _0 <= _c <= _9 ? _c-_0 :
144146
_A <= _c <= _Z ? _c-_A+ UInt32(10) :
145147
_a <= _c <= _z ? _c-_a+a : base

deps/Versions.make

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ CURL_VER = 7.56.0
1515
# Specify the version of the Mozilla CA Certificate Store to obtain.
1616
# The versions of cacert.pem are identified by the date (YYYY-MM-DD) of their changes.
1717
# See https://curl.haxx.se/docs/caextract.html for more details.
18-
MOZILLA_CACERT_VERSION := 2019-01-23
18+
MOZILLA_CACERT_VERSION := 2019-05-15

0 commit comments

Comments
 (0)