Skip to content

Commit

Permalink
avoid invalidations when it doesn't resolve an MethodError (#36733)
Browse files Browse the repository at this point in the history
In these cases, the new method would not be called because the
call would still be an ambiguity error instead.

We also might observe that the method doesn't resolve an old MethodError
because it was previously covered by a different method.
  • Loading branch information
vtjnash authored Jul 30, 2020
1 parent cd3fb4d commit f41115b
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 140 deletions.
3 changes: 3 additions & 0 deletions src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2641,6 +2641,7 @@ mark: {

extern jl_typemap_entry_t *call_cache[N_CALL_CACHE];
extern jl_array_t *jl_all_methods;
extern jl_array_t *_jl_debug_method_invalidation;

static void jl_gc_queue_thread_local(jl_gc_mark_cache_t *gc_cache, jl_gc_mark_sp_t *sp,
jl_ptls_t ptls2)
Expand Down Expand Up @@ -2680,6 +2681,8 @@ static void mark_roots(jl_gc_mark_cache_t *gc_cache, jl_gc_mark_sp_t *sp)
gc_mark_queue_obj(gc_cache, sp, call_cache[i]);
if (jl_all_methods != NULL)
gc_mark_queue_obj(gc_cache, sp, jl_all_methods);
if (_jl_debug_method_invalidation != NULL)
gc_mark_queue_obj(gc_cache, sp, _jl_debug_method_invalidation);

// constants
gc_mark_queue_obj(gc_cache, sp, jl_emptytuple_type);
Expand Down
Loading

2 comments on commit f41115b

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