Skip to content

Commit

Permalink
avoid invalidations when it doesn't resolve an MethodError (JuliaLang…
Browse files Browse the repository at this point in the history
…#36733)

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 and simeonschaub committed Aug 11, 2020
1 parent 8e44d85 commit 8a74d70
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

0 comments on commit 8a74d70

Please sign in to comment.