diff --git a/base/boot.jl b/base/boot.jl index 83071073d87e95..5d3538d584b217 100644 --- a/base/boot.jl +++ b/base/boot.jl @@ -122,10 +122,10 @@ export # key types Any, DataType, Vararg, ANY, NTuple, - Tuple, Type, UnionAll, TypeName, TypeVar, Union, Nothing, Cvoid, - SimpleVector, AbstractArray, DenseArray, NamedTuple, + Tuple, Type, UnionAll, TypeVar, Union, Nothing, Cvoid, + AbstractArray, DenseArray, NamedTuple, # special objects - Function, CodeInfo, Method, MethodTable, TypeMapEntry, TypeMapLevel, + Function, Method, Module, Symbol, Task, Array, Uninitialized, uninitialized, WeakRef, VecElement, # numeric types Number, Real, Integer, Bool, Ref, Ptr, @@ -140,8 +140,7 @@ export OverflowError, StackOverflowError, SegmentationFault, UndefRefError, UndefVarError, TypeError, ArgumentError, MethodError, AssertionError, LoadError, InitError, # AST representation - Expr, GotoNode, LabelNode, LineNumberNode, QuoteNode, - GlobalRef, NewvarNode, SSAValue, Slot, SlotNumber, TypedSlot, + Expr, QuoteNode, LineNumberNode, # object model functions fieldtype, getfield, setfield!, nfields, throw, tuple, ===, isdefined, eval, # sizeof # not exported, to avoid conflicting with Base.sizeof @@ -403,6 +402,15 @@ function Symbol(a::Array{UInt8,1}) end Symbol(s::Symbol) = s +# module providing the IR object model +module IR +export CodeInfo, MethodInstance, GotoNode, LabelNode, + GlobalRef, NewvarNode, SSAValue, Slot, SlotNumber, TypedSlot + +import Core: CodeInfo, MethodInstance, GotoNode, LabelNode, + GlobalRef, NewvarNode, SSAValue, Slot, SlotNumber, TypedSlot +end + # docsystem basics macro doc(x...) atdoc(__source__, __module__, x...) diff --git a/base/compiler/compiler.jl b/base/compiler/compiler.jl index 847f0a8380b99c..d45181a2be186b 100644 --- a/base/compiler/compiler.jl +++ b/base/compiler/compiler.jl @@ -2,7 +2,7 @@ getfield(getfield(Main, :Core), :eval)(getfield(Main, :Core), :(baremodule Compiler -using Core.Intrinsics +using Core.Intrinsics, Core.IR import Core: print, println, show, write, unsafe_write, STDOUT, STDERR, _apply, svec, apply_type, Builtin, IntrinsicFunction, MethodInstance diff --git a/base/compiler/inferencestate.jl b/base/compiler/inferencestate.jl index e585cda86cb78d..4ecdce5d08fcd2 100644 --- a/base/compiler/inferencestate.jl +++ b/base/compiler/inferencestate.jl @@ -202,7 +202,7 @@ function add_backedge!(li::MethodInstance, caller::InferenceState) end # used to temporarily accumulate our no method errors to later add as backedges in the callee method table -function add_mt_backedge!(mt::MethodTable, @nospecialize(typ), caller::InferenceState) +function add_mt_backedge!(mt::Core.MethodTable, @nospecialize(typ), caller::InferenceState) isa(caller.linfo.def, Method) || return # don't add backedges to toplevel exprs if caller.stmt_edges[caller.currpc] === () caller.stmt_edges[caller.currpc] = [] diff --git a/base/compiler/optimize.jl b/base/compiler/optimize.jl index ab619f3b6cd402..731ecb16b96660 100644 --- a/base/compiler/optimize.jl +++ b/base/compiler/optimize.jl @@ -166,8 +166,8 @@ struct StructInfo end struct InvokeData - mt::MethodTable - entry::TypeMapEntry + mt::Core.MethodTable + entry::Core.TypeMapEntry types0 fexpr texpr diff --git a/base/compiler/tfuncs.jl b/base/compiler/tfuncs.jl index 0d2465b97398fe..54a22b0b11266d 100644 --- a/base/compiler/tfuncs.jl +++ b/base/compiler/tfuncs.jl @@ -23,9 +23,9 @@ const DATATYPE_TYPES_FIELDINDEX = fieldindex(DataType, :types) const DATATYPE_SUPER_FIELDINDEX = fieldindex(DataType, :super) const DATATYPE_MUTABLE_FIELDINDEX = fieldindex(DataType, :mutable) -const TYPENAME_NAME_FIELDINDEX = fieldindex(TypeName, :name) -const TYPENAME_MODULE_FIELDINDEX = fieldindex(TypeName, :module) -const TYPENAME_WRAPPER_FIELDINDEX = fieldindex(TypeName, :wrapper) +const TYPENAME_NAME_FIELDINDEX = fieldindex(Core.TypeName, :name) +const TYPENAME_MODULE_FIELDINDEX = fieldindex(Core.TypeName, :module) +const TYPENAME_WRAPPER_FIELDINDEX = fieldindex(Core.TypeName, :wrapper) ########## # tfuncs # @@ -463,8 +463,8 @@ function getfield_tfunc(@nospecialize(s00), @nospecialize(name)) t = const_datatype_getfield_tfunc(sv, isa(nv, Symbol) ? fieldindex(DataType, nv, false) : nv) t !== nothing && return t - elseif isa(sv, TypeName) - fld = isa(nv, Symbol) ? fieldindex(TypeName, nv, false) : nv + elseif isa(sv, Core.TypeName) + fld = isa(nv, Symbol) ? fieldindex(Core.TypeName, nv, false) : nv if (fld == TYPENAME_NAME_FIELDINDEX || fld == TYPENAME_MODULE_FIELDINDEX || fld == TYPENAME_WRAPPER_FIELDINDEX) diff --git a/base/compiler/typeinfer.jl b/base/compiler/typeinfer.jl index 49dee091d7a79d..4a50bccfb06659 100644 --- a/base/compiler/typeinfer.jl +++ b/base/compiler/typeinfer.jl @@ -15,7 +15,7 @@ function finalize_backedges(frame::InferenceState) ccall(:jl_method_instance_add_backedge, Cvoid, (Any, Any), to, caller) i += 1 else - typeassert(to, MethodTable) + typeassert(to, Core.MethodTable) typ = edges[i + 1] ccall(:jl_method_table_add_backedge, Cvoid, (Any, Any, Any), to, typ, caller) i += 2 diff --git a/base/docs/Docs.jl b/base/docs/Docs.jl index f5895c6b99abbf..1c00b17ddf7132 100644 --- a/base/docs/Docs.jl +++ b/base/docs/Docs.jl @@ -63,6 +63,7 @@ include("bindings.jl") import Base.Meta: quot, isexpr import Base: Callable, with_output_color import ..CoreDocs: lazy_iterpolate +import Core: GlobalRef export doc diff --git a/base/essentials.jl b/base/essentials.jl index 47b2ad00f2568d..f470cbfde1f66a 100644 --- a/base/essentials.jl +++ b/base/essentials.jl @@ -1,6 +1,6 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license -using Core: CodeInfo +using Core: CodeInfo, SimpleVector const Callable = Union{Function,Type} diff --git a/base/exports.jl b/base/exports.jl index 6f77b7c45fbb87..fef4f6a67dcd6c 100644 --- a/base/exports.jl +++ b/base/exports.jl @@ -28,7 +28,6 @@ export BitArray, BitMatrix, BitVector, - BufferStream, CartesianIndex, CartesianIndices, LinearIndices, @@ -45,9 +44,7 @@ export DevNull, Dict, Dims, - EachLine, Enum, - Enumerate, ExponentialBackOff, IndexCartesian, IndexLinear, @@ -68,7 +65,6 @@ export PartialQuickSort, PermutedDimsArray, QuickSort, - RangeIndex, Rational, Regex, RegexMatch, @@ -540,8 +536,6 @@ export merge!, merge, pairs, - #pop!, - #push!, reduce, setdiff!, setdiff, @@ -570,7 +564,7 @@ export ∩, ∪, -# strings and text output +# strings ascii, base, bin, @@ -583,12 +577,10 @@ export dec, digits, digits!, - dump, escape_string, hex, hex2bytes, hex2bytes!, - info, isalpha, isascii, iscntrl, @@ -604,7 +596,6 @@ export lowercase, isvalid, join, - logging, lpad, lstrip, ncodeunits, @@ -612,10 +603,6 @@ export nextind, oct, prevind, - print, - print_shortest, - println, - printstyled, repeat, replace, replace!, @@ -624,14 +611,9 @@ export rpad, rsplit, rstrip, - show, - showcompact, - showerror, split, - sprint, string, strip, - summary, textwidth, thisind, titlecase, @@ -639,9 +621,23 @@ export ucfirst, unescape_string, uppercase, - warn, -# logging frontend +# text output + dump, + print, + print_shortest, + println, + printstyled, + show, + showcompact, + showerror, + sprint, + summary, + +# logging + info, + logging, + warn, @debug, @info, @warn, @@ -738,8 +734,6 @@ export systemerror, # stack traces - StackTrace, - StackFrame, stacktrace, # types diff --git a/base/methodshow.jl b/base/methodshow.jl index c19b85595b0af0..1b86c1aef5a90b 100644 --- a/base/methodshow.jl +++ b/base/methodshow.jl @@ -185,7 +185,7 @@ function show_method_table(io::IO, ms::MethodList, max::Int=-1, header::Bool=tru end show(io::IO, ms::MethodList) = show_method_table(io, ms) -show(io::IO, mt::MethodTable) = show_method_table(io, MethodList(mt)) +show(io::IO, mt::Core.MethodTable) = show_method_table(io, MethodList(mt)) function inbase(m::Module) if m == Base @@ -299,7 +299,7 @@ function show(io::IO, mime::MIME"text/html", ms::MethodList) print(io, "") end -show(io::IO, mime::MIME"text/html", mt::MethodTable) = show(io, mime, MethodList(mt)) +show(io::IO, mime::MIME"text/html", mt::Core.MethodTable) = show(io, mime, MethodList(mt)) # pretty-printing of AbstractVector{Method} function show(io::IO, mime::MIME"text/plain", mt::AbstractVector{Method}) diff --git a/base/precompile.jl b/base/precompile.jl index e0a03365b1f581..777cf6714c9574 100644 --- a/base/precompile.jl +++ b/base/precompile.jl @@ -858,7 +858,7 @@ precompile(Tuple{typeof(Base.isassigned), Array{Symbol, 1}, Int64}) precompile(Tuple{typeof(Base.rehash!), Base.Dict{UInt64, Nothing}, Int64}) precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{UInt64, Nothing}, UInt64}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{UInt64, Nothing}, Nothing, UInt64, Int64}) -precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{WeakRef, Any}, TypeName}) +precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{WeakRef, Any}, Core.TypeName}) precompile(Tuple{typeof(Base.isassigned), Array{Union{Tuple{Any, Int64}, Tuple{Tuple{}, Any, Bool}}, 1}, Int64}) precompile(Tuple{typeof(Base.uvfinalize), Base.TCPSocket}) precompile(Tuple{typeof(Base.close), Base.TCPSocket}) diff --git a/base/reflection.jl b/base/reflection.jl index 65e4ef65304e6f..abb216caadeabc 100644 --- a/base/reflection.jl +++ b/base/reflection.jl @@ -663,7 +663,7 @@ end # type for reflecting and pretty-printing a subset of methods mutable struct MethodList ms::Array{Method,1} - mt::MethodTable + mt::Core.MethodTable end length(m::MethodList) = length(m.ms) @@ -672,7 +672,7 @@ start(m::MethodList) = start(m.ms) done(m::MethodList, s) = done(m.ms, s) next(m::MethodList, s) = next(m.ms, s) -function MethodList(mt::MethodTable) +function MethodList(mt::Core.MethodTable) ms = Method[] visit(mt) do m push!(ms, m) @@ -711,11 +711,11 @@ function methods(@nospecialize(f)) return methods(f, Tuple{Vararg{Any}}) end -function visit(f, mt::MethodTable) +function visit(f, mt::Core.MethodTable) mt.defs !== nothing && visit(f, mt.defs) nothing end -function visit(f, mc::TypeMapLevel) +function visit(f, mc::Core.TypeMapLevel) if mc.targ !== nothing e = mc.targ::Vector{Any} for i in 1:length(e) @@ -732,7 +732,7 @@ function visit(f, mc::TypeMapLevel) mc.any !== nothing && visit(f, mc.any) nothing end -function visit(f, d::TypeMapEntry) +function visit(f, d::Core.TypeMapEntry) while d !== nothing f(d.func) d = d.next @@ -740,14 +740,14 @@ function visit(f, d::TypeMapEntry) nothing end -function length(mt::MethodTable) +function length(mt::Core.MethodTable) n = 0 visit(mt) do m n += 1 end return n::Int end -isempty(mt::MethodTable) = (mt.defs === nothing) +isempty(mt::Core.MethodTable) = (mt.defs === nothing) uncompressed_ast(m::Method) = isdefined(m,:source) ? uncompressed_ast(m, m.source) : isdefined(m,:generator) ? error("Method is @generated; try `code_lowered` instead.") : diff --git a/base/show.jl b/base/show.jl index ac9251bc027ac8..7edda67fd69457 100644 --- a/base/show.jl +++ b/base/show.jl @@ -441,7 +441,7 @@ isvisible(sym::Symbol, parent::Module, from::Module) = isdefined(from, sym) && !isdeprecated(from, sym) && !isdeprecated(parent, sym) && getfield(from, sym) === getfield(parent, sym) -function show_type_name(io::IO, tn::TypeName) +function show_type_name(io::IO, tn::Core.TypeName) if tn === UnionAll.name # by coincidence, `typeof(Type)` is a valid representation of the UnionAll type. # intercept this case and print `UnionAll` instead. @@ -547,7 +547,7 @@ macro show(exs...) return blk end -function show(io::IO, tn::TypeName) +function show(io::IO, tn::Core.TypeName) show_type_name(io, tn) end diff --git a/base/stacktraces.jl b/base/stacktraces.jl index b699a60ed0e86f..2dd366e91563f4 100644 --- a/base/stacktraces.jl +++ b/base/stacktraces.jl @@ -54,7 +54,7 @@ struct StackFrame # this type should be kept platform-agnostic so that profiles "the line number in the file containing the execution context" line::Int "the MethodInstance or CodeInfo containing the execution context (if it could be found)" - linfo::Union{Core.MethodInstance, CodeInfo, Nothing} + linfo::Union{Core.MethodInstance, Core.CodeInfo, Nothing} "true if the code is from C" from_c::Bool "true if the code is from an inlined frame" @@ -133,7 +133,7 @@ function lookup(ip::Base.InterpreterIP) # interpreted top-level expression with no CodeInfo return [StackFrame(top_level_scope_sym, empty_sym, 0, nothing, false, false, 0)] else - assert(ip.code isa CodeInfo) + assert(ip.code isa Core.CodeInfo) codeinfo = ip.code func = top_level_scope_sym file = empty_sym @@ -265,7 +265,7 @@ function remove_frames!(stack::StackTrace, m::Module) return stack end -is_top_level_frame(f::StackFrame) = f.linfo isa CodeInfo || (f.linfo === nothing && f.func === top_level_scope_sym) +is_top_level_frame(f::StackFrame) = f.linfo isa Core.CodeInfo || (f.linfo === nothing && f.func === top_level_scope_sym) function show_spec_linfo(io::IO, frame::StackFrame) if frame.linfo == nothing @@ -285,7 +285,7 @@ function show_spec_linfo(io::IO, frame::StackFrame) else Base.show(io, frame.linfo) end - elseif frame.linfo isa CodeInfo + elseif frame.linfo isa Core.CodeInfo print(io, "top-level scope") end end diff --git a/base/statistics.jl b/base/statistics.jl index 61d29ebb596307..21a30a9be3cf91 100644 --- a/base/statistics.jl +++ b/base/statistics.jl @@ -697,7 +697,7 @@ function _quantilesort!(v::AbstractArray, sorted::Bool, minp::Real, maxp::Real) hi = ceil(Int,1+maxp*(lv-1)) # only need to perform partial sort - sort!(v, 1, lv, PartialQuickSort(lo:hi), Base.Sort.Forward) + sort!(v, 1, lv, Sort.PartialQuickSort(lo:hi), Base.Sort.Forward) end isnan(v[end]) && throw(ArgumentError("quantiles are undefined in presence of NaNs")) return v diff --git a/base/summarysize.jl b/base/summarysize.jl index 4d49f2c603543d..b60912a49d4508 100644 --- a/base/summarysize.jl +++ b/base/summarysize.jl @@ -21,8 +21,8 @@ Compute the amount of memory used by all unique objects reachable from the argum fields, even if those fields would normally be excluded. """ function summarysize(obj; - exclude = Union{DataType, TypeName, Core.MethodInstance}, - chargeall = Union{TypeMapEntry, Method}) + exclude = Union{DataType, Core.TypeName, Core.MethodInstance}, + chargeall = Union{Core.TypeMapEntry, Method}) @nospecialize obj exclude chargeall ss = SummarySize(IdDict(), Any[], Int[], exclude, chargeall) size::Int = ss(obj) @@ -94,7 +94,7 @@ function (ss::SummarySize)(obj::DataType) return size end -function (ss::SummarySize)(obj::TypeName) +function (ss::SummarySize)(obj::Core.TypeName) key = pointer_from_objref(obj) haskey(ss.seen, key) ? (return 0) : (ss.seen[key] = true) return Core.sizeof(obj) + (isdefined(obj, :mt) ? ss(obj.mt) : 0) diff --git a/base/sysimg.jl b/base/sysimg.jl index 6f0d481464645a..8a344288a8f712 100644 --- a/base/sysimg.jl +++ b/base/sysimg.jl @@ -2,7 +2,7 @@ baremodule Base -using Core.Intrinsics +using Core.Intrinsics, Core.IR ccall(:jl_set_istopmod, Cvoid, (Any, Bool), Base, true) getproperty(x, f::Symbol) = getfield(x, f) diff --git a/doc/src/devdocs/ast.md b/doc/src/devdocs/ast.md index 65639f51d4bcfc..d299e7c68c9b66 100644 --- a/doc/src/devdocs/ast.md +++ b/doc/src/devdocs/ast.md @@ -35,7 +35,7 @@ The following data types exist in lowered form: * `LineNumberNode` - Contains a single number, specifying the line number the next statement came from. + Contains a number and a file name, specifying the line number the next statement came from. * `LabelNode` diff --git a/doc/src/manual/stacktraces.md b/doc/src/manual/stacktraces.md index 56d21d9b3b17d5..2cc3d3aa65e231 100644 --- a/doc/src/manual/stacktraces.md +++ b/doc/src/manual/stacktraces.md @@ -16,8 +16,8 @@ julia> stacktrace() (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at event.jl:73 ``` -Calling [`stacktrace()`](@ref) returns a vector of [`StackFrame`](@ref) s. For ease of use, the -alias [`StackTrace`](@ref) can be used in place of `Vector{StackFrame}`. (Examples with `[...]` +Calling [`stacktrace()`](@ref) returns a vector of [`StackTraces.StackFrame`](@ref) s. For ease of use, the +alias [`StackTraces.StackTrace`](@ref) can be used in place of `Vector{StackFrame}`. (Examples with `[...]` indicate that output may vary depending on how the code is run.) ```julia-repl @@ -66,7 +66,7 @@ julia> example() ## Extracting useful information -Each [`StackFrame`](@ref) contains the function name, file name, line number, lambda info, a flag +Each [`StackTraces.StackFrame`](@ref) contains the function name, file name, line number, lambda info, a flag indicating whether the frame has been inlined, a flag indicating whether it is a C function (by default C functions do not appear in the stack trace), and an integer representation of the pointer returned by [`backtrace`](@ref): @@ -257,7 +257,7 @@ julia> stacktrace(trace, true) ip:0xffffffffffffffff ``` -Individual pointers returned by [`backtrace`](@ref) can be translated into [`StackFrame`](@ref) +Individual pointers returned by [`backtrace`](@ref) can be translated into [`StackTraces.StackFrame`](@ref) s by passing them into [`StackTraces.lookup`](@ref): ```julia-repl diff --git a/stdlib/Dates/src/parse.jl b/stdlib/Dates/src/parse.jl index fa1b2722976da0..103815d6f941df 100644 --- a/stdlib/Dates/src/parse.jl +++ b/stdlib/Dates/src/parse.jl @@ -5,7 +5,7 @@ _directives(::Type{DateFormat{S,T}}) where {S,T} = T.parameters character_codes(df::Type{DateFormat{S,T}}) where {S,T} = character_codes(_directives(df)) -function character_codes(directives::SimpleVector) +function character_codes(directives::Core.SimpleVector) letters = sizehint!(Char[], length(directives)) for (i, directive) in enumerate(directives) if directive <: DatePart diff --git a/stdlib/Distributed/src/clusterserialize.jl b/stdlib/Distributed/src/clusterserialize.jl index 55ed7dcd11326a..5c2fe8afd67467 100644 --- a/stdlib/Distributed/src/clusterserialize.jl +++ b/stdlib/Distributed/src/clusterserialize.jl @@ -50,18 +50,18 @@ end function remember_object(s::ClusterSerializer, @nospecialize(o), n::UInt64) known_object_data[n] = o - if isa(o, TypeName) && !haskey(object_numbers, o) + if isa(o, Core.TypeName) && !haskey(object_numbers, o) # set up reverse mapping for serialize object_numbers[o] = n end return nothing end -function deserialize(s::ClusterSerializer, ::Type{TypeName}) +function deserialize(s::ClusterSerializer, ::Type{Core.TypeName}) full_body_sent = deserialize(s) number = read(s.io, UInt64) if !full_body_sent - tn = lookup_object_number(s, number)::TypeName + tn = lookup_object_number(s, number)::Core.TypeName remember_object(s, tn, number) deserialize_cycle(s, tn) else @@ -73,7 +73,7 @@ function deserialize(s::ClusterSerializer, ::Type{TypeName}) return tn end -function serialize(s::ClusterSerializer, t::TypeName) +function serialize(s::ClusterSerializer, t::Core.TypeName) serialize_cycle(s, t) && return writetag(s.io, TYPENAME_TAG) @@ -102,7 +102,7 @@ function serialize(s::ClusterSerializer, t::TypeName) nothing end -function serialize(s::ClusterSerializer, g::GlobalRef) +function serialize(s::ClusterSerializer, g::Core.GlobalRef) # Record if required and then invoke the default GlobalRef serializer. sym = g.name if g.mod === Main && isdefined(g.mod, sym) @@ -113,7 +113,7 @@ function serialize(s::ClusterSerializer, g::GlobalRef) end end - invoke(serialize, Tuple{AbstractSerializer, GlobalRef}, s, g) + invoke(serialize, Tuple{AbstractSerializer, Core.GlobalRef}, s, g) end # Send/resend a global object if diff --git a/stdlib/Distributed/src/macros.jl b/stdlib/Distributed/src/macros.jl index f55ccd7ccf9d8e..6a4a717f478889 100644 --- a/stdlib/Distributed/src/macros.jl +++ b/stdlib/Distributed/src/macros.jl @@ -164,7 +164,7 @@ processes to have execute the expression. Equivalent to calling `remotecall_eval(Main, procs, expr)`. """ macro everywhere(ex) - procs = GlobalRef(@__MODULE__, :procs) + procs = Core.GlobalRef(@__MODULE__, :procs) return esc(:(@everywhere $procs() $ex)) end diff --git a/stdlib/Distributed/src/precompile.jl b/stdlib/Distributed/src/precompile.jl index 9b3b5ac9d35147..842d0403b35835 100644 --- a/stdlib/Distributed/src/precompile.jl +++ b/stdlib/Distributed/src/precompile.jl @@ -120,7 +120,7 @@ precompile(Tuple{typeof(Serialization.serialize), Distributed.ClusterSerializer{ precompile(Tuple{typeof(Serialization.serialize), Distributed.ClusterSerializer{Base.TCPSocket}, Int64}) precompile(Tuple{typeof(Serialization.serialize), Distributed.ClusterSerializer{Base.TCPSocket}, Array{Union{Tuple{Any, Int64}, Tuple{Tuple{}, Any, Bool}}, 1}}) precompile(Tuple{typeof(Serialization.should_send_whole_type), Distributed.ClusterSerializer{Base.TCPSocket}, Type{Any}}) -precompile(Tuple{typeof(Serialization.serialize), Distributed.ClusterSerializer{Base.TCPSocket}, SimpleVector}) +precompile(Tuple{typeof(Serialization.serialize), Distributed.ClusterSerializer{Base.TCPSocket}, Core.SimpleVector}) precompile(Tuple{typeof(Serialization.serialize_type_data), Distributed.ClusterSerializer{Base.TCPSocket}, Type{Any}, Bool}) precompile(Tuple{typeof(Serialization.serialize), Distributed.ClusterSerializer{Base.TCPSocket}, Type{Any}}) precompile(Tuple{typeof(Serialization.serialize), Distributed.ClusterSerializer{Base.TCPSocket}, Tuple{Int64}}) @@ -132,10 +132,10 @@ precompile(Tuple{typeof(Serialization.serialize_mod_names), Distributed.ClusterS precompile(Tuple{typeof(Serialization.serialize), Distributed.ClusterSerializer{Base.TCPSocket}, Symbol}) precompile(Tuple{typeof(Serialization.serialize), Distributed.ClusterSerializer{Base.TCPSocket}, Module}) precompile(Tuple{typeof(Serialization.serialize), Distributed.ClusterSerializer{Base.TCPSocket}, Array{Any, 1}}) -precompile(Tuple{typeof(Serialization.serialize_cycle), Distributed.ClusterSerializer{Base.TCPSocket}, TypeName}) -precompile(Tuple{typeof(Serialization.serialize_typename), Distributed.ClusterSerializer{Base.TCPSocket}, TypeName}) +precompile(Tuple{typeof(Serialization.serialize_cycle), Distributed.ClusterSerializer{Base.TCPSocket}, Core.TypeName}) +precompile(Tuple{typeof(Serialization.serialize_typename), Distributed.ClusterSerializer{Base.TCPSocket}, Core.TypeName}) precompile(Tuple{typeof(Serialization.serialize), Distributed.ClusterSerializer{Base.TCPSocket}, Array{Symbol, 1}}) -precompile(Tuple{typeof(Serialization.serialize), Distributed.ClusterSerializer{Base.TCPSocket}, TypeName}) +precompile(Tuple{typeof(Serialization.serialize), Distributed.ClusterSerializer{Base.TCPSocket}, Core.TypeName}) precompile(Tuple{typeof(Serialization.serialize_cycle_header), Distributed.ClusterSerializer{Base.TCPSocket}, Type{Union{Tuple{Any, Int64}, Tuple{Tuple{}, Any, Bool}}}}) precompile(Tuple{typeof(Serialization.serialize_any), Distributed.ClusterSerializer{Base.TCPSocket}, Type{Union{Tuple{Any, Int64}, Tuple{Tuple{}, Any, Bool}}}}) precompile(Tuple{typeof(Distributed.send_msg_), Distributed.Worker, Distributed.MsgHeader, Distributed.ResultMsg, Bool}) @@ -192,7 +192,7 @@ precompile(Tuple{typeof(Distributed.message_handler_loop), Base.TCPSocket, Base. precompile(Tuple{typeof(Distributed.process_tcp_streams), Base.TCPSocket, Base.TCPSocket, Bool}) precompile(Tuple{typeof(Serialization.deserialize), Distributed.ClusterSerializer{Base.TCPSocket}, Type{Union}}) precompile(Tuple{typeof(Serialization.deserialize), Distributed.ClusterSerializer{Base.TCPSocket}, Type{Module}}) -precompile(Tuple{typeof(Serialization.deserialize), Distributed.ClusterSerializer{Base.TCPSocket}, Type{SimpleVector}}) +precompile(Tuple{typeof(Serialization.deserialize), Distributed.ClusterSerializer{Base.TCPSocket}, Type{Core.SimpleVector}}) precompile(Tuple{Type{Distributed.JoinPGRPMsg}, Int64, Array{Union{Tuple{Any, Int64}, Tuple{Tuple{}, Any, Bool}}, 1}, Symbol, Bool}) precompile(Tuple{typeof(Distributed.handle_msg), Distributed.JoinPGRPMsg, Distributed.MsgHeader, Base.TCPSocket, Base.TCPSocket, Base.VersionNumber}) precompile(Tuple{Type{Distributed.WorkerConfig}}) diff --git a/stdlib/Distributed/test/distributed_exec.jl b/stdlib/Distributed/test/distributed_exec.jl index 41a5f1f439daf2..a32b4ab0c58bc5 100644 --- a/stdlib/Distributed/test/distributed_exec.jl +++ b/stdlib/Distributed/test/distributed_exec.jl @@ -434,7 +434,7 @@ let ex @test ((ex.captured::CapturedException).ex::ErrorException).msg == "A.error" bt = ex.captured.processed_bt::Array{Any,1} @test length(bt) > 1 - frame, repeated = bt[1]::Tuple{StackFrame, Int} + frame, repeated = bt[1]::Tuple{Base.StackTraces.StackFrame, Int} @test frame.func == :foo @test frame.linfo == nothing @test repeated == 1 diff --git a/stdlib/InteractiveUtils/src/codeview.jl b/stdlib/InteractiveUtils/src/codeview.jl index c9516e8666761b..2b42d010161e7f 100644 --- a/stdlib/InteractiveUtils/src/codeview.jl +++ b/stdlib/InteractiveUtils/src/codeview.jl @@ -23,7 +23,7 @@ function code_warntype(io::IO, f, @nospecialize(t)) function scan_exprs!(used, exprs) for ex in exprs - if isa(ex, Slot) + if isa(ex, Core.Slot) used[ex.id] = true elseif isa(ex, Expr) scan_exprs!(used, ex.args) @@ -75,7 +75,7 @@ function _dump_function(@nospecialize(f), @nospecialize(t), native::Bool, wrappe meth = which(f, t) t = to_tuple_type(t) tt = signature_type(f, t) - (ti, env) = ccall(:jl_type_intersection_with_env, Any, (Any, Any), tt, meth.sig)::SimpleVector + (ti, env) = ccall(:jl_type_intersection_with_env, Any, (Any, Any), tt, meth.sig)::Core.SimpleVector meth = Base.func_for_method_checked(meth, ti) linfo = ccall(:jl_specializations_get_linfo, Ref{Core.MethodInstance}, (Any, Any, Any, UInt), meth, ti, env, world) # get the code for it diff --git a/stdlib/InteractiveUtils/src/macros.jl b/stdlib/InteractiveUtils/src/macros.jl index 11f8d55f5e11db..860301f0bc21bb 100644 --- a/stdlib/InteractiveUtils/src/macros.jl +++ b/stdlib/InteractiveUtils/src/macros.jl @@ -35,8 +35,8 @@ function gen_call_with_extracted_types(__module__, fcn, ex0) exret = Expr(:call, :error, "expression is not a function call or symbol") elseif ex.head == :call if any(e->(isa(e, Expr) && e.head==:(...)), ex0.args) && - (ex.args[1] === GlobalRef(Core,:_apply) || - ex.args[1] === GlobalRef(Base,:_apply)) + (ex.args[1] === Core.GlobalRef(Core,:_apply) || + ex.args[1] === Core.GlobalRef(Base,:_apply)) # check for splatting exret = Expr(:call, ex.args[1], fcn, Expr(:tuple, esc(ex.args[2]), diff --git a/stdlib/InteractiveUtils/test/runtests.jl b/stdlib/InteractiveUtils/test/runtests.jl index 46b913865c3578..d13cb94d370136 100644 --- a/stdlib/InteractiveUtils/test/runtests.jl +++ b/stdlib/InteractiveUtils/test/runtests.jl @@ -114,8 +114,8 @@ end # module WarnType # Adds test for PR #17636 let a = @code_typed 1 + 1 b = @code_lowered 1 + 1 - @test isa(a, Pair{CodeInfo, DataType}) - @test isa(b, CodeInfo) + @test isa(a, Pair{Core.CodeInfo, DataType}) + @test isa(b, Core.CodeInfo) @test isa(a[1].code, Array{Any,1}) @test isa(b.code, Array{Any,1}) diff --git a/stdlib/Markdown/src/Julia/interp.jl b/stdlib/Markdown/src/Julia/interp.jl index ca78f3a41a17a8..7871978772df13 100644 --- a/stdlib/Markdown/src/Julia/interp.jl +++ b/stdlib/Markdown/src/Julia/interp.jl @@ -39,7 +39,7 @@ end toexpr(x) = x -toexpr(xs::Vector{Any}) = Expr(:call, GlobalRef(Base,:vector_any), map(toexpr, xs)...) +toexpr(xs::Vector{Any}) = Expr(:call, Core.GlobalRef(Base,:vector_any), map(toexpr, xs)...) for T in Any[MD, Paragraph, Header, Link, Bold, Italic] @eval function toexpr(md::$T) diff --git a/stdlib/Profile/src/Profile.jl b/stdlib/Profile/src/Profile.jl index 8ac2660eca2221..b931f89d59bd3a 100644 --- a/stdlib/Profile/src/Profile.jl +++ b/stdlib/Profile/src/Profile.jl @@ -7,7 +7,7 @@ Profiling support, main entry point is the [`@profile`](@ref) macro. """ module Profile -import Base.StackTraces: lookup, UNKNOWN, show_spec_linfo +import Base.StackTraces: lookup, UNKNOWN, show_spec_linfo, StackFrame using Base: iszero using Printf: @sprintf diff --git a/stdlib/Profile/test/runtests.jl b/stdlib/Profile/test/runtests.jl index 0e1db25e4b2201..6dc42b2a973677 100644 --- a/stdlib/Profile/test/runtests.jl +++ b/stdlib/Profile/test/runtests.jl @@ -19,7 +19,7 @@ let r = Profile.retrieve() serialize(io, r) close(io) open(path) do io - @test isa(deserialize(io), Tuple{Vector{UInt},Dict{UInt64,Vector{StackFrame}}}) + @test isa(deserialize(io), Tuple{Vector{UInt},Dict{UInt64,Vector{Base.StackTraces.StackFrame}}}) end end end diff --git a/stdlib/REPL/src/REPLCompletions.jl b/stdlib/REPL/src/REPLCompletions.jl index 9e6ff146133562..c64d68e6b9ddf5 100644 --- a/stdlib/REPL/src/REPLCompletions.jl +++ b/stdlib/REPL/src/REPLCompletions.jl @@ -303,7 +303,7 @@ get_value_getfield(sym, fn) = get_value(sym, fn) function get_type_call(expr::Expr) f_name = expr.args[1] # The if statement should find the f function. How f is found depends on how f is referenced - if isa(f_name, GlobalRef) && isconst(f_name.mod,f_name.name) && isdefined(f_name.mod,f_name.name) + if isa(f_name, Core.GlobalRef) && isconst(f_name.mod,f_name.name) && isdefined(f_name.mod,f_name.name) ft = typeof(eval(f_name)) found = true else @@ -335,7 +335,7 @@ function try_get_type(sym::Expr, fn::Module) # getfield call is special cased as the evaluation of getfield provides good type information, # is inexpensive and it is also performed in the complete_symbol function. a1 = sym.args[1] - if isa(a1,GlobalRef) && isconst(a1.mod,a1.name) && isdefined(a1.mod,a1.name) && + if isa(a1,Core.GlobalRef) && isconst(a1.mod,a1.name) && isdefined(a1.mod,a1.name) && eval(a1) === Core.getfield val, found = get_value_getfield(sym, Main) return found ? Base.typesof(val).parameters[1] : Any, found @@ -343,13 +343,13 @@ function try_get_type(sym::Expr, fn::Module) return get_type_call(sym) elseif sym.head === :thunk thk = sym.args[1] - rt = ccall(:jl_infer_thunk, Any, (Any, Any), thk::CodeInfo, fn) + rt = ccall(:jl_infer_thunk, Any, (Any, Any), thk::Core.CodeInfo, fn) rt !== Any && return (rt, true) elseif sym.head === :ref # some simple cases of `expand` - return try_get_type(Expr(:call, GlobalRef(Base, :getindex), sym.args...), fn) + return try_get_type(Expr(:call, Core.GlobalRef(Base, :getindex), sym.args...), fn) elseif sym.head === :. - return try_get_type(Expr(:call, GlobalRef(Core, :getfield), sym.args...), fn) + return try_get_type(Expr(:call, Core.GlobalRef(Core, :getfield), sym.args...), fn) end return (Any, false) end diff --git a/stdlib/Serialization/src/Serialization.jl b/stdlib/Serialization/src/Serialization.jl index 181cf2e2baa288..bfdd479d0c4ae1 100644 --- a/stdlib/Serialization/src/Serialization.jl +++ b/stdlib/Serialization/src/Serialization.jl @@ -8,8 +8,9 @@ Provide serialization of Julia objects via the functions module Serialization import Base: GMP, Bottom, unsafe_convert, uncompressed_ast -import Core: svec +import Core: svec, SimpleVector using Base: ViewIndex, Slice, index_lengths, unwrap_unionall +using Core.IR export serialize, deserialize, AbstractSerializer, Serializer @@ -36,7 +37,7 @@ const n_reserved_tags = 12 const TAGS = Any[ Symbol, Int8, UInt8, Int16, UInt16, Int32, UInt32, Int64, UInt64, Int128, UInt128, - Float16, Float32, Float64, Char, DataType, Union, UnionAll, TypeName, Tuple, + Float16, Float32, Float64, Char, DataType, Union, UnionAll, Core.TypeName, Tuple, Array, Expr, LineNumberNode, LabelNode, GotoNode, QuoteNode, CodeInfo, TypeVar, Core.Box, Core.MethodInstance, Module, Task, String, SimpleVector, Method, GlobalRef, SlotNumber, TypedSlot, NewvarNode, SSAValue, @@ -110,7 +111,7 @@ const METHODINSTANCE_TAG = sertag(Core.MethodInstance) const METHOD_TAG = sertag(Method) const TASK_TAG = sertag(Task) const DATATYPE_TAG = sertag(DataType) -const TYPENAME_TAG = sertag(TypeName) +const TYPENAME_TAG = sertag(Core.TypeName) const INT32_TAG = sertag(Int32) const INT64_TAG = sertag(Int64) const GLOBALREF_TAG = sertag(GlobalRef) @@ -478,14 +479,14 @@ function serialize(s::AbstractSerializer, g::GlobalRef) serialize(s, g.name) end -function serialize(s::AbstractSerializer, t::TypeName) +function serialize(s::AbstractSerializer, t::Core.TypeName) serialize_cycle(s, t) && return writetag(s.io, TYPENAME_TAG) write(s.io, object_number(s, t)) serialize_typename(s, t) end -function serialize_typename(s::AbstractSerializer, t::TypeName) +function serialize_typename(s::AbstractSerializer, t::Core.TypeName) serialize(s, t.name) serialize(s, t.names) primary = unwrap_unionall(t.wrapper) @@ -760,7 +761,7 @@ function handle_deserialize(s::AbstractSerializer, b::Int32) elseif b == FULL_DATATYPE_TAG return deserialize_datatype(s, true) elseif b == WRAPPER_DATATYPE_TAG - tname = deserialize(s)::TypeName + tname = deserialize(s)::Core.TypeName return unwrap_unionall(tname.wrapper) elseif b == OBJECT_TAG t = deserialize(s) @@ -986,7 +987,7 @@ end module __deserialized_types__ end -function deserialize(s::AbstractSerializer, ::Type{TypeName}) +function deserialize(s::AbstractSerializer, ::Type{Core.TypeName}) number = read(s.io, UInt64) return deserialize_typename(s, number) end @@ -999,7 +1000,7 @@ function deserialize_typename(s::AbstractSerializer, number) else # reuse the same name for the type, if possible, for nicer debugging tn_name = isdefined(__deserialized_types__, name) ? gensym() : name - tn = ccall(:jl_new_typename_in, Ref{TypeName}, (Any, Any), + tn = ccall(:jl_new_typename_in, Ref{Core.TypeName}, (Any, Any), tn_name, __deserialized_types__) makenew = true end @@ -1055,13 +1056,13 @@ function deserialize_typename(s::AbstractSerializer, number) end end end - return tn::TypeName + return tn::Core.TypeName end function deserialize_datatype(s::AbstractSerializer, full::Bool) slot = s.counter; s.counter += 1 if full - tname = deserialize(s)::TypeName + tname = deserialize(s)::Core.TypeName ty = tname.wrapper else name = deserialize(s)::Symbol diff --git a/stdlib/Serialization/src/precompile.jl b/stdlib/Serialization/src/precompile.jl index 2f29f05c2cb326..4cf8485578c01a 100644 --- a/stdlib/Serialization/src/precompile.jl +++ b/stdlib/Serialization/src/precompile.jl @@ -1,5 +1,5 @@ precompile(Tuple{typeof(Serialization.write_as_tag), Base.TCPSocket, Int32}) -precompile(Tuple{typeof(Serialization.object_number), TypeName}) +precompile(Tuple{typeof(Serialization.object_number), Core.TypeName}) precompile(Tuple{typeof(Serialization.serialize_array_data), Base.TCPSocket, Array{Int64, 1}}) precompile(Tuple{typeof(Serialization.deserialize_array), Serialization.Serializer{Base.PipeEndpoint}}) precompile(Tuple{typeof(Serialization.deserialize), Base.PipeEndpoint}) @@ -20,21 +20,21 @@ precompile(Tuple{typeof(Serialization.serialize), Serialization.Serializer{Base. precompile(Tuple{typeof(Serialization.serialize), Serialization.Serializer{Base.Pipe}, Int64}) precompile(Tuple{typeof(Serialization.serialize), Serialization.Serializer{Base.Pipe}, Module}) precompile(Tuple{typeof(Serialization.serialize), Serialization.Serializer{Base.Pipe}, QuoteNode}) -precompile(Tuple{typeof(Serialization.serialize), Serialization.Serializer{Base.Pipe}, SimpleVector}) +precompile(Tuple{typeof(Serialization.serialize), Serialization.Serializer{Base.Pipe}, Core.SimpleVector}) precompile(Tuple{typeof(Serialization.serialize), Serialization.Serializer{Base.Pipe}, String}) precompile(Tuple{typeof(Serialization.serialize), Serialization.Serializer{Base.Pipe}, Symbol}) precompile(Tuple{typeof(Serialization.serialize), Serialization.Serializer{Base.Pipe}, Tuple{Int64}}) precompile(Tuple{typeof(Serialization.serialize), Serialization.Serializer{Base.Pipe}, Tuple{Symbol, UInt64}}) precompile(Tuple{typeof(Serialization.serialize), Serialization.Serializer{Base.Pipe}, Type{Any}}) -precompile(Tuple{typeof(Serialization.serialize), Serialization.Serializer{Base.Pipe}, TypeName}) +precompile(Tuple{typeof(Serialization.serialize), Serialization.Serializer{Base.Pipe}, Core.TypeName}) precompile(Tuple{typeof(Serialization.serialize), Serialization.Serializer{Base.Pipe}, UInt64}) precompile(Tuple{typeof(Serialization.serialize_cycle), Serialization.Serializer{Base.Pipe}, Expr}) -precompile(Tuple{typeof(Serialization.serialize_cycle), Serialization.Serializer{Base.Pipe}, TypeName}) +precompile(Tuple{typeof(Serialization.serialize_cycle), Serialization.Serializer{Base.Pipe}, Core.TypeName}) precompile(Tuple{typeof(Serialization.serialize_cycle), Serialization.Serializer{Base.Pipe}, UInt64}) precompile(Tuple{typeof(Serialization.serialize_cycle_header), Serialization.Serializer{Base.Pipe}, QuoteNode}) precompile(Tuple{typeof(Serialization.serialize_mod_names), Serialization.Serializer{Base.Pipe}, Module}) precompile(Tuple{typeof(Serialization.serialize_type), Serialization.Serializer{Base.Pipe}, DataType}) precompile(Tuple{typeof(Serialization.serialize_type_data), Serialization.Serializer{Base.Pipe}, Type{Any}, Bool}) -precompile(Tuple{typeof(Serialization.serialize_typename), Serialization.Serializer{Base.Pipe}, TypeName}) +precompile(Tuple{typeof(Serialization.serialize_typename), Serialization.Serializer{Base.Pipe}, Core.TypeName}) precompile(Tuple{typeof(Serialization.should_send_whole_type), Serialization.Serializer{Base.Pipe}, Type{Any}}) precompile(Tuple{typeof(Serialization.write_as_tag), Base.Pipe, Int32}) diff --git a/test/backtrace.jl b/test/backtrace.jl index 8e4670314627bb..4477dd1e98be20 100644 --- a/test/backtrace.jl +++ b/test/backtrace.jl @@ -145,7 +145,7 @@ lkup = map(StackTraces.lookup, bt) hastoplevel = false for sfs in lkup for sf in sfs - if sf.linfo isa CodeInfo + if sf.linfo isa Core.CodeInfo global hastoplevel = true end end diff --git a/test/codegen.jl b/test/codegen.jl index 931dfe3fc08d8c..475d2e1abe973a 100644 --- a/test/codegen.jl +++ b/test/codegen.jl @@ -95,7 +95,7 @@ if opt_level > 0 # String test_loads_no_call(get_llvm(core_sizeof, Tuple{String}), [Iptr]) # String - test_loads_no_call(get_llvm(core_sizeof, Tuple{SimpleVector}), [Iptr]) + test_loads_no_call(get_llvm(core_sizeof, Tuple{Core.SimpleVector}), [Iptr]) # Array test_loads_no_call(get_llvm(core_sizeof, Tuple{Vector{Int}}), [Iptr]) # As long as the eltype is known we don't need to load the elsize diff --git a/test/compiler/compiler.jl b/test/compiler/compiler.jl index 7d8eb6982c3ab9..4a398562a708a2 100644 --- a/test/compiler/compiler.jl +++ b/test/compiler/compiler.jl @@ -3,7 +3,7 @@ # tests for Core.Compiler correctness and precision import Core.Compiler: Const, Conditional, ⊑ -using Random +using Random, Core.IR using InteractiveUtils: code_llvm # demonstrate some of the type-size limits @@ -926,7 +926,7 @@ end @test isdefined_tfunc(Const(Base), Const(:length)) === Const(true) @test isdefined_tfunc(Const(Base), Symbol) == Bool @test isdefined_tfunc(Const(Base), Const(:NotCurrentlyDefinedButWhoKnows)) == Bool -@test isdefined_tfunc(SimpleVector, Const(1)) === Const(false) +@test isdefined_tfunc(Core.SimpleVector, Const(1)) === Const(false) @test Const(false) ⊑ isdefined_tfunc(Const(:x), Symbol) @test Const(false) ⊑ isdefined_tfunc(Const(:x), Const(:y)) @test isdefined_tfunc(Vector{Int}, Const(1)) == Bool @@ -1019,7 +1019,7 @@ function get_linfo(@nospecialize(f), @nospecialize(t)) ft = isa(f, Type) ? Type{f} : typeof(f) tt = Tuple{ft, t.parameters...} precompile(tt) - (ti, env) = ccall(:jl_type_intersection_with_env, Ref{SimpleVector}, (Any, Any), tt, meth.sig) + (ti, env) = ccall(:jl_type_intersection_with_env, Ref{Core.SimpleVector}, (Any, Any), tt, meth.sig) meth = Base.func_for_method_checked(meth, tt) return ccall(:jl_specializations_get_linfo, Ref{Core.MethodInstance}, (Any, Any, Any, UInt), meth, tt, env, world) diff --git a/test/compiler/validation.jl b/test/compiler/validation.jl index 9f640d6c71782c..b2454a3a1059ac 100644 --- a/test/compiler/validation.jl +++ b/test/compiler/validation.jl @@ -1,6 +1,6 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license -using Test +using Test, Core.IR function f22938(a, b, x...) d = 1 diff --git a/test/core.jl b/test/core.jl index c2995bda5639c0..698c54c5cc5917 100644 --- a/test/core.jl +++ b/test/core.jl @@ -2219,7 +2219,7 @@ t_a7652 = A7652 f7652() = fieldtype(t_a7652, :a) <: Int @test f7652() == (fieldtype(A7652, :a) <: Int) == true g7652() = fieldtype(DataType, :types) -@test g7652() == fieldtype(DataType, :types) == SimpleVector +@test g7652() == fieldtype(DataType, :types) == Core.SimpleVector @test fieldtype(t_a7652, 1) == Int h7652() = setfield!(a7652, 1, 2) h7652() @@ -4271,7 +4271,7 @@ function count_expr_push(ex::Expr, head::Symbol, counter) return false end -function metadata_matches(ast::CodeInfo) +function metadata_matches(ast::Core.CodeInfo) inbounds_cnt = Ref(0) for ex in ast.code::Array{Any,1} if isa(ex, Expr) @@ -4866,7 +4866,7 @@ missing_tvar(::T...) where {T} = T @test_throws MethodError missing_tvar(1, 2, "3") # issue #19059 - test for lowering of `let` with assignment not adding Box in simple cases -contains_Box(e::GlobalRef) = (e.name === :Box) +contains_Box(e::Core.GlobalRef) = (e.name === :Box) contains_Box(@nospecialize(e)) = false contains_Box(e::Expr) = any(contains_Box, e.args) @@ -4965,9 +4965,9 @@ end module TestModuleAssignment using Test -@eval $(GlobalRef(TestModuleAssignment, :x)) = 1 +@eval $(Core.GlobalRef(TestModuleAssignment, :x)) = 1 @test x == 1 -@eval $(GlobalRef(TestModuleAssignment, :x)) = 2 +@eval $(Core.GlobalRef(TestModuleAssignment, :x)) = 2 @test x == 2 end diff --git a/test/hashing.jl b/test/hashing.jl index 7cc0f1d7d2c8a3..f316e495d852bc 100644 --- a/test/hashing.jl +++ b/test/hashing.jl @@ -182,9 +182,9 @@ let a = QuoteNode(1), b = QuoteNode(1.0) @test (hash(a)==hash(b)) == (a==b) end -let a = Expr(:block, TypedSlot(1, Any)), - b = Expr(:block, TypedSlot(1, Any)), - c = Expr(:block, TypedSlot(3, Any)) +let a = Expr(:block, Core.TypedSlot(1, Any)), + b = Expr(:block, Core.TypedSlot(1, Any)), + c = Expr(:block, Core.TypedSlot(3, Any)) @test a == b && hash(a) == hash(b) @test a != c && hash(a) != hash(c) @test b != c && hash(b) != hash(c) diff --git a/test/inline.jl b/test/inline.jl index 0c3b187ee93bb0..6e155aa73d77ea 100644 --- a/test/inline.jl +++ b/test/inline.jl @@ -25,7 +25,7 @@ function test_inlined_symbols(func, argtypes) ast.args = src.code ast.typ = rettype walk(ast) do e - if isa(e, Slot) + if isa(e, Core.Slot) @test 1 <= e.id <= nl end if isa(e, NewvarNode) diff --git a/test/iobuffer.jl b/test/iobuffer.jl index 39d11a8b36bde8..23d7f2a9966f22 100644 --- a/test/iobuffer.jl +++ b/test/iobuffer.jl @@ -232,7 +232,7 @@ let io = IOBuffer(0) end @testset "BufferStream" begin - bstream = BufferStream() + bstream = Base.BufferStream() @test isopen(bstream) @test isreadable(bstream) @test iswritable(bstream) diff --git a/test/iterators.jl b/test/iterators.jl index 634a32f923149a..0ea0603770a943 100644 --- a/test/iterators.jl +++ b/test/iterators.jl @@ -30,13 +30,13 @@ end # check direct EachLine constructor let b = IOBuffer("foo\n") - @test collect(EachLine(b)) == ["foo"] + @test collect(Base.EachLine(b)) == ["foo"] seek(b, 0) - @test collect(EachLine(b, keep=true)) == ["foo\n"] + @test collect(Base.EachLine(b, keep=true)) == ["foo\n"] seek(b, 0) - @test collect(EachLine(b, ondone=()->0)) == ["foo"] + @test collect(Base.EachLine(b, ondone=()->0)) == ["foo"] seek(b, 0) - @test collect(EachLine(b, keep=true, ondone=()->0)) == ["foo\n"] + @test collect(Base.EachLine(b, keep=true, ondone=()->0)) == ["foo\n"] end # enumerate (issue #6284) diff --git a/test/reflection.jl b/test/reflection.jl index f41a6fd040d011..9993db250ecbdd 100644 --- a/test/reflection.jl +++ b/test/reflection.jl @@ -269,7 +269,7 @@ for (f, t) in Any[(definitely_not_in_sysimg, Tuple{}), (Base.:+, Tuple{Int, Int})] meth = which(f, t) tt = Tuple{typeof(f), t.parameters...} - (ti, env) = ccall(:jl_type_intersection_with_env, Any, (Any, Any), tt, meth.sig)::SimpleVector + (ti, env) = ccall(:jl_type_intersection_with_env, Any, (Any, Any), tt, meth.sig)::Core.SimpleVector @test ti === tt # intersection should be a subtype world = typemax(UInt) linfo = ccall(:jl_specializations_get_linfo, Ref{Core.MethodInstance}, (Any, Any, Any, UInt), meth, tt, env, world) @@ -570,7 +570,7 @@ end @test_throws ErrorException sizeof(String) @test_throws ErrorException sizeof(Vector{Int}) @test_throws ErrorException sizeof(Symbol) -@test_throws ErrorException sizeof(SimpleVector) +@test_throws ErrorException sizeof(Core.SimpleVector) @test nfields((1,2)) == 2 @test nfields(()) == 0 diff --git a/test/specificity.jl b/test/specificity.jl index bc36a145537093..7f0e7dbbe3cb7b 100644 --- a/test/specificity.jl +++ b/test/specificity.jl @@ -20,8 +20,8 @@ end # issue #11534 let - t1 = Tuple{AbstractArray, Tuple{Vararg{RangeIndex}}} - t2 = Tuple{Array, T} where T<:Tuple{Vararg{RangeIndex}} + t1 = Tuple{AbstractArray, Tuple{Vararg{Base.RangeIndex}}} + t2 = Tuple{Array, T} where T<:Tuple{Vararg{Base.RangeIndex}} @test !args_morespecific(t1, t2) @test args_morespecific(t2, t1) end diff --git a/test/stacktraces.jl b/test/stacktraces.jl index 4db3de6ca08ec1..59e9268c892dd3 100644 --- a/test/stacktraces.jl +++ b/test/stacktraces.jl @@ -2,7 +2,7 @@ # Tests for /base/stacktraces.jl -using Serialization +using Serialization, Base.StackTraces let @noinline child() = stacktrace() @@ -100,7 +100,7 @@ for (frame, func, inlined) in zip(trace, [g,h,f], (can_inline, can_inline, false end end -let src = Meta.lower(Main, quote let x = 1 end end).args[1]::CodeInfo, +let src = Meta.lower(Main, quote let x = 1 end end).args[1]::Core.CodeInfo, li = ccall(:jl_new_method_instance_uninit, Ref{Core.MethodInstance}, ()), sf diff --git a/test/staged.jl b/test/staged.jl index 10fee16fa0d35e..8d1cb76be7253e 100644 --- a/test/staged.jl +++ b/test/staged.jl @@ -59,7 +59,7 @@ splat2(3, 3:5) @test String(take!(stagediobuf)) == "($intstr, UnitRange{$intstr})" # varargs specialization with parametric @generated functions (issue #8944) -@generated function splat3(A::AbstractArray{T,N}, indx::RangeIndex...) where {T,N} +@generated function splat3(A::AbstractArray{T,N}, indx::Base.RangeIndex...) where {T,N} print(stagediobuf, indx) :(nothing) end diff --git a/test/syntax.jl b/test/syntax.jl index 39722cbff03459..6bde0be299b50c 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -655,7 +655,7 @@ end # Issue #16578 (Lowering) mismatch between push_loc and pop_loc module TestMeta_16578 using Test -function get_expr_list(ex::CodeInfo) +function get_expr_list(ex::Core.CodeInfo) return ex.code::Array{Any,1} end function get_expr_list(ex::Expr) @@ -684,7 +684,7 @@ function count_meta_loc(exprs) end function is_return_ssavalue(ex::Expr) - ex.head === :return && isa(ex.args[1], SSAValue) + ex.head === :return && isa(ex.args[1], Core.SSAValue) end function is_pop_loc(ex::Expr)