Skip to content

Commit

Permalink
Make CodeInfo.slotnames a Vector{Symbol}
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Mar 29, 2019
1 parent 91151ab commit 44cada7
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion base/compiler/typeinfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ function typeinf_ext(mi::MethodInstance, params::Params)
tree = ccall(:jl_new_code_info_uninit, Ref{CodeInfo}, ())
tree.code = Any[ Expr(:return, quoted(code.rettype_const)) ]
nargs = Int(method.nargs)
tree.slotnames = ccall(:jl_uncompress_argnames, Any, (Any,), method.slot_syms)
tree.slotnames = ccall(:jl_uncompress_argnames, Vector{Symbol}, (Any,), method.slot_syms)
tree.slotflags = fill(0x00, nargs)
tree.ssavaluetypes = 1
tree.codelocs = Int32[1]
Expand Down
1 change: 0 additions & 1 deletion base/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,6 @@ end

function sourceinfo_slotnames(src::CodeInfo)
slotnames = src.slotnames
isa(slotnames, Array) || return String[]
names = Dict{String,Int}()
printnames = Vector{String}(undef, length(slotnames))
for i in eachindex(slotnames)
Expand Down
2 changes: 1 addition & 1 deletion src/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -2695,7 +2695,7 @@ JL_DLLEXPORT jl_array_t *jl_uncompress_argnames(jl_value_t *syms)
remaining -= namelen + 1;
}
namestr = jl_string_data(syms);
jl_array_t *names = jl_alloc_vec_any(len);
jl_array_t *names = jl_alloc_array_1d(jl_array_symbol_type, len);
JL_GC_PUSH1(&names);
for (i = 0; i < len; i++) {
size_t namelen = strlen(namestr);
Expand Down
2 changes: 1 addition & 1 deletion src/jltypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2053,7 +2053,7 @@ void jl_init_types(void) JL_GC_DISABLED
jl_array_uint8_type,
jl_any_type,
jl_any_type,
jl_any_type,
jl_array_symbol_type,
jl_array_uint8_type,
jl_any_type,
jl_any_type,
Expand Down
2 changes: 1 addition & 1 deletion src/method.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ static void jl_code_info_set_ast(jl_code_info_t *li, jl_expr_t *ast)
jl_value_t *ssavalue_types = jl_array_ptr_ref(vinfo, 2);
assert(jl_is_long(ssavalue_types));
size_t nssavalue = jl_unbox_long(ssavalue_types);
li->slotnames = jl_alloc_vec_any(nslots);
li->slotnames = jl_alloc_array_1d(jl_array_symbol_type, nslots);
jl_gc_wb(li, li->slotnames);
li->slotflags = jl_alloc_array_1d(jl_array_uint8_type, nslots);
jl_gc_wb(li, li->slotflags);
Expand Down

0 comments on commit 44cada7

Please sign in to comment.