Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify type on CodeInfo.slotnames #31541

Merged
merged 1 commit into from
Mar 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Make CodeInfo.slotnames a Vector{Symbol}
  • Loading branch information
timholy committed Mar 29, 2019
commit 44cada7561b2b5e1e28a2ceb873c8db677778acd
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