|
@@ -534,10 +534,15 @@ class LoweringState(object):
|
|
|
|
|
|
def lower_jit_call(self, value):
|
|
|
"""Lowers a direct call that uses the 'jit' calling convention."""
|
|
|
- return tree_ir.create_jit_call(
|
|
|
- tree_ir.LoadGlobalInstruction(value.target_name),
|
|
|
- [(name, self.load_definition(arg)) for name, arg in value.argument_list],
|
|
|
- tree_ir.LoadLocalInstruction(jit_runtime.KWARGS_PARAMETER_NAME))
|
|
|
+ arg_list = [(name, self.load_definition(arg)) for name, arg in value.argument_list]
|
|
|
+ intrinsic = self.jit.get_intrinsic(value.target_name)
|
|
|
+ if intrinsic is not None:
|
|
|
+ return bytecode_to_tree.apply_intrinsic(intrinsic, arg_list)
|
|
|
+ else:
|
|
|
+ return tree_ir.create_jit_call(
|
|
|
+ tree_ir.LoadGlobalInstruction(value.target_name),
|
|
|
+ arg_list,
|
|
|
+ tree_ir.LoadLocalInstruction(jit_runtime.KWARGS_PARAMETER_NAME))
|
|
|
|
|
|
call_lowerings = {
|
|
|
cfg_ir.SIMPLE_POSITIONAL_CALLING_CONVENTION : lower_simple_positional_call,
|