Skip to content

Commit 38e9b93

Browse files
committed
Attribution for "insert_backedges" invalidations
Invalidations can be immediate (when an existing MethodInstance gets invalidated by a new method definition) or delayed. The latter occurs during deserialization: when a package was built, a particular call dispatches to Method 1, but when loaded (due to different loading orders and dependencies) it should instead dispatch to Method 2. These delayed invalidations are not particularly common, and perhaps because of this SnoopCompile has never supported them well: they have merely been dumped to the console during `invalidation_tree` construction. However, in larger software stacks they seem to become more common, and can dramatically affect precompilation success. This simple PR identifies "causes" for such delayed invalidations, allowing SnoopCompile to determine (in most cases) the particular definition or deletion that triggered the change in dispatch.
1 parent a03392a commit 38e9b93

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/dump.c

+4
Original file line numberDiff line numberDiff line change
@@ -2004,6 +2004,10 @@ static void jl_verify_edges(jl_array_t *targets, jl_array_t **pvalids)
20042004
}
20052005
}
20062006
jl_array_uint8_set(valids, i, valid);
2007+
if (!valid && _jl_debug_method_invalidation) {
2008+
jl_array_ptr_1d_push(_jl_debug_method_invalidation, (jl_value_t*)callee);
2009+
jl_array_ptr_1d_push(_jl_debug_method_invalidation, jl_cstr_to_string("insert_backedges_callee"));
2010+
}
20072011
}
20082012
}
20092013

0 commit comments

Comments
 (0)