|
@@ -240,9 +240,13 @@ def try_redefine_as_direct_call(definition, jit, called_globals):
|
|
|
else:
|
|
|
# Otherwise, build a thunk.
|
|
|
thunk_name = jit.jit_thunk_global(resolved_var_name)
|
|
|
+ calling_convention = (
|
|
|
+ cfg_ir.JIT_NO_GC_CALLING_CONVENTION
|
|
|
+ if jit.get_intrinsic(thunk_name) is not None
|
|
|
+ else cfg_ir.JIT_CALLING_CONVENTION)
|
|
|
definition.redefine(
|
|
|
cfg_ir.DirectFunctionCall(
|
|
|
- thunk_name, call.argument_list, cfg_ir.JIT_CALLING_CONVENTION))
|
|
|
+ thunk_name, call.argument_list, calling_convention))
|
|
|
called_globals.add(loaded_ptr)
|
|
|
elif isinstance(target, cfg_ir.Literal):
|
|
|
node_id = target.literal
|
|
@@ -384,6 +388,7 @@ def protect_from_gc(entry_point):
|
|
|
elif (isinstance(def_value, cfg_ir.IndirectFunctionCall)
|
|
|
or (isinstance(def_value, cfg_ir.DirectFunctionCall)
|
|
|
and (def_value.calling_convention == cfg_ir.JIT_CALLING_CONVENTION
|
|
|
+ or def_value.calling_convention == cfg_ir.JIT_NO_GC_CALLING_CONVENTION
|
|
|
or def_value.calling_convention == cfg_ir.MACRO_IO_CALLING_CONVENTION)
|
|
|
and def_value.has_value())):
|
|
|
maybe_protect_def_from_gc(definition)
|