Skip to content

Commit

Permalink
Merge branch 'master' into ignore-sz1
Browse files Browse the repository at this point in the history
  • Loading branch information
N5N3 authored Mar 29, 2022
2 parents 9c9d28e + c919811 commit aa4f300
Show file tree
Hide file tree
Showing 86 changed files with 1,369 additions and 682 deletions.
3 changes: 3 additions & 0 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ JULIA_PRECOMPILE ?= 1
# and LLVM_ASSERTIONS=1.
FORCE_ASSERTIONS ?= 0

# Set BOOTSTRAP_DEBUG_LEVEL to 1 to enable Julia-level stacktrace during bootstrapping.
BOOTSTRAP_DEBUG_LEVEL ?= 0

# OPENBLAS build options
OPENBLAS_TARGET_ARCH:=
OPENBLAS_SYMBOLSUFFIX:=
Expand Down
1 change: 1 addition & 0 deletions base/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ include("condition.jl")
include("threads.jl")
include("lock.jl")
include("channels.jl")
include("partr.jl")
include("task.jl")
include("threads_overloads.jl")
include("weakkeydict.jl")
Expand Down
2 changes: 1 addition & 1 deletion base/boot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ primitive type Char <: AbstractChar 32 end
primitive type Int8 <: Signed 8 end
#primitive type UInt8 <: Unsigned 8 end
primitive type Int16 <: Signed 16 end
primitive type UInt16 <: Unsigned 16 end
#primitive type UInt16 <: Unsigned 16 end
#primitive type Int32 <: Signed 32 end
#primitive type UInt32 <: Unsigned 32 end
#primitive type Int64 <: Signed 64 end
Expand Down
6 changes: 3 additions & 3 deletions base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ function eval_user_input(errio, @nospecialize(ast), show_value::Bool)
end
if lasterr !== nothing
lasterr = scrub_repl_backtrace(lasterr)
istrivialerror(lasterr) || ccall(:jl_set_global, Cvoid, (Any, Any, Any), Main, :err, lasterr)
istrivialerror(lasterr) || setglobal!(Main, :err, lasterr)
invokelatest(display_error, errio, lasterr)
errcount = 0
lasterr = nothing
else
ast = Meta.lower(Main, ast)
value = Core.eval(Main, ast)
ccall(:jl_set_global, Cvoid, (Any, Any, Any), Main, :ans, value)
setglobal!(Main, :ans, value)
if !(value === nothing) && show_value
if have_color
print(answer_color())
Expand All @@ -151,7 +151,7 @@ function eval_user_input(errio, @nospecialize(ast), show_value::Bool)
end
errcount += 1
lasterr = scrub_repl_backtrace(current_exceptions())
ccall(:jl_set_global, Cvoid, (Any, Any, Any), Main, :err, lasterr)
setglobal!(Main, :err, lasterr)
if errcount > 2
@error "It is likely that something important is broken, and Julia will not be able to continue normally" errcount
break
Expand Down
29 changes: 12 additions & 17 deletions base/compiler/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1503,25 +1503,26 @@ end
function abstract_invoke(interp::AbstractInterpreter, (; fargs, argtypes)::ArgInfo, sv::InferenceState)
ft′ = argtype_by_index(argtypes, 2)
ft = widenconst(ft′)
ft === Bottom && return CallMeta(Bottom, false)
ft === Bottom && return CallMeta(Bottom, false), EFFECTS_THROWN
(types, isexact, isconcrete, istype) = instanceof_tfunc(argtype_by_index(argtypes, 3))
types === Bottom && return CallMeta(Bottom, false)
isexact || return CallMeta(Any, false)
types === Bottom && return CallMeta(Bottom, false), EFFECTS_THROWN
isexact || return CallMeta(Any, false), Effects()
argtype = argtypes_to_type(argtype_tail(argtypes, 4))
nargtype = typeintersect(types, argtype)
nargtype === Bottom && return CallMeta(Bottom, false)
nargtype isa DataType || return CallMeta(Any, false) # other cases are not implemented below
isdispatchelem(ft) || return CallMeta(Any, false) # check that we might not have a subtype of `ft` at runtime, before doing supertype lookup below
nargtype === Bottom && return CallMeta(Bottom, false), EFFECTS_THROWN
nargtype isa DataType || return CallMeta(Any, false), Effects() # other cases are not implemented below
isdispatchelem(ft) || return CallMeta(Any, false), Effects() # check that we might not have a subtype of `ft` at runtime, before doing supertype lookup below
ft = ft::DataType
types = rewrap_unionall(Tuple{ft, unwrap_unionall(types).parameters...}, types)::Type
nargtype = Tuple{ft, nargtype.parameters...}
argtype = Tuple{ft, argtype.parameters...}
match, valid_worlds, overlayed = findsup(types, method_table(interp))
match === nothing && return CallMeta(Any, false)
match === nothing && return CallMeta(Any, false), Effects()
update_valid_age!(sv, valid_worlds)
method = match.method
(ti, env::SimpleVector) = ccall(:jl_type_intersection_with_env, Any, (Any, Any), nargtype, method.sig)::SimpleVector
(; rt, edge) = result = abstract_call_method(interp, method, ti, env, false, sv)
effects = result.edge_effects
edge !== nothing && add_backedge!(edge::MethodInstance, sv)
match = MethodMatch(ti, env, method, argtype <: method.sig)
res = nothing
Expand All @@ -1539,10 +1540,10 @@ function abstract_invoke(interp::AbstractInterpreter, (; fargs, argtypes)::ArgIn
const_result = nothing
if const_call_result !== nothing
if const_call_result.rt rt
(; rt, const_result) = const_call_result
(; rt, effects, const_result) = const_call_result
end
end
return CallMeta(from_interprocedural!(rt, sv, arginfo, sig), InvokeCallInfo(match, const_result))
return CallMeta(from_interprocedural!(rt, sv, arginfo, sig), InvokeCallInfo(match, const_result)), effects
end

function invoke_rewrite(xs::Vector{Any})
Expand All @@ -1563,14 +1564,8 @@ function abstract_call_known(interp::AbstractInterpreter, @nospecialize(f),
if f === _apply_iterate
return abstract_apply(interp, argtypes, sv, max_methods)
elseif f === invoke
call = abstract_invoke(interp, arginfo, sv)
if call.info === false
if call.rt === Bottom
tristate_merge!(sv, Effects(EFFECTS_TOTAL; nothrow=ALWAYS_FALSE))
else
tristate_merge!(sv, Effects())
end
end
call, effects = abstract_invoke(interp, arginfo, sv)
tristate_merge!(sv, effects)
return call
elseif f === modifyfield!
tristate_merge!(sv, Effects()) # TODO
Expand Down
Loading

0 comments on commit aa4f300

Please sign in to comment.