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 for 1.6-beta #38795

Merged
merged 57 commits into from
Dec 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
e5b8e5d
Bump CSL version (#38776)
staticfloat Dec 9, 2020
5c5c7a3
[automated] Bump the Tar stdlib from 0ba9683 to ac4d442 (#38786)
DilumAluthgeBot Dec 9, 2020
9f73f05
[LibCURL]: Reconcile BB and from-source configuration of LibCURL. (#3…
staticfloat Dec 9, 2020
29a1fdf
Simple test for filter for IdDicts (#38807)
kshyatt Dec 10, 2020
d045b77
[automated] Bump the NetworkOptions stdlib from 3d8a45c to a251de1 (#…
DilumAluthgeBot Dec 10, 2020
441e600
[automated] Bump the Downloads stdlib from 02e77ae to a6e4926 (#38816)
DilumAluthgeBot Dec 10, 2020
2684803
Do not return disconnected IdDict from Docs.meta (#38821)
timholy Dec 10, 2020
a15d4c8
Converge JLL APIs a bit more (#38797)
staticfloat Dec 11, 2020
c9c8ffd
Bump Documenter to 0.26.0 (#38826)
mortenpi Dec 11, 2020
fbd4fc3
Add isdefined check `count_const_size`
Keno Dec 9, 2020
40af668
Don't accidentally skip over pointers in count_const_size
Keno Dec 9, 2020
d5088f7
Avoid allocation in ldiv! with QR (#38389)
dlfivefifty Dec 9, 2020
1e377ca
Fix duplicated ldiv! method in qr.jl (#38801)
Keno Dec 9, 2020
f8349fa
[LLVM] add patch for miscompilation with setjmp on PPC
vchuravy Dec 9, 2020
624409d
[LLVM] add patch for #38773
vchuravy Dec 10, 2020
d47689a
Fix bugs in the checksum generator
staticfloat Dec 12, 2020
bb7938d
Update libLLVM, LLVM, and Clang
vchuravy Dec 11, 2020
6e2c9bc
Merge pull request #38851 from JuliaLang/vc/ppc_bp
vchuravy Dec 12, 2020
63f99af
Commit checksums for libosxunwind
ararslan Dec 12, 2020
10cbdde
Permit Bidiagonal represents empty matrix (#38392)
KlausC Dec 9, 2020
f3b6ccf
Fixed #38346: Eigen decomposition of Symmetric Matrix containing NaNs…
kc611 Dec 9, 2020
ce0a7ba
Resize credential buffer in winprompt in case of failure (#38828)
musm Dec 11, 2020
f543e26
improve inferrabilities within TOML module (#38831)
aviatesk Dec 12, 2020
10f699e
Use DEPOT_PATH instead of HOME in cmdlineargs test (#38855)
vchuravy Dec 13, 2020
fd94b4e
Adjust calling convention of LAPACK functions (#38836)
vchuravy Dec 13, 2020
b3f56c2
Use https links in a doc link (#38866)
musm Dec 13, 2020
8e71a81
[Mmap] Skip ReadOnlyMemoryError test on PowerPC
vchuravy Dec 13, 2020
e910291
[OpenBLAS_jll] use normalized ppc arch (#38874)
vchuravy Dec 14, 2020
e9c954f
Remove fastmath tests that are defined to be undef/poison
vchuravy Dec 12, 2020
3ba80c6
[Artifacts] Test c_simple on ppc
vchuravy Dec 14, 2020
3b18f1a
Don't clobber rax in x86_64 trampoline (#38882)
Keno Dec 15, 2020
22fa5a1
Don't override target passed on command-line with target from sysimg
vchuravy Dec 15, 2020
96d177f
LibGit2: improve error when CA root cert can't be set (#38827)
StefanKarpinski Dec 15, 2020
40a10ec
fix #38837, inference regression in tuple `map` (#38887)
JeffBezanson Dec 15, 2020
64838d2
measure compile time only when using time macros (fix #38877) (#38885)
IanButterworth Dec 15, 2020
f69cd74
fix #38897, docstring for .op= (#38898)
mbauman Dec 15, 2020
6e76513
update to utf8proc 2.6.1 (#38900)
stevengj Dec 16, 2020
ba0a0f5
Add section regarding Pkg mode to REPL docs (#38842)
musm Dec 16, 2020
ca49517
Correct pcre2-cet-flags.patch whitespace. (#38913)
Sacha0 Dec 17, 2020
8b99676
fix #34170, assertion failure with obvious_subtype (#38904)
JeffBezanson Dec 16, 2020
3210ac8
fix #38423, another stack overflow in method definition (#38810)
JeffBezanson Dec 14, 2020
0fb64a2
win: skip bad paths in dllist
vtjnash Dec 11, 2020
1f7d1bc
win: fix memory leak in dllist
vtjnash Dec 11, 2020
73f557d
Execute `backtrace` once before testing formatting (#38886)
vchuravy Dec 17, 2020
7784c2a
Restore the version information for libjulia.dylib (#38829)
fingolfin Dec 17, 2020
6f780f3
Update non-BB dsfmt build to match with the BB one. (#38917)
ViralBShah Dec 17, 2020
5b317d5
Add precompiles to reduce time to first Revise.revise()
timholy Dec 16, 2020
2d4f1db
Internalize Revise precompiles into Base
timholy Dec 16, 2020
f90e2f3
Document the need for disabling BB if building without network access…
ViralBShah Dec 17, 2020
7eb2d30
Improve position of MKL.jl mention in build documentation (#38923)
carstenbauer Dec 17, 2020
c687321
Remove useless nghttp2_jll import from LibGit2_jll (#38935)
staticfloat Dec 17, 2020
9687355
Mark ccall to git_libgit2_opts as variadic
vchuravy Dec 12, 2020
54c27e4
Remove stale WinRPM, Vagrant, Appveyor CI files and update build inst…
musm Dec 18, 2020
241efd8
improve performance of fieldname by moving out error paths in separat…
KristofferC Dec 18, 2020
5221f88
bump to latest Pkg release-1.6
KristofferC Dec 18, 2020
25ee100
[LLVM] Add patches for PPC knownbits and AArch64 globalisel
vchuravy Dec 15, 2020
4db29fe
bump LLVM BB
vchuravy Dec 17, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
36 changes: 36 additions & 0 deletions base/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,42 @@ end_base_include = time_ns()
const _sysimage_modules = PkgId[]
in_sysimage(pkgid::PkgId) = pkgid in _sysimage_modules

# Precompiles for Revise
# TODO: move these to contrib/generate_precompile.jl
# The problem is they don't work there
let m = which(+, (Int, Int))
while true # defeat interpreter heuristic to force compilation
delete!(push!(Set{Method}(), m), m)
copy(Core.Compiler.retrieve_code_info(Core.Compiler.specialize_method(m, [Int, Int], Core.svec())))

empty!(Set())
push!(push!(Set{Union{GlobalRef,Symbol}}(), :two), GlobalRef(Base, :two))
(setindex!(Dict{String,Base.PkgId}(), Base.PkgId(Base), "file.jl"))["file.jl"]
(setindex!(Dict{Symbol,Vector{Int}}(), [1], :two))[:two]
(setindex!(Dict{Base.PkgId,String}(), "file.jl", Base.PkgId(Base)))[Base.PkgId(Base)]
(setindex!(Dict{Union{GlobalRef,Symbol}, Vector{Int}}(), [1], :two))[:two]
(setindex!(IdDict{Type, Union{Missing, Vector{Tuple{LineNumberNode, Expr}}}}(), missing, Int))[Int]
Dict{Symbol, Union{Nothing, Bool, Symbol}}(:one => false)[:one]
Dict(Base => [:(1+1)])[Base]
Dict(:one => [1])[:one]
Dict("abc" => Set())["abc"]
pushfirst!([], sum)
get(Base.pkgorigins, Base.PkgId(Base), nothing)
sort!([1,2,3])
unique!([1,2,3])
cumsum([1,2,3])
append!(Int[], BitSet())
isempty(BitSet())
delete!(BitSet([1,2]), 3)
deleteat!(Int32[1,2,3], [1,3])
deleteat!(Any[1,2,3], [1,3])
Core.svec(1, 2) == Core.svec(3, 4)
any(t->t[1].line > 1, [(LineNumberNode(2,:none), :(1+1))])

break # end defeat interpreter heuristic
end
end

if is_primary_base_module
function __init__()
# try to ensuremake sure OpenBLAS does not set CPU affinity (#1070, #9639)
Expand Down
12 changes: 8 additions & 4 deletions base/compiler/utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,21 @@ function quoted(@nospecialize(x))
return is_self_quoting(x) ? x : QuoteNode(x)
end

function count_const_size(@nospecialize(x))
function count_const_size(@nospecialize(x), count_self::Bool = true)
(x isa Type || x isa Symbol) && return 0
ismutable(x) && return MAX_INLINE_CONST_SIZE + 1
isbits(x) && return Core.sizeof(x)
dt = typeof(x)
sz = sizeof(dt)
sz = count_self ? sizeof(dt) : 0
sz > MAX_INLINE_CONST_SIZE && return MAX_INLINE_CONST_SIZE + 1
dtfd = DataTypeFieldDesc(dt)
for i = 1:nfields(x)
dtfd[i].isptr || continue
sz += count_const_size(getfield(x, i))
isdefined(x, i) || continue
f = getfield(x, i)
if !dtfd[i].isptr && datatype_pointerfree(typeof(f))
continue
end
sz += count_const_size(f, dtfd[i].isptr)
sz > MAX_INLINE_CONST_SIZE && return MAX_INLINE_CONST_SIZE + 1
end
return sz
Expand Down
7 changes: 6 additions & 1 deletion base/docs/Docs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ const modules = Module[]
const META = gensym(:meta)
const METAType = IdDict{Any,Any}

meta(m::Module) = isdefined(m, META) ? getfield(m, META)::METAType : METAType()
function meta(m::Module)
if !isdefined(m, META)
initmeta(m)
end
return getfield(m, META)::METAType
end

function initmeta(m::Module)
if !isdefined(m, META)
Expand Down
16 changes: 10 additions & 6 deletions base/reflection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,19 @@ julia> fieldname(Rational, 2)
```
"""
function fieldname(t::DataType, i::Integer)
if t.abstract
throw(ArgumentError("type does not have definite field names"))
throw_not_def_field() = throw(ArgumentError("type does not have definite field names"))
function throw_field_access(t, i, n_fields)
field_label = n_fields == 1 ? "field" : "fields"
throw(ArgumentError("Cannot access field $i since type $t only has $n_fields $field_label."))
end
throw_need_pos_int(i) = throw(ArgumentError("Field numbers must be positive integers. $i is invalid."))

t.abstract && throw_not_def_field()
names = _fieldnames(t)
n_fields = length(names)::Int
field_label = n_fields == 1 ? "field" : "fields"
i > n_fields && throw(ArgumentError("Cannot access field $i since type $t only has $n_fields $field_label."))
i < 1 && throw(ArgumentError("Field numbers must be positive integers. $i is invalid."))
return names[i]::Symbol
i > n_fields && throw_field_access(t, i, n_fields)
i < 1 && throw_need_pos_int(i)
return @inbounds names[i]::Symbol
end

fieldname(t::UnionAll, i::Integer) = fieldname(unwrap_unionall(t), i)
Expand Down
11 changes: 6 additions & 5 deletions base/timing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ function gc_alloc_count(diff::GC_Diff)
end

# cumulative total time spent on compilation
cumulative_compile_time_ns() = ccall(:jl_cumulative_compile_time_ns, UInt64, ())
cumulative_compile_time_ns_before() = ccall(:jl_cumulative_compile_time_ns_before, UInt64, ())
cumulative_compile_time_ns_after() = ccall(:jl_cumulative_compile_time_ns_after, UInt64, ())

# total time spend in garbage collection, in nanoseconds
gc_time_ns() = ccall(:jl_gc_total_hrtime, UInt64, ())
Expand Down Expand Up @@ -197,11 +198,11 @@ macro time(ex)
quote
while false; end # compiler heuristic: compile this block (alter this if the heuristic changes)
local stats = gc_num()
local compile_elapsedtime = cumulative_compile_time_ns()
local compile_elapsedtime = cumulative_compile_time_ns_before()
local elapsedtime = time_ns()
local val = $(esc(ex))
elapsedtime = time_ns() - elapsedtime
compile_elapsedtime = cumulative_compile_time_ns() - compile_elapsedtime
compile_elapsedtime = cumulative_compile_time_ns_after() - compile_elapsedtime
local diff = GC_Diff(gc_num(), stats)
time_print(elapsedtime, diff.allocd, diff.total_time,
gc_alloc_count(diff), compile_elapsedtime)
Expand Down Expand Up @@ -245,11 +246,11 @@ macro timev(ex)
quote
while false; end # compiler heuristic: compile this block (alter this if the heuristic changes)
local stats = gc_num()
local compile_elapsedtime = cumulative_compile_time_ns()
local compile_elapsedtime = cumulative_compile_time_ns_before()
local elapsedtime = time_ns()
local val = $(esc(ex))
elapsedtime = time_ns() - elapsedtime
compile_elapsedtime = cumulative_compile_time_ns() - compile_elapsedtime
compile_elapsedtime = cumulative_compile_time_ns_after() - compile_elapsedtime
timev_print(elapsedtime, GC_Diff(gc_num(), stats), compile_elapsedtime)
val
end
Expand Down
25 changes: 14 additions & 11 deletions base/toml_parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -925,21 +925,21 @@ ok_end_value(c::Char) = iswhitespace(c) || c == '#' || c == EOF_CHAR || c == ']'
accept_two(l, f::F) where {F} = accept_n(l, 2, f) || return(ParserError(ErrParsingDateTime))
function parse_datetime(l)
# Year has already been eaten when we reach here
year = parse_int(l, false)::Int64
year = @try parse_int(l, false)
year in 0:9999 || return ParserError(ErrParsingDateTime)

# Month
accept(l, '-') || return ParserError(ErrParsingDateTime)
set_marker!(l)
@try accept_two(l, isdigit)
month = parse_int(l, false)
month = @try parse_int(l, false)
month in 1:12 || return ParserError(ErrParsingDateTime)
accept(l, '-') || return ParserError(ErrParsingDateTime)

# Day
set_marker!(l)
@try accept_two(l, isdigit)
day = parse_int(l, false)
day = @try parse_int(l, false)
# Verify the real range in the constructor below
day in 1:31 || return ParserError(ErrParsingDateTime)

Expand Down Expand Up @@ -976,9 +976,10 @@ function parse_datetime(l)
end

function try_return_datetime(p, year, month, day, h, m, s, ms)
if p.Dates !== nothing
Dates = p.Dates
if Dates !== nothing
try
return p.Dates.DateTime(year, month, day, h, m, s, ms)
return Dates.DateTime(year, month, day, h, m, s, ms)
catch
return ParserError(ErrParsingDateTime)
end
Expand All @@ -988,9 +989,10 @@ function try_return_datetime(p, year, month, day, h, m, s, ms)
end

function try_return_date(p, year, month, day)
if p.Dates !== nothing
Dates = p.Dates
if Dates !== nothing
try
return p.Dates.Date(year, month, day)
return Dates.Date(year, month, day)
catch
return ParserError(ErrParsingDateTime)
end
Expand All @@ -1000,7 +1002,7 @@ function try_return_date(p, year, month, day)
end

function parse_local_time(l::Parser)
h = parse_int(l, false)
h = @try parse_int(l, false)
h in 0:23 || return ParserError(ErrParsingDateTime)
_, m, s, ms = @try _parse_local_time(l, true)
# TODO: Could potentially parse greater accuracy for the
Expand All @@ -1009,9 +1011,10 @@ function parse_local_time(l::Parser)
end

function try_return_time(p, h, m, s, ms)
if p.Dates !== nothing
Dates = p.Dates
if Dates !== nothing
try
return p.Dates.Time(h, m, s, ms)
return Dates.Time(h, m, s, ms)
catch
return ParserError(ErrParsingDateTime)
end
Expand Down Expand Up @@ -1133,7 +1136,7 @@ function parse_string_continue(l::Parser, multiline::Bool, quoted::Bool)::Err{St
if !accept_n(l, n, isvalid_hex)
return ParserError(ErrInvalidUnicodeScalar)
end
codepoint = parse_int(l, false, 16)
codepoint = parse_int(l, false, 16)::Int64
#=
Unicode Scalar Value
---------------------
Expand Down
10 changes: 5 additions & 5 deletions base/tuple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ end

# 1 argument function
map(f, t::Tuple{}) = ()
map(f, t::Tuple{Any,}) = (f(t[1]),)
map(f, t::Tuple{Any, Any}) = (f(t[1]), f(t[2]))
map(f, t::Tuple{Any, Any, Any}) = (f(t[1]), f(t[2]), f(t[3]))
map(f, t::Tuple{Any,}) = (@_inline_meta; (f(t[1]),))
map(f, t::Tuple{Any, Any}) = (@_inline_meta; (f(t[1]), f(t[2])))
map(f, t::Tuple{Any, Any, Any}) = (@_inline_meta; (f(t[1]), f(t[2]), f(t[3])))
map(f, t::Tuple) = (@_inline_meta; (f(t[1]), map(f,tail(t))...))
# stop inlining after some number of arguments to avoid code blowup
const Any16{N} = Tuple{Any,Any,Any,Any,Any,Any,Any,Any,
Expand All @@ -229,8 +229,8 @@ function map(f, t::Any16)
end
# 2 argument function
map(f, t::Tuple{}, s::Tuple{}) = ()
map(f, t::Tuple{Any,}, s::Tuple{Any,}) = (f(t[1],s[1]),)
map(f, t::Tuple{Any,Any}, s::Tuple{Any,Any}) = (f(t[1],s[1]), f(t[2],s[2]))
map(f, t::Tuple{Any,}, s::Tuple{Any,}) = (@_inline_meta; (f(t[1],s[1]),))
map(f, t::Tuple{Any,Any}, s::Tuple{Any,Any}) = (@_inline_meta; (f(t[1],s[1]), f(t[2],s[2])))
function map(f, t::Tuple, s::Tuple)
@_inline_meta
(f(t[1],s[1]), map(f, tail(t), tail(s))...)
Expand Down
8 changes: 7 additions & 1 deletion base/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,13 @@ if Sys.iswindows()
succeeded = ccall((:CredPackAuthenticationBufferW, "credui.dll"), stdcall, Bool,
(UInt32, Cwstring, Cwstring, Ptr{UInt8}, Ptr{UInt32}),
CRED_PACK_GENERIC_CREDENTIALS, default_username, "", credbuf, credbufsize)
@assert succeeded
if !succeeded
credbuf = resize!(credbuf, credbufsize[])
succeeded = ccall((:CredPackAuthenticationBufferW, "credui.dll"), stdcall, Bool,
(UInt32, Cwstring, Cwstring, Ptr{UInt8}, Ptr{UInt32}),
CRED_PACK_GENERIC_CREDENTIALS, default_username, "", credbuf, credbufsize)
@assert succeeded
end

# Step 2: Create the actual dialog
# 2.1: Set up the window
Expand Down
4 changes: 2 additions & 2 deletions cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ endef
endif

$(build_shlibdir)/libjulia.$(JL_MAJOR_MINOR_SHLIB_EXT): $(LIB_OBJS) | $(build_shlibdir) $(build_libdir)
@$(call PRINT_LINK, $(CC) $(call IMPLIB_FLAGS,$@) $(LOADER_CFLAGS) -DLIBRARY_EXPORTS -shared $(SHIPFLAGS) $(LIB_OBJS) -o $@ $(LOADER_LDFLAGS) $(RPATH_LIB)) $(call SONAME_FLAGS,libjulia.$(JL_MAJOR_SHLIB_EXT))
@$(call PRINT_LINK, $(CC) $(call IMPLIB_FLAGS,$@) $(LOADER_CFLAGS) -DLIBRARY_EXPORTS -shared $(SHIPFLAGS) $(LIB_OBJS) -o $@ $(JLIBLDFLAGS) $(LOADER_LDFLAGS) $(RPATH_LIB)) $(call SONAME_FLAGS,libjulia.$(JL_MAJOR_SHLIB_EXT))
$(INSTALL_NAME_CMD)libjulia.$(SHLIB_EXT) $@
ifneq ($(OS), WINNT)
@ln -sf $(notdir $@) $(build_shlibdir)/libjulia.$(JL_MAJOR_SHLIB_EXT)
Expand All @@ -124,7 +124,7 @@ else
endif

$(build_shlibdir)/libjulia-debug.$(JL_MAJOR_MINOR_SHLIB_EXT): $(LIB_DOBJS) | $(build_shlibdir) $(build_libdir)
@$(call PRINT_LINK, $(CC) $(call IMPLIB_FLAGS,$@) $(LOADER_CFLAGS) -DLIBRARY_EXPORTS -shared $(DEBUGFLAGS) $(LIB_DOBJS) -o $@ $(LOADER_LDFLAGS) $(RPATH_LIB)) $(call SONAME_FLAGS,$(notdir $@))
@$(call PRINT_LINK, $(CC) $(call IMPLIB_FLAGS,$@) $(LOADER_CFLAGS) -DLIBRARY_EXPORTS -shared $(DEBUGFLAGS) $(LIB_DOBJS) -o $@ $(JLIBLDFLAGS) $(LOADER_LDFLAGS) $(RPATH_LIB)) $(call SONAME_FLAGS,$(notdir $@))
$(INSTALL_NAME_CMD)libjulia-debug.$(SHLIB_EXT) $@
ifneq ($(OS), WINNT)
@ln -sf $(notdir $@) $(build_shlibdir)/libjulia-debug.$(JL_MAJOR_SHLIB_EXT)
Expand Down
4 changes: 2 additions & 2 deletions cli/trampolines/trampolines_x86_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ SEH_START1(name); \
name##:; \
SEH_START2(); \
CET_START(); \
mov CNAME(name##_addr)(%rip),%rax; \
jmpq *%rax; \
mov CNAME(name##_addr)(%rip),%r11; \
jmpq *%r11; \
ud2; \
SEH_END(); \
.cfi_endproc; \
Expand Down
59 changes: 46 additions & 13 deletions contrib/generate_precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ UP_ARROW = "\e[A"
DOWN_ARROW = "\e[B"

hardcoded_precompile_statements = """
# used by JuliaInterpreter.jl and Revise.jl
# used by Revise.jl
@assert precompile(Tuple{typeof(Base.parse_cache_header), String})
@assert precompile(Tuple{typeof(pushfirst!), Vector{Any}, Function})
@assert precompile(Tuple{typeof(push!), Set{Module}, Module})
@assert precompile(Tuple{typeof(push!), Set{Method}, Method})
@assert precompile(Tuple{typeof(empty!), Set{Any}})
@assert precompile(Base.read_dependency_src, (String, String))
@assert precompile(Base.CoreLogging.current_logger_for_env, (Base.CoreLogging.LogLevel, String, Module))

# used by Requires.jl
@assert precompile(Tuple{typeof(get!), Type{Vector{Function}}, Dict{Base.PkgId,Vector{Function}}, Base.PkgId})
@assert precompile(Tuple{typeof(haskey), Dict{Base.PkgId,Vector{Function}}, Base.PkgId})
Expand Down Expand Up @@ -56,10 +55,38 @@ cd("complet_path\t\t$CTRL_C
"""

precompile_script = """
# Used by Revise
(setindex!(Dict{String,Base.PkgId}(), Base.PkgId(Base), "file.jl"))["file.jl"]
(setindex!(Dict{Base.PkgId,String}(), "file.jl", Base.PkgId(Base)))[Base.PkgId(Base)]
get(Base.pkgorigins, Base.PkgId(Base), nothing)
# NOTE: these were moved to the end of Base.jl. TODO: move back here.
# # Used by Revise & its dependencies
# while true # force inference
# delete!(push!(Set{Module}(), Base), Main)
# m = first(methods(+))
# delete!(push!(Set{Method}(), m), m)
# empty!(Set())
# push!(push!(Set{Union{GlobalRef,Symbol}}(), :two), GlobalRef(Base, :two))
# (setindex!(Dict{String,Base.PkgId}(), Base.PkgId(Base), "file.jl"))["file.jl"]
# (setindex!(Dict{Symbol,Vector{Int}}(), [1], :two))[:two]
# (setindex!(Dict{Base.PkgId,String}(), "file.jl", Base.PkgId(Base)))[Base.PkgId(Base)]
# (setindex!(Dict{Union{GlobalRef,Symbol}, Vector{Int}}(), [1], :two))[:two]
# (setindex!(IdDict{Type, Union{Missing, Vector{Tuple{LineNumberNode, Expr}}}}(), missing, Int))[Int]
# Dict{Symbol, Union{Nothing, Bool, Symbol}}(:one => false)[:one]
# Dict(Base => [:(1+1)])[Base]
# Dict(:one => [1])[:one]
# Dict("abc" => Set())["abc"]
# pushfirst!([], sum)
# get(Base.pkgorigins, Base.PkgId(Base), nothing)
# sort!([1,2,3])
# unique!([1,2,3])
# cumsum([1,2,3])
# append!(Int[], BitSet())
# isempty(BitSet())
# delete!(BitSet([1,2]), 3)
# deleteat!(Int32[1,2,3], [1,3])
# deleteat!(Any[1,2,3], [1,3])
# Core.svec(1, 2) == Core.svec(3, 4)
# # copy(Core.Compiler.retrieve_code_info(Core.Compiler.specialize_method(which(+, (Int, Int)), [Int, Int], Core.svec())))
# any(t->t[1].line > 1, [(LineNumberNode(2,:none),:(1+1))])
# break # end force inference
# end
"""

julia_exepath() = joinpath(Sys.BINDIR::String, Base.julia_exename())
Expand All @@ -72,21 +99,26 @@ if have_repl
"""
end

# This is disabled because it doesn't give much benefit
# and the code in Distributed is poorly typed causing many invalidations
#=
Distributed = get(Base.loaded_modules,
Base.PkgId(Base.UUID("8ba89e20-285c-5b6f-9357-94700520ee1b"), "Distributed"),
nothing)
if Distributed !== nothing
hardcoded_precompile_statements *= """
@assert precompile(Tuple{typeof(Distributed.remotecall),Function,Int,Module,Vararg{Any, 100}})
@assert precompile(Tuple{typeof(Distributed.procs)})
@assert precompile(Tuple{typeof(Distributed.finalize_ref), Distributed.Future})
"""
# This is disabled because it doesn't give much benefit
# and the code in Distributed is poorly typed causing many invalidations
#=
precompile_script *= """
using Distributed
addprocs(2)
pmap(x->iseven(x) ? 1 : 0, 1:4)
@distributed (+) for i = 1:100 Int(rand(Bool)) end
"""
end
=#
end


Artifacts = get(Base.loaded_modules,
Expand Down Expand Up @@ -121,6 +153,7 @@ if FileWatching !== nothing
hardcoded_precompile_statements *= """
@assert precompile(Tuple{typeof(FileWatching.watch_file), String, Float64})
@assert precompile(Tuple{typeof(FileWatching.watch_file), String, Int})
@assert precompile(Tuple{typeof(FileWatching._uv_hook_close), FileWatching.FileMonitor})
"""
end

Expand Down
Loading