Skip to content

Commit

Permalink
Remove unnecessary jl_gc_wb calls (#36137)
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy authored Jun 4, 2020
1 parent 912a8ed commit 855a08b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -1926,7 +1926,6 @@ static void jl_insert_backedges(jl_array_t *list, jl_array_t *targets)
if (_jl_debug_method_invalidation) {
jl_array_ptr_1d_push(_jl_debug_method_invalidation, (jl_value_t*)caller);
loctag = jl_cstr_to_string("insert_backedges");
jl_gc_wb(_jl_debug_method_invalidation, loctag);
jl_array_ptr_1d_push(_jl_debug_method_invalidation, loctag);
}
}
Expand Down
18 changes: 4 additions & 14 deletions src/gf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,6 @@ static void invalidate_method_instance(jl_method_instance_t *replaced, size_t ma
jl_array_ptr_1d_push(_jl_debug_method_invalidation, (jl_value_t*)replaced);
boxeddepth = jl_box_int32(depth);
jl_array_ptr_1d_push(_jl_debug_method_invalidation, boxeddepth);
jl_gc_wb(_jl_debug_method_invalidation, boxeddepth);
JL_GC_POP();
}
if (!jl_is_method(replaced->def.method))
Expand Down Expand Up @@ -1643,7 +1642,6 @@ static int invalidate_mt_cache(jl_typemap_entry_t *oldentry, void *closure0)
JL_GC_PUSH1(&loctag);
jl_array_ptr_1d_push(_jl_debug_method_invalidation, (jl_value_t*)mi);
loctag = jl_cstr_to_string("invalidate_mt_cache");
jl_gc_wb(_jl_debug_method_invalidation, loctag);
jl_array_ptr_1d_push(_jl_debug_method_invalidation, loctag);
JL_GC_POP();
}
Expand Down Expand Up @@ -1703,20 +1701,16 @@ JL_DLLEXPORT void jl_method_table_disable(jl_methtable_t *mt, jl_method_t *metho
invalidated = 1;
if (invalidate_backedges(mi, methodentry->max_world))
if (_jl_debug_method_invalidation) {
if (!loctag) {
if (!loctag)
loctag = jl_cstr_to_string("jl_method_table_disable");
jl_gc_wb(_jl_debug_method_invalidation, loctag);
}
jl_array_ptr_1d_push(_jl_debug_method_invalidation, loctag);
}
}
}
if (invalidated && _jl_debug_method_invalidation) {
jl_array_ptr_1d_push(_jl_debug_method_invalidation, (jl_value_t*)method);
if (!loctag) {
if (!loctag)
loctag = jl_cstr_to_string("jl_method_table_disable");
jl_gc_wb(_jl_debug_method_invalidation, loctag);
}
jl_array_ptr_1d_push(_jl_debug_method_invalidation, loctag);
}
JL_GC_POP();
Expand Down Expand Up @@ -1815,10 +1809,8 @@ JL_DLLEXPORT void jl_method_table_insert(jl_methtable_t *mt, jl_method_t *method
invalidated = 1;
if (_jl_debug_method_invalidation) {
jl_array_ptr_1d_push(_jl_debug_method_invalidation, (jl_value_t*)mi);
if (!loctag) {
if (!loctag)
loctag = jl_cstr_to_string("jl_method_table_insert");
jl_gc_wb(_jl_debug_method_invalidation, loctag);
}
jl_array_ptr_1d_push(_jl_debug_method_invalidation, loctag);
}
}
Expand All @@ -1827,10 +1819,8 @@ JL_DLLEXPORT void jl_method_table_insert(jl_methtable_t *mt, jl_method_t *method
}
if (invalidated && _jl_debug_method_invalidation) {
jl_array_ptr_1d_push(_jl_debug_method_invalidation, (jl_value_t*)method);
if (!loctag) {
if (!loctag)
loctag = jl_cstr_to_string("jl_method_table_insert");
jl_gc_wb(_jl_debug_method_invalidation, loctag);
}
jl_array_ptr_1d_push(_jl_debug_method_invalidation, loctag);
}
update_max_args(mt, type);
Expand Down

2 comments on commit 855a08b

@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)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

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

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

Please sign in to comment.