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 >= 0x300
73#if PYTHON_VERSION >= 0x3c0
74 PyObject *m_type_params;
78 PyObject *m_constant_return_value;
84 Py_ssize_t m_closure_given;
88extern PyTypeObject Nuitka_Function_Type;
91#if PYTHON_VERSION < 0x300
93 PyCodeObject *code_object, PyObject *defaults,
94 PyObject *module, PyObject *doc,
97extern struct Nuitka_FunctionObject *Nuitka_Function_New(function_impl_code c_code, PyObject *name, PyObject *qualname,
98 PyCodeObject *code_object, PyObject *defaults,
99 PyObject *kw_defaults, PyObject *annotations, PyObject *module,
101 Py_ssize_t closure_given);
108extern void Nuitka_Function_EnableConstReturnGeneric(
struct Nuitka_FunctionObject *function, PyObject *value);
110#ifdef _NUITKA_PLUGIN_DILL_ENABLED
112 function_impl_code
const *function_table);
114 PyObject *module, PyObject *function_qualname, PyObject *function_index, PyObject *code_object_desc,
115 PyObject *constant_return_value, PyObject *defaults, PyObject *kw_defaults, PyObject *doc, PyObject *closure,
116 PyObject *annotations, PyObject *func_dict, function_impl_code
const *function_table,
int function_table_size);
117extern PyObject *Nuitka_Function_ExtractCodeObjectDescription(PyThreadState *tstate,
121static inline bool Nuitka_Function_Check(PyObject *
object) {
return Py_TYPE(
object) == &Nuitka_Function_Type; }
123static inline PyObject *Nuitka_Function_GetName(PyObject *
object) {
127PyObject *Nuitka_CallFunctionNoArgs(PyThreadState *tstate,
struct Nuitka_FunctionObject const *function);
129PyObject *Nuitka_CallFunctionPosArgs(PyThreadState *tstate,
struct Nuitka_FunctionObject const *function,
130 PyObject *
const *args, Py_ssize_t args_size);
132PyObject *Nuitka_CallFunctionVectorcall(PyThreadState *tstate,
struct Nuitka_FunctionObject const *function,
133 PyObject *
const *args, Py_ssize_t args_size, PyObject *
const *kw_names,
135PyObject *Nuitka_CallFunctionPosArgsKwArgs(PyThreadState *tstate,
struct Nuitka_FunctionObject const *function,
136 PyObject *
const *args, Py_ssize_t args_size, PyObject *kw);
137PyObject *Nuitka_CallFunctionPosArgsKwSplit(PyThreadState *tstate,
struct Nuitka_FunctionObject const *function,
138 PyObject *
const *args, Py_ssize_t args_size, PyObject *
const *kw_values,
141PyObject *Nuitka_CallMethodFunctionNoArgs(PyThreadState *tstate,
struct Nuitka_FunctionObject const *function,
143PyObject *Nuitka_CallMethodFunctionPosArgs(PyThreadState *tstate,
struct Nuitka_FunctionObject const *function,
144 PyObject *
object, PyObject *
const *args, Py_ssize_t args_size);
145PyObject *Nuitka_CallMethodFunctionPosArgsKwArgs(PyThreadState *tstate,
struct Nuitka_FunctionObject const *function,
146 PyObject *
object, PyObject *
const *args, Py_ssize_t args_size,
150extern int count_active_Nuitka_Function_Type;
151extern int count_allocated_Nuitka_Function_Type;
152extern int count_released_Nuitka_Function_Type;
Definition compiled_cell.h:14
Definition compiled_function.h:22