Skip to content

Commit

Permalink
Switch world age fields to ulong (#32241)
Browse files Browse the repository at this point in the history
They are declared as `size_t` in the header, which is unsigned.
  • Loading branch information
Keno authored Jun 7, 2019
1 parent 7b34f1b commit ad42d5d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions base/compiler/typeinfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ function typeinf(frame::InferenceState)
for caller in frames
caller.min_valid = min_valid
caller.max_valid = max_valid
caller.src.min_world = min_valid % Int
caller.src.max_world = max_valid % Int
caller.src.min_world = min_valid
caller.src.max_world = max_valid
if cached
cache_result(caller.result, min_valid, max_valid)
end
Expand Down
8 changes: 4 additions & 4 deletions base/reflection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1329,10 +1329,10 @@ has_bottom_parameter(t::Union) = has_bottom_parameter(t.a) & has_bottom_paramete
has_bottom_parameter(t::TypeVar) = t.ub == Bottom || has_bottom_parameter(t.ub)
has_bottom_parameter(::Any) = false

min_world(m::Core.CodeInstance) = reinterpret(UInt, m.min_world)
max_world(m::Core.CodeInstance) = reinterpret(UInt, m.max_world)
min_world(m::Core.CodeInfo) = reinterpret(UInt, m.min_world)
max_world(m::Core.CodeInfo) = reinterpret(UInt, m.max_world)
min_world(m::Core.CodeInstance) = m.min_world
max_world(m::Core.CodeInstance) = m.max_world
min_world(m::Core.CodeInfo) = m.min_world
max_world(m::Core.CodeInfo) = m.max_world
get_world_counter() = ccall(:jl_get_world_counter, UInt, ())


Expand Down
16 changes: 8 additions & 8 deletions src/jltypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1965,8 +1965,8 @@ void jl_init_types(void) JL_GC_DISABLED
jl_type_type, // TupleType
jl_any_type, // TupleType
jl_any_type, // SimpleVector{TupleType}
jl_long_type, // Int
jl_long_type, // Int
jl_ulong_type, // UInt
jl_ulong_type, // UInt
jl_any_type, // Any
jl_bool_type,
jl_bool_type,
Expand Down Expand Up @@ -2099,8 +2099,8 @@ void jl_init_types(void) JL_GC_DISABLED
jl_any_type,
jl_any_type,
jl_any_type,
jl_long_type,
jl_long_type,
jl_ulong_type,
jl_ulong_type,
jl_bool_type,
jl_bool_type,
jl_bool_type,
Expand Down Expand Up @@ -2136,8 +2136,8 @@ void jl_init_types(void) JL_GC_DISABLED
jl_module_type,
jl_symbol_type,
jl_int32_type,
jl_long_type,
jl_long_type,
jl_ulong_type,
jl_ulong_type,
jl_type_type,
jl_any_type, // Union{Array, Nothing}
jl_any_type, // TypeMap
Expand Down Expand Up @@ -2193,8 +2193,8 @@ void jl_init_types(void) JL_GC_DISABLED
jl_svec(11,
jl_method_instance_type,
jl_any_type,
jl_long_type,
jl_long_type,
jl_ulong_type,
jl_ulong_type,
jl_any_type,
jl_any_type,
jl_any_type,
Expand Down
4 changes: 2 additions & 2 deletions stdlib/Serialization/src/Serialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1015,8 +1015,8 @@ function deserialize(s::AbstractSerializer, ::Type{CodeInfo})
ci.slottypes = deserialize(s)
ci.rettype = deserialize(s)
ci.parent = deserialize(s)
ci.min_world = deserialize(s)
ci.max_world = deserialize(s)
ci.min_world = reinterpret(UInt, deserialize(s))
ci.max_world = reinterpret(UInt, deserialize(s))
end
ci.inferred = deserialize(s)
ci.inlineable = deserialize(s)
Expand Down

1 comment on commit ad42d5d

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

Please sign in to comment.