3#ifndef __NUITKA_COMPILED_FUNCTION_H__
4#define __NUITKA_COMPILED_FUNCTION_H__
7#include "nuitka/prelude.h"
18typedef PyObject *(*function_impl_code)(PyThreadState *tstate,
struct Nuitka_FunctionObject const *, PyObject **);
31 PyCodeObject *m_code_object;
32 Py_ssize_t m_args_overall_count;
33 Py_ssize_t m_args_positional_count;
34 Py_ssize_t m_args_keywords_count;
36 Py_ssize_t m_args_star_list_index;
37 Py_ssize_t m_args_star_dict_index;
39#if PYTHON_VERSION >= 0x380
40 Py_ssize_t m_args_pos_only_count;
44 PyObject **m_varnames;
47 function_impl_code m_c_code;
49#if PYTHON_VERSION >= 0x380
50 vectorcallfunc m_vectorcall;
58 Py_ssize_t m_defaults_given;
60#if PYTHON_VERSION >= 0x300
63 PyObject *m_kwdefaults;
66 PyObject *m_annotations;
69#if PYTHON_VERSION >= 0x3e0
73#if PYTHON_VERSION >= 0x300
77#if PYTHON_VERSION >= 0x3c0
78 PyObject *m_type_params;
82 PyObject *m_constant_return_value;
88 Py_ssize_t m_closure_given;
92extern PyTypeObject Nuitka_Function_Type;
95#if PYTHON_VERSION < 0x300
97 PyCodeObject *code_object, PyObject *defaults,
98 PyObject *module, PyObject *doc,
101extern struct Nuitka_FunctionObject *Nuitka_Function_New(function_impl_code c_code, PyObject *name, PyObject *qualname,
102 PyCodeObject *code_object, PyObject *defaults,
103 PyObject *kw_defaults, PyObject *annotations, PyObject *module,
105 Py_ssize_t closure_given);
112extern void Nuitka_Function_EnableConstReturnGeneric(
struct Nuitka_FunctionObject *function, PyObject *value);
114#ifdef _NUITKA_PLUGIN_DILL_ENABLED
116 function_impl_code
const *function_table);
118 PyObject *module, PyObject *function_qualname, PyObject *function_index, PyObject *code_object_desc,
119 PyObject *constant_return_value, PyObject *defaults, PyObject *kw_defaults, PyObject *doc, PyObject *closure,
120 PyObject *annotations, PyObject *func_dict, function_impl_code
const *function_table,
int function_table_size);
121extern PyObject *Nuitka_Function_ExtractCodeObjectDescription(PyThreadState *tstate,
125static inline bool Nuitka_Function_Check(PyObject *
object) {
return Py_TYPE(
object) == &Nuitka_Function_Type; }
127static inline PyObject *Nuitka_Function_GetName(PyObject *
object) {
131PyObject *Nuitka_CallFunctionNoArgs(PyThreadState *tstate,
struct Nuitka_FunctionObject const *function);
133PyObject *Nuitka_CallFunctionPosArgs(PyThreadState *tstate,
struct Nuitka_FunctionObject const *function,
134 PyObject *
const *args, Py_ssize_t args_size);
136PyObject *Nuitka_CallFunctionVectorcall(PyThreadState *tstate,
struct Nuitka_FunctionObject const *function,
137 PyObject *
const *args, Py_ssize_t args_size, PyObject *
const *kw_names,
139PyObject *Nuitka_CallFunctionPosArgsKwArgs(PyThreadState *tstate,
struct Nuitka_FunctionObject const *function,
140 PyObject *
const *args, Py_ssize_t args_size, PyObject *kw);
141PyObject *Nuitka_CallFunctionPosArgsKwSplit(PyThreadState *tstate,
struct Nuitka_FunctionObject const *function,
142 PyObject *
const *args, Py_ssize_t args_size, PyObject *
const *kw_values,
145PyObject *Nuitka_CallMethodFunctionNoArgs(PyThreadState *tstate,
struct Nuitka_FunctionObject const *function,
147PyObject *Nuitka_CallMethodFunctionPosArgs(PyThreadState *tstate,
struct Nuitka_FunctionObject const *function,
148 PyObject *
object, PyObject *
const *args, Py_ssize_t args_size);
149PyObject *Nuitka_CallMethodFunctionPosArgsKwArgs(PyThreadState *tstate,
struct Nuitka_FunctionObject const *function,
150 PyObject *
object, PyObject *
const *args, Py_ssize_t args_size,
154extern int count_active_Nuitka_Function_Type;
155extern int count_allocated_Nuitka_Function_Type;
156extern int count_released_Nuitka_Function_Type;
Definition compiled_cell.h:17
Definition compiled_function.h:22