Numworks Epsilon  1.4.1
Graphing Calculator Operating System
objfun.c File Reference
#include <string.h>
#include <assert.h>
#include "py/objtuple.h"
#include "py/objfun.h"
#include "py/runtime.h"
#include "py/bc.h"
#include "py/stackctrl.h"

Go to the source code of this file.

Macros

#define DEBUG_PRINT   (0)
 
#define DEBUG_printf(...)   (void)0
 
#define dump_args(...)   (void)0
 
#define VM_MAX_STATE_ON_STACK   (11 * sizeof(mp_uint_t))
 
#define VM_DETECT_STACK_OVERFLOW   (0)
 

Functions

STATIC mp_obj_t fun_builtin_0_call (mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args)
 
STATIC mp_obj_t fun_builtin_1_call (mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args)
 
STATIC mp_obj_t fun_builtin_2_call (mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args)
 
STATIC mp_obj_t fun_builtin_3_call (mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args)
 
STATIC mp_obj_t fun_builtin_var_call (mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args)
 
qstr mp_obj_code_get_name (const byte *code_info)
 
qstr mp_obj_fun_get_name (mp_const_obj_t fun_in)
 
STATIC mp_obj_t fun_bc_call (mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args)
 
mp_obj_t mp_obj_new_fun_bc (mp_obj_t def_args_in, mp_obj_t def_kw_args, const byte *code, const mp_uint_t *const_table)
 

Variables

const mp_obj_type_t mp_type_fun_builtin_0
 
const mp_obj_type_t mp_type_fun_builtin_1
 
const mp_obj_type_t mp_type_fun_builtin_2
 
const mp_obj_type_t mp_type_fun_builtin_3
 
const mp_obj_type_t mp_type_fun_builtin_var
 
const mp_obj_type_t mp_type_fun_bc
 

Macro Definition Documentation

◆ DEBUG_PRINT

#define DEBUG_PRINT   (0)

Definition at line 40 of file objfun.c.

◆ DEBUG_printf

#define DEBUG_printf (   ...)    (void)0

Definition at line 41 of file objfun.c.

◆ dump_args

#define dump_args (   ...)    (void)0

Definition at line 190 of file objfun.c.

◆ VM_DETECT_STACK_OVERFLOW

#define VM_DETECT_STACK_OVERFLOW   (0)

Definition at line 199 of file objfun.c.

◆ VM_MAX_STATE_ON_STACK

#define VM_MAX_STATE_ON_STACK   (11 * sizeof(mp_uint_t))

Definition at line 196 of file objfun.c.

Function Documentation

◆ fun_bc_call()

STATIC mp_obj_t fun_bc_call ( mp_obj_t  self_in,
size_t  n_args,
size_t  n_kw,
const mp_obj_t args 
)

Definition at line 230 of file objfun.c.

◆ fun_builtin_0_call()

STATIC mp_obj_t fun_builtin_0_call ( mp_obj_t  self_in,
size_t  n_args,
size_t  n_kw,
const mp_obj_t args 
)

Definition at line 51 of file objfun.c.

◆ fun_builtin_1_call()

STATIC mp_obj_t fun_builtin_1_call ( mp_obj_t  self_in,
size_t  n_args,
size_t  n_kw,
const mp_obj_t args 
)

Definition at line 66 of file objfun.c.

◆ fun_builtin_2_call()

STATIC mp_obj_t fun_builtin_2_call ( mp_obj_t  self_in,
size_t  n_args,
size_t  n_kw,
const mp_obj_t args 
)

Definition at line 80 of file objfun.c.

◆ fun_builtin_3_call()

STATIC mp_obj_t fun_builtin_3_call ( mp_obj_t  self_in,
size_t  n_args,
size_t  n_kw,
const mp_obj_t args 
)

Definition at line 94 of file objfun.c.

◆ fun_builtin_var_call()

STATIC mp_obj_t fun_builtin_var_call ( mp_obj_t  self_in,
size_t  n_args,
size_t  n_kw,
const mp_obj_t args 
)

Definition at line 108 of file objfun.c.

◆ mp_obj_code_get_name()

qstr mp_obj_code_get_name ( const byte code_info)

Definition at line 141 of file objfun.c.

◆ mp_obj_fun_get_name()

qstr mp_obj_fun_get_name ( mp_const_obj_t  fun_in)

Definition at line 154 of file objfun.c.

◆ mp_obj_new_fun_bc()

mp_obj_t mp_obj_new_fun_bc ( mp_obj_t  def_args_in,
mp_obj_t  def_kw_args,
const byte code,
const mp_uint_t const_table 
)

Definition at line 344 of file objfun.c.

Variable Documentation

◆ mp_type_fun_bc

const mp_obj_type_t mp_type_fun_bc
Initial value:
= {
.name = MP_QSTR_function,
.call = fun_bc_call,
.unary_op = mp_generic_unary_op,
}
mp_obj_t mp_generic_unary_op(mp_unary_op_t op, mp_obj_t o_in)
Definition: obj.c:530
const mp_obj_type_t mp_type_type
Definition: objtype.c:969
STATIC mp_obj_t fun_bc_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args)
Definition: objfun.c:230
qstr name
Definition: obj.h:478

Definition at line 331 of file objfun.c.

◆ mp_type_fun_builtin_0

const mp_obj_type_t mp_type_fun_builtin_0
Initial value:
= {
.name = MP_QSTR_function,
.unary_op = mp_generic_unary_op,
}
mp_obj_t mp_generic_unary_op(mp_unary_op_t op, mp_obj_t o_in)
Definition: obj.c:530
const mp_obj_type_t mp_type_type
Definition: objtype.c:969
STATIC mp_obj_t fun_builtin_0_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args)
Definition: objfun.c:51
qstr name
Definition: obj.h:478

Definition at line 59 of file objfun.c.

◆ mp_type_fun_builtin_1

const mp_obj_type_t mp_type_fun_builtin_1
Initial value:
= {
.name = MP_QSTR_function,
.unary_op = mp_generic_unary_op,
}
mp_obj_t mp_generic_unary_op(mp_unary_op_t op, mp_obj_t o_in)
Definition: obj.c:530
STATIC mp_obj_t fun_builtin_1_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args)
Definition: objfun.c:66
const mp_obj_type_t mp_type_type
Definition: objtype.c:969
qstr name
Definition: obj.h:478

Definition at line 73 of file objfun.c.

◆ mp_type_fun_builtin_2

const mp_obj_type_t mp_type_fun_builtin_2
Initial value:
= {
.name = MP_QSTR_function,
.unary_op = mp_generic_unary_op,
}
mp_obj_t mp_generic_unary_op(mp_unary_op_t op, mp_obj_t o_in)
Definition: obj.c:530
STATIC mp_obj_t fun_builtin_2_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args)
Definition: objfun.c:80
const mp_obj_type_t mp_type_type
Definition: objtype.c:969
qstr name
Definition: obj.h:478

Definition at line 87 of file objfun.c.

◆ mp_type_fun_builtin_3

const mp_obj_type_t mp_type_fun_builtin_3
Initial value:
= {
.name = MP_QSTR_function,
.unary_op = mp_generic_unary_op,
}
STATIC mp_obj_t fun_builtin_3_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args)
Definition: objfun.c:94
mp_obj_t mp_generic_unary_op(mp_unary_op_t op, mp_obj_t o_in)
Definition: obj.c:530
const mp_obj_type_t mp_type_type
Definition: objtype.c:969
qstr name
Definition: obj.h:478

Definition at line 101 of file objfun.c.

◆ mp_type_fun_builtin_var

const mp_obj_type_t mp_type_fun_builtin_var
Initial value:
= {
.name = MP_QSTR_function,
.unary_op = mp_generic_unary_op,
}
mp_obj_t mp_generic_unary_op(mp_unary_op_t op, mp_obj_t o_in)
Definition: obj.c:530
STATIC mp_obj_t fun_builtin_var_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args)
Definition: objfun.c:108
const mp_obj_type_t mp_type_type
Definition: objtype.c:969
qstr name
Definition: obj.h:478

Definition at line 131 of file objfun.c.