Skip to content

Commit f9b7d27

Browse files
authored
rename GlobalMethods to methodtable 🚲 🏠 (#59158)
1 parent 9473ef7 commit f9b7d27

File tree

10 files changed

+14
-14
lines changed

10 files changed

+14
-14
lines changed

Compiler/src/abstractinterpretation.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ function find_union_split_method_matches(interp::AbstractInterpreter, argtypes::
369369
end
370370
valid_worlds = intersect(valid_worlds, thismatches.valid_worlds)
371371
thisfullmatch = any(match::MethodMatch->match.fully_covers, thismatches)
372-
mt = Core.GlobalMethods
372+
mt = Core.methodtable
373373
thisinfo = MethodMatchInfo(thismatches, mt, sig_n, thisfullmatch)
374374
push!(infos, thisinfo)
375375
for idx = 1:length(thismatches)
@@ -390,7 +390,7 @@ function find_simple_method_matches(interp::AbstractInterpreter, @nospecialize(a
390390
return FailedMethodMatch("Too many methods matched")
391391
end
392392
fullmatch = any(match::MethodMatch->match.fully_covers, matches)
393-
mt = Core.GlobalMethods
393+
mt = Core.methodtable
394394
info = MethodMatchInfo(matches, mt, atype, fullmatch)
395395
applicable = MethodMatchTarget[MethodMatchTarget(matches[idx], info.edges, idx) for idx = 1:length(matches)]
396396
return MethodMatches(applicable, info, matches.valid_worlds)

Compiler/src/stmtinfo.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ function _add_edges_impl(edges::Vector{Any}, info::MethodMatchInfo, mi_edge::Boo
4949
if !fully_covering(info)
5050
exists = false
5151
for i in 2:length(edges)
52-
if edges[i] === Core.GlobalMethods && edges[i-1] == info.atype
52+
if edges[i] === Core.methodtable && edges[i-1] == info.atype
5353
exists = true
5454
break
5555
end
5656
end
5757
if !exists
5858
push!(edges, info.atype)
59-
push!(edges, Core.GlobalMethods)
59+
push!(edges, Core.methodtable)
6060
end
6161
end
6262
nmatches = length(info.results)

Compiler/src/tfuncs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3208,7 +3208,7 @@ function _hasmethod_tfunc(interp::AbstractInterpreter, argtypes::Vector{Any}, sv
32083208
if match === nothing
32093209
rt = Const(false)
32103210
vresults = MethodLookupResult(Any[], valid_worlds, true)
3211-
mt = Core.GlobalMethods
3211+
mt = Core.methodtable
32123212
vinfo = MethodMatchInfo(vresults, mt, types, false) # XXX: this should actually be an info with invoke-type edge
32133213
else
32143214
rt = Const(true)

src/builtins.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2545,7 +2545,7 @@ void jl_init_primitives(void) JL_GC_DISABLED
25452545

25462546
add_builtin("Module", (jl_value_t*)jl_module_type);
25472547
add_builtin("MethodTable", (jl_value_t*)jl_methtable_type);
2548-
add_builtin("GlobalMethods", (jl_value_t*)jl_method_table);
2548+
add_builtin("methodtable", (jl_value_t*)jl_method_table);
25492549
add_builtin("MethodCache", (jl_value_t*)jl_methcache_type);
25502550
add_builtin("Method", (jl_value_t*)jl_method_type);
25512551
add_builtin("CodeInstance", (jl_value_t*)jl_code_instance_type);

src/jltypes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2956,7 +2956,7 @@ void jl_init_types(void) JL_GC_DISABLED
29562956
XX(simplevector);
29572957
jl_methcache_type = jl_new_uninitialized_datatype();
29582958
jl_methtable_type = jl_new_uninitialized_datatype();
2959-
jl_method_table = jl_new_method_table(jl_symbol("GlobalMethods"), core);
2959+
jl_method_table = jl_new_method_table(jl_symbol("methodtable"), core);
29602960

29612961
jl_emptysvec = (jl_svec_t*)jl_gc_permobj(sizeof(void*), jl_simplevector_type, 0);
29622962
jl_set_typetagof(jl_emptysvec, jl_simplevector_tag, GC_OLD_MARKED);

src/rtutils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ static size_t jl_static_show_x_(JL_STREAM *out, jl_value_t *v, jl_datatype_t *vt
10811081
n += jl_printf(out, "nothing");
10821082
}
10831083
else if (v == (jl_value_t*)jl_method_table) {
1084-
n += jl_printf(out, "Core.GlobalMethods");
1084+
n += jl_printf(out, "Core.methodtable");
10851085
}
10861086
else if (vt == jl_string_type) {
10871087
n += jl_static_show_string(out, jl_string_data(v), jl_string_len(v), 1, 0);

stdlib/Serialization/src/Serialization.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ function deserialize(s::AbstractSerializer, ::Type{Method})
11291129
meth.recursion_relation = recursion_relation
11301130
end
11311131
if !is_for_opaque_closure
1132-
mt = Core.GlobalMethods
1132+
mt = Core.methodtable
11331133
if nothing === ccall(:jl_methtable_lookup, Any, (Any, UInt), sig, Base.get_world_counter()) # XXX: quite sketchy?
11341134
ccall(:jl_method_table_insert, Cvoid, (Any, Any, Ptr{Cvoid}), mt, meth, C_NULL)
11351135
end

stdlib/Test/src/Test.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2243,7 +2243,7 @@ function detect_ambiguities(mods::Module...;
22432243
end
22442244
end
22452245
end
2246-
examine(Core.GlobalMethods)
2246+
examine(Core.methodtable)
22472247
return collect(ambs)
22482248
end
22492249

@@ -2291,7 +2291,7 @@ function detect_unbound_args(mods...;
22912291
push!(ambs, m)
22922292
end
22932293
end
2294-
examine(Core.GlobalMethods)
2294+
examine(Core.methodtable)
22952295
return collect(ambs)
22962296
end
22972297

test/misc.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,10 +1632,10 @@ end
16321632
let errs = IOBuffer()
16331633
run(`$(Base.julia_cmd()) -e '
16341634
using Test
1635-
@test !isempty(Core.GlobalMethods.backedges)
1635+
@test !isempty(Core.methodtable.backedges)
16361636
Base.Experimental.disable_new_worlds()
16371637
@test_throws "disable_new_worlds" @eval f() = 1
1638-
@test isempty(Core.GlobalMethods.backedges)
1638+
@test isempty(Core.methodtable.backedges)
16391639
@test_throws "disable_new_worlds" Base.delete_method(which(+, (Int, Int)))
16401640
@test 1+1 == 2
16411641
using Dates

test/worlds.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ z26506 = Any["ABC"]
198198
f26506(x::Int) = 2
199199
g26506(z26506) # Places an entry for f26506(::String) in MethodTable cache
200200
w26506 = Base.get_world_counter()
201-
cache26506 = ccall(:jl_mt_find_cache_entry, Any, (Any, Any, UInt), Core.GlobalMethods.cache, Tuple{typeof(f26506),String}, w26506)::Core.TypeMapEntry
201+
cache26506 = ccall(:jl_mt_find_cache_entry, Any, (Any, Any, UInt), Core.methodtable.cache, Tuple{typeof(f26506),String}, w26506)::Core.TypeMapEntry
202202
@test cache26506.max_world === typemax(UInt)
203203
w26506 = Base.get_world_counter()
204204
f26506(x::String) = 3

0 commit comments

Comments
 (0)