Skip to content

Commit

Permalink
trace-compile: don't generate precompile statements for OpaqueClosu…
Browse files Browse the repository at this point in the history
…re methods (#55072)

These Methods cannot be looked up via their type signature, so they are
incompatible with the `precompile(...)` mechanism.
  • Loading branch information
topolarity committed Jul 9, 2024
1 parent 40966f2 commit d7609d8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2523,6 +2523,8 @@ static void record_precompile_statement(jl_method_instance_t *mi, double compila
return;
if (!jl_is_method(def))
return;
if (def->is_for_opaque_closure)
return; // OpaqueClosure methods cannot be looked up by their types, so are incompatible with `precompile(...)`

JL_LOCK(&precomp_statement_out_lock);
if (s_precompile == NULL) {
Expand Down Expand Up @@ -2702,7 +2704,7 @@ jl_code_instance_t *jl_compile_method_internal(jl_method_instance_t *mi, size_t
// Something went wrong. Bail to the fallback path.
codeinst = NULL;
}
else if (did_compile) {
else if (did_compile && codeinst->owner == jl_nothing) {
record_precompile_statement(mi, compile_time);
}
JL_GC_POP();
Expand Down

0 comments on commit d7609d8

Please sign in to comment.