Skip to content

Commit

Permalink
remove Method.roots with --strip-ir (#54676)
Browse files Browse the repository at this point in the history
This "roots" list is now only used for references to values in IR, and
so is really part of the IR representation and can be removed by
--strip-ir (and is also a bit mis-named).
  • Loading branch information
JeffBezanson authored Jun 7, 2024
1 parent d71441b commit 900af91
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3167,7 +3167,7 @@ static jl_value_t *jl_ensure_rooted(jl_codectx_t &ctx, jl_value_t *val)
if (jl_is_globally_rooted(val))
return val;
jl_method_t *m = ctx.linfo->def.method;
if (jl_is_method(m)) {
if (!jl_options.strip_ir && jl_is_method(m)) {
// the method might have a root for this already; use it if so
JL_LOCK(&m->writelock);
if (m->roots) {
Expand Down
1 change: 1 addition & 0 deletions src/staticdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -2437,6 +2437,7 @@ static int strip_all_codeinfos__(jl_typemap_entry_t *def, void *_env)
}
if (should_strip_ir) {
record_field_change(&m->source, jl_nothing);
record_field_change((jl_value_t**)&m->roots, NULL);
stripped_ir = 1;
}
}
Expand Down

0 comments on commit 900af91

Please sign in to comment.