Skip to content

Commit bd47dc8

Browse files
authored
Merge branch 'master' into styled-markdown
2 parents 4d1ffb4 + c4bec9a commit bd47dc8

Some content is hidden

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

94 files changed

+791
-1157
lines changed

Make.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ endif
13921392
ifeq ($(OS), WINNT)
13931393
HAVE_SSP := 1
13941394
OSLIBS += -Wl,--export-all-symbols -Wl,--version-script=$(BUILDROOT)/src/julia.expmap \
1395-
$(NO_WHOLE_ARCHIVE) -lpsapi -lkernel32 -lws2_32 -liphlpapi -lwinmm -ldbghelp -luserenv -lsecur32 -latomic
1395+
$(NO_WHOLE_ARCHIVE) -lpsapi -lkernel32 -lws2_32 -liphlpapi -lwinmm -ldbghelp -luserenv -lsecur32 -latomic -lole32
13961396
JLDFLAGS += -Wl,--stack,8388608
13971397
ifeq ($(ARCH),i686)
13981398
JLDFLAGS += -Wl,--large-address-aware

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Compiler/Runtime improvements
5454
* A new `LazyLibrary` type is exported from `Libdl` for use in building chained lazy library
5555
loads, primarily to be used within JLLs ([#50074]).
5656
* Added support for annotating `Base.@assume_effects` on code blocks ([#52400]).
57+
* The libuv library has been updated from a base of v1.44.2 to v1.48.0 ([#49937]).
5758

5859
Command-line option changes
5960
---------------------------
@@ -86,6 +87,7 @@ New library functions
8687
* `Sys.username()` can be used to return the current user's username ([#51897]).
8788
* `wrap(Array, m::Union{MemoryRef{T}, Memory{T}}, dims)` is the safe counterpart to `unsafe_wrap` ([#52049]).
8889
* `GC.logging_enabled()` can be used to test whether GC logging has been enabled via `GC.enable_logging` ([#51647]).
90+
* `IdSet` is now exported from Base and considered public ([#53262]).
8991

9092
New library features
9193
--------------------

base/abstractdict.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ end
416416
Update `d`, removing elements for which `f` is `false`.
417417
The function `f` is passed `key=>value` pairs.
418418
419-
# Example
419+
# Examples
420420
```jldoctest
421421
julia> d = Dict(1=>"a", 2=>"b", 3=>"c")
422422
Dict{Int64, String} with 3 entries:

base/boot.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,13 +483,13 @@ eval(Core, quote
483483
end)
484484

485485
function CodeInstance(
486-
mi::MethodInstance, @nospecialize(rettype), @nospecialize(exctype), @nospecialize(inferred_const),
486+
mi::MethodInstance, owner, @nospecialize(rettype), @nospecialize(exctype), @nospecialize(inferred_const),
487487
@nospecialize(inferred), const_flags::Int32, min_world::UInt, max_world::UInt,
488488
ipo_effects::UInt32, effects::UInt32, @nospecialize(analysis_results),
489489
relocatability::UInt8)
490490
return ccall(:jl_new_codeinst, Ref{CodeInstance},
491-
(Any, Any, Any, Any, Any, Int32, UInt, UInt, UInt32, UInt32, Any, UInt8),
492-
mi, rettype, exctype, inferred_const, inferred, const_flags, min_world, max_world,
491+
(Any, Any, Any, Any, Any, Any, Int32, UInt, UInt, UInt32, UInt32, Any, UInt8),
492+
mi, owner, rettype, exctype, inferred_const, inferred, const_flags, min_world, max_world,
493493
ipo_effects, effects, analysis_results,
494494
relocatability)
495495
end

base/cartesian.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Generate a function call expression with keyword arguments `kw...`. As
115115
in the case of [`@ncall`](@ref), `sym` represents any number of function arguments, the
116116
last of which may be an anonymous-function expression and is expanded into `N` arguments.
117117
118-
# Example
118+
# Examples
119119
```jldoctest
120120
julia> using Base.Cartesian
121121

base/cmd.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
abstract type AbstractCmd end
44

55
# libuv process option flags
6-
const UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS = UInt8(1 << 2)
7-
const UV_PROCESS_DETACHED = UInt8(1 << 3)
8-
const UV_PROCESS_WINDOWS_HIDE = UInt8(1 << 4)
6+
const UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS = UInt32(1 << 2)
7+
const UV_PROCESS_DETACHED = UInt32(1 << 3)
8+
const UV_PROCESS_WINDOWS_HIDE = UInt32(1 << 4)
9+
const UV_PROCESS_WINDOWS_DISABLE_EXACT_NAME = UInt32(1 << 7)
910

1011
struct Cmd <: AbstractCmd
1112
exec::Vector{String}

base/compiler/cicache.jl

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ Internally, each `MethodInstance` keep a unique global cache of code instances
77
that have been created for the given method instance, stratified by world age
88
ranges. This struct abstracts over access to this cache.
99
"""
10-
struct InternalCodeCache end
10+
struct InternalCodeCache
11+
owner::Any # `jl_egal` is used for comparison
12+
end
1113

1214
function setindex!(cache::InternalCodeCache, ci::CodeInstance, mi::MethodInstance)
15+
@assert ci.owner === cache.owner
1316
ccall(:jl_mi_cache_insert, Cvoid, (Any, Any), mi, ci)
1417
return cache
1518
end
1619

17-
const GLOBAL_CI_CACHE = InternalCodeCache()
18-
1920
struct WorldRange
2021
min_world::UInt
2122
max_world::UInt
@@ -49,11 +50,11 @@ WorldView(wvc::WorldView, wr::WorldRange) = WorldView(wvc.cache, wr)
4950
WorldView(wvc::WorldView, args...) = WorldView(wvc.cache, args...)
5051

5152
function haskey(wvc::WorldView{InternalCodeCache}, mi::MethodInstance)
52-
return ccall(:jl_rettype_inferred, Any, (Any, UInt, UInt), mi, first(wvc.worlds), last(wvc.worlds)) !== nothing
53+
return ccall(:jl_rettype_inferred, Any, (Any, Any, UInt, UInt), wvc.cache.owner, mi, first(wvc.worlds), last(wvc.worlds)) !== nothing
5354
end
5455

5556
function get(wvc::WorldView{InternalCodeCache}, mi::MethodInstance, default)
56-
r = ccall(:jl_rettype_inferred, Any, (Any, UInt, UInt), mi, first(wvc.worlds), last(wvc.worlds))
57+
r = ccall(:jl_rettype_inferred, Any, (Any, Any, UInt, UInt), wvc.cache.owner, mi, first(wvc.worlds), last(wvc.worlds))
5758
if r === nothing
5859
return default
5960
end
@@ -70,3 +71,9 @@ function setindex!(wvc::WorldView{InternalCodeCache}, ci::CodeInstance, mi::Meth
7071
setindex!(wvc.cache, ci, mi)
7172
return wvc
7273
end
74+
75+
function code_cache(interp::AbstractInterpreter)
76+
cache = InternalCodeCache(cache_owner(interp))
77+
worlds = WorldRange(get_inference_world(interp))
78+
return WorldView(cache, worlds)
79+
end

base/compiler/typeinfer.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ function CodeInstance(interp::AbstractInterpreter, result::InferenceResult,
326326
end
327327
end
328328
# relocatability = isa(inferred_result, String) ? inferred_result[end] : UInt8(0)
329-
return CodeInstance(result.linfo,
329+
return CodeInstance(result.linfo, cache_owner(interp),
330330
widenconst(result_type), widenconst(result.exc_result), rettype_const, inferred_result,
331331
const_flags, first(valid_worlds), last(valid_worlds),
332332
# TODO: Actually do something with non-IPO effects

base/compiler/types.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ the following methods to satisfy the `AbstractInterpreter` API requirement:
1414
- `OptimizationParams(interp::NewInterpreter)` - return an `OptimizationParams` instance
1515
- `get_inference_world(interp::NewInterpreter)` - return the world age for this interpreter
1616
- `get_inference_cache(interp::NewInterpreter)` - return the local inference cache
17-
- `code_cache(interp::NewInterpreter)` - return the global inference cache
17+
- `cache_owner(interp::NewInterpreter)` - return the owner of any new cache entries
1818
"""
1919
:(AbstractInterpreter)
2020

@@ -404,7 +404,7 @@ InferenceParams(interp::NativeInterpreter) = interp.inf_params
404404
OptimizationParams(interp::NativeInterpreter) = interp.opt_params
405405
get_inference_world(interp::NativeInterpreter) = interp.world
406406
get_inference_cache(interp::NativeInterpreter) = interp.inf_cache
407-
code_cache(interp::NativeInterpreter) = WorldView(GLOBAL_CI_CACHE, get_inference_world(interp))
407+
cache_owner(interp::NativeInterpreter) = nothing
408408

409409
"""
410410
already_inferred_quick_test(::AbstractInterpreter, ::MethodInstance)

base/compiler/utilities.jl

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -321,25 +321,6 @@ function iterate(iter::BackedgeIterator, i::Int=1)
321321
return BackedgePair(item, backedges[i+1]::MethodInstance), i+2 # `invoke` calls
322322
end
323323

324-
"""
325-
add_invalidation_callback!(callback, mi::MethodInstance)
326-
327-
Register `callback` to be triggered upon the invalidation of `mi`.
328-
`callback` should a function taking two arguments, `callback(replaced::MethodInstance, max_world::UInt32)`,
329-
and it will be recursively invoked on `MethodInstance`s within the invalidation graph.
330-
"""
331-
function add_invalidation_callback!(@nospecialize(callback), mi::MethodInstance)
332-
if !isdefined(mi, :callbacks)
333-
callbacks = mi.callbacks = Any[callback]
334-
else
335-
callbacks = mi.callbacks::Vector{Any}
336-
if !any(@nospecialize(cb)->cb===callback, callbacks)
337-
push!(callbacks, callback)
338-
end
339-
end
340-
return callbacks
341-
end
342-
343324
#########
344325
# types #
345326
#########

0 commit comments

Comments
 (0)