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

These Methods cannot be looked up via their type signature, so they are
incompatible with the `precompile(...)` mechanism unfortunately.
  • Loading branch information
topolarity committed Jul 7, 2024
1 parent ed987f2 commit 550e429
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/gf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2636,7 +2636,8 @@ jl_code_instance_t *jl_compile_method_internal(jl_method_instance_t *mi, size_t
codeinst->rettype_const = unspec->rettype_const;
jl_atomic_store_release(&codeinst->invoke, unspec_invoke);
jl_mi_cache_insert(mi, codeinst);
record_precompile_statement(mi, 0);
if (!def->is_for_opaque_closure)
record_precompile_statement(mi, 0);
return codeinst;
}
}
Expand All @@ -2653,7 +2654,8 @@ jl_code_instance_t *jl_compile_method_internal(jl_method_instance_t *mi, size_t
0, 1, ~(size_t)0, 0, jl_nothing, 0, NULL);
jl_atomic_store_release(&codeinst->invoke, jl_fptr_interpret_call);
jl_mi_cache_insert(mi, codeinst);
record_precompile_statement(mi, 0);
if (!jl_is_method(def) || !def->is_for_opaque_closure)
record_precompile_statement(mi, 0);
return codeinst;
}
if (compile_option == JL_OPTIONS_COMPILE_OFF) {
Expand Down Expand Up @@ -2702,7 +2704,8 @@ jl_code_instance_t *jl_compile_method_internal(jl_method_instance_t *mi, size_t
codeinst = NULL;
}
else if (did_compile) {
record_precompile_statement(mi, compile_time);
if (!jl_is_method(def) || !def->is_for_opaque_closure)
record_precompile_statement(mi, compile_time);
}
JL_GC_POP();
}
Expand Down

0 comments on commit 550e429

Please sign in to comment.