Skip to content

Commit eddabf0

Browse files
committed
trace-compile: don't generate precompile statements for OpaqueClosure methods
These Methods cannot be looked up via their type signature, so they are incompatible with the `precompile(...)` mechanism unfortunately.
1 parent ed987f2 commit eddabf0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/gf.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -2522,6 +2522,8 @@ static void record_precompile_statement(jl_method_instance_t *mi, double compila
25222522
return;
25232523
if (!jl_is_method(def))
25242524
return;
2525+
if (def->is_for_opaque_closure)
2526+
return; // OpaqueClosure methods cannot be looked up by their types, so are incompatible with `precompile(...)`
25252527

25262528
JL_LOCK(&precomp_statement_out_lock);
25272529
if (s_precompile == NULL) {
@@ -2701,7 +2703,7 @@ jl_code_instance_t *jl_compile_method_internal(jl_method_instance_t *mi, size_t
27012703
// Something went wrong. Bail to the fallback path.
27022704
codeinst = NULL;
27032705
}
2704-
else if (did_compile) {
2706+
else if (did_compile && codeinst->owner == jl_nothing)
27052707
record_precompile_statement(mi, compile_time);
27062708
}
27072709
JL_GC_POP();

0 commit comments

Comments
 (0)