LMMS
Loading...
Searching...
No Matches
nseel-compiler.c File Reference
#include "ns-eel-int.h"
#include "../denormal.h"
#include <string.h>
#include <math.h>
#include <stdio.h>
#include <ctype.h>
#include "../wdlcstring.h"
#include <sys/mman.h>
#include <stdint.h>
#include <unistd.h>
#include "glue_x86.h"

Classes

struct  namespaceInformation
struct  opcodeRec
struct  topLevelCodeSegmentRec

Macros

#define NSEEL_VARS_MALLOC_CHUNKSIZE   8
#define RET_MINUS1_FAIL(x)
#define MIN_COMPUTABLE_SIZE   32
#define COMPUTABLE_EXTRA_SPACE   16
#define NSEEL_ATOF   atof
#define OPTFLAG_NO_OPTIMIZE   1
#define OPTFLAG_NO_FPSTACK   2
#define OPTFLAG_NO_INLINEFUNC   4
#define OPTFLAG_FULL_DENORMAL_CHECKS   8
#define OPTFLAG_NO_DENORMAL_CHECKS   16
#define DENORMAL_CLEARING_THRESHOLD   1.0e-50
#define MAX_SUB_NAMESPACES   32
#define OPCODE_IS_TRIVIAL(x)
#define newCodeBlock(x, a)
#define newDataBlock(x, a)
#define newCtxDataBlock(x, a)
#define newTmpBlock(ctx, size)
#define DECL_ASMFUNC(x)
#define FUNCTIONTYPE_PARAMETERCOUNTMASK   0xff
#define BIF_NPARAMS_MASK   0x7ffff00
#define BIF_RETURNSONSTACK   0x0000100
#define BIF_LASTPARMONSTACK   0x0000200
#define BIF_RETURNSBOOL   0x0000400
#define BIF_LASTPARM_ASBOOL   0x0000800
#define BIF_TAKES_VARPARM   0x0400000
#define BIF_TAKES_VARPARM_EX   0x0C00000
#define BIF_WONTMAKEDENORMAL   0x0100000
#define BIF_CLEARDENORMAL   0x0200000
#define BIF_SECONDLASTPARMST   0x0001000
#define BIF_LAZYPARMORDERING   0x0002000
#define BIF_REVERSEFPORDER   0x0004000
#define BIF_FPSTACKUSE(x)
#define BIF_GETFPSTACKUSE(x)
#define BIF_TWOPARMSONFPSTACK   (BIF_SECONDLASTPARMST|BIF_LASTPARMONSTACK)
#define BIF_TWOPARMSONFPSTACK_LAZY   (BIF_LAZYPARMORDERING|BIF_SECONDLASTPARMST|BIF_LASTPARMONSTACK)
#define FNPTR_HAS_CONDITIONAL_EXEC(op)
#define DOSTUB(np)
#define RETURNVALUE_IGNORE   0
#define RETURNVALUE_NORMAL   1
#define RETURNVALUE_FPSTACK   2
#define RETURNVALUE_BOOL   4
#define RETURNVALUE_BOOL_REVERSED   8
#define RETURNVALUE_CACHEABLE   16
#define RF(x)
#define RF(x)
#define RESTART_DIRECTVALUE(X)
#define DOF(x)
#define DOF2(x, y)
#define CHECK_SIZE_FORJMP(x, y)
#define RET_MINUS1_FAIL_FALLBACK(err, j)

Typedefs

typedef struct topLevelCodeSegmentRec topLevelCodeSegmentRec

Enumerations

enum  {
  OPCODETYPE_DIRECTVALUE =0 , OPCODETYPE_DIRECTVALUE_TEMPSTRING , OPCODETYPE_VALUE_FROM_NAMESPACENAME , OPCODETYPE_VARPTR ,
  OPCODETYPE_VARPTRPTR , OPCODETYPE_FUNC1 , OPCODETYPE_FUNC2 , OPCODETYPE_FUNC3 ,
  OPCODETYPE_FUNCX , OPCODETYPE_MOREPARAMS , OPCODETYPE_INVALID
}

Functions

intNSEEL_getstats ()
static int findLineNumber (const char *exp, int byteoffs)
static EEL_F * get_global_var (compileContext *ctx, const char *gv, int addIfNotPresent)
static void__newBlock_align (llBlock **start, int size, int align, int code_page_size)
static opcodeRecnewOpCode (compileContext *ctx, const char *str, int opType)
static int eel_get_page_size (void)
static char * eel_get_llblock_buffer (llBlock *llb)
static void eel_set_blocks_allow_execute (llBlock *llb, int exec)
static void freeBlocks (llBlock **start, int is_code)
static int __growbuf_resize (eel_growbuf *buf, int newsize)
void _asm_megabuf (void)
void _asm_gmegabuf (void)
static voidNSEEL_PProc_GRAM (void *data, int data_size, compileContext *ctx)
static voidNSEEL_PProc_Stack (void *data, int data_size, compileContext *ctx)
static voidNSEEL_PProc_Stack_PeekInt (void *data, int data_size, compileContext *ctx, INT_PTR offs)
static voidNSEEL_PProc_Stack_PeekTop (void *data, int data_size, compileContext *ctx)
EEL_F NSEEL_CGEN_CALL nseel_int_rand (EEL_F f)
static int functable_lowerbound (functionType *list, int list_sz, const char *name, int *ismatch)
static int funcTypeCmp (const void *a, const void *b)
functionTypenseel_getFunctionByName (compileContext *ctx, const char *name, int *mchk)
functionTypenseel_enumFunctions (compileContext *ctx, int idx)
int NSEEL_init ()
void NSEEL_quit ()
void NSEEL_addfunc_varparm_ex (const char *name, int min_np, int want_exact, NSEEL_PPPROC pproc, EEL_F(NSEEL_CGEN_CALL *fptr)(void *, INT_PTR, EEL_F **), eel_function_table *destination)
void NSEEL_addfunc_varparm_ctxptr (const char *name, int min_np, int want_exact, void *ctxptr, EEL_F(NSEEL_CGEN_CALL *fptr)(void *, INT_PTR, EEL_F **), eel_function_table *destination)
void NSEEL_addfunc_varparm_ctxptr2 (const char *name, int min_np, int want_exact, NSEEL_PPPROC pproc, void *ctx, EEL_F(NSEEL_CGEN_CALL *fptr)(void *, void *, INT_PTR, EEL_F **), eel_function_table *destination)
void NSEEL_addfunc_ret_type (const char *name, int np, int ret_type, NSEEL_PPPROC pproc, void *fptr, eel_function_table *destination)
void NSEEL_addfunctionex2 (const char *name, int nparms, char *code_startaddr, int code_len, NSEEL_PPPROC pproc, void *fptr, void *fptr2, eel_function_table *destination)
opcodeRecnseel_createCompiledValue (compileContext *ctx, EEL_F value)
opcodeRecnseel_createCompiledValuePtr (compileContext *ctx, EEL_F *addrValue, const char *namestr)
static int validate_varname_for_function (compileContext *ctx, const char *name)
opcodeRecnseel_resolve_named_symbol (compileContext *ctx, opcodeRec *rec, int parmcnt, int *errOut)
opcodeRecnseel_setCompiledFunctionCallParameters (compileContext *ctx, opcodeRec *fn, opcodeRec *code1, opcodeRec *code2, opcodeRec *code3, opcodeRec *postCode, int *errOut)
struct eelStringSegmentRecnseel_createStringSegmentRec (compileContext *ctx, const char *str, int len)
opcodeRecnseel_eelMakeOpcodeFromStringSegments (compileContext *ctx, struct eelStringSegmentRec *rec)
opcodeRecnseel_createMoreParametersOpcode (compileContext *ctx, opcodeRec *code1, opcodeRec *code2)
opcodeRecnseel_createIfElse (compileContext *ctx, opcodeRec *code1, opcodeRec *code2, opcodeRec *code3)
opcodeRecnseel_createMemoryAccess (compileContext *ctx, opcodeRec *code1, opcodeRec *code2)
opcodeRecnseel_createSimpleCompiledFunction (compileContext *ctx, int fn, int np, opcodeRec *code1, opcodeRec *code2)
static int compileOpcodes (compileContext *ctx, opcodeRec *op, unsigned char *bufOut, int bufOut_len, int *computTable, const namespaceInformation *namespacePathToThis, int supportedReturnValues, int *rvType, int *fpStackUsage, int *canHaveDenormalOutput)
static unsigned char * compileCodeBlockWithRet (compileContext *ctx, opcodeRec *rec, int *computTableSize, const namespaceInformation *namespacePathToThis, int supportedReturnValues, int *rvType, int *fpStackUse, int *canHaveDenormalOutput)
_codeHandleFunctionReceel_createFunctionNamespacedInstance (compileContext *ctx, _codeHandleFunctionRec *fr, const char *nameptr)
static void combineNamespaceFields (char *nm, const namespaceInformation *namespaceInfo, const char *relname, int thisctx)
static voidnseel_getBuiltinFunctionAddress (compileContext *ctx, int fntype, void *fn, NSEEL_PPPROC *pProc, void ***replList, int *abiInfo, int preferredReturnValues, const EEL_F *hasConstParm1, const EEL_F *hasConstParm2)
static voidnseel_getEELFunctionAddress (compileContext *ctx, opcodeRec *op, int *customFuncParmSize, int *customFuncLocalStorageSize, EEL_F ***customFuncLocalStorage, int *computTableTop, void **endP, int *isRaw, int wantCodeGenerated, const namespaceInformation *namespacePathToThis, int *rvMode, int *fpStackUse, int *canHaveDenormalOutput, opcodeRec **ordered_parmptrs, int num_ordered_parmptrs)
static char optimizeOpcodes (compileContext *ctx, opcodeRec *op, int needsResult)
static int generateValueToReg (compileContext *ctx, opcodeRec *op, unsigned char *bufOut, int whichReg, const namespaceInformation *functionPrefix, int allowCache)
static int compileNativeFunctionCall (compileContext *ctx, opcodeRec *op, unsigned char *bufOut, int bufOut_len, int *computTableSize, const namespaceInformation *namespacePathToThis, int *rvMode, int *fpStackUsage, int preferredReturnValues, int *canHaveDenormalOutput)
static int compileEelFunctionCall (compileContext *ctx, opcodeRec *op, unsigned char *bufOut, int bufOut_len, int *computTableSize, const namespaceInformation *namespacePathToThis, int *rvMode, int *fpStackUse, int *canHaveDenormalOutput)
static int compileOpcodesInternal (compileContext *ctx, opcodeRec *op, unsigned char *bufOut, int bufOut_len, int *computTableSize, const namespaceInformation *namespacePathToThis, int *calledRvType, int preferredReturnValues, int *fpStackUse, int *canHaveDenormalOutput)
NSEEL_CODEHANDLE NSEEL_code_compile (NSEEL_VMCTX _ctx, const char *_expression, int lineoffs)
NSEEL_CODEHANDLE NSEEL_code_compile_ex (NSEEL_VMCTX _ctx, const char *_expression, int lineoffs, int compile_flags)
void NSEEL_code_execute (NSEEL_CODEHANDLE code)
int NSEEL_code_geterror_flag (NSEEL_VMCTX ctx)
char * NSEEL_code_getcodeerror (NSEEL_VMCTX ctx)
void NSEEL_code_free (NSEEL_CODEHANDLE code)
NSEEL_VMCTX NSEEL_VM_alloc ()
int NSEEL_VM_setramsize (NSEEL_VMCTX _ctx, int maxent)
void NSEEL_VM_SetFunctionValidator (NSEEL_VMCTX _ctx, const char *(*validateFunc)(const char *fn_name, void *user), void *user)
void NSEEL_VM_SetFunctionTable (NSEEL_VMCTX _ctx, eel_function_table *tab)
void NSEEL_VM_free (NSEEL_VMCTX _ctx)
intNSEEL_code_getstats (NSEEL_CODEHANDLE code)
void NSEEL_VM_SetStringFunc (NSEEL_VMCTX ctx, EEL_F(*onString)(void *caller_this, struct eelStringSegmentRec *list), EEL_F(*onNamedString)(void *caller_this, const char *name))
void NSEEL_VM_SetCustomFuncThis (NSEEL_VMCTX ctx, void *thisptr)
voidNSEEL_PProc_RAM (void *data, int data_size, compileContext *ctx)
voidNSEEL_PProc_THIS (void *data, int data_size, compileContext *ctx)
static int vartable_lowerbound (compileContext *ctx, const char *name, int *ismatch)
static void vartable_cull_list (compileContext *ctx, int refcnt_chk)
void NSEEL_VM_remove_unused_vars (NSEEL_VMCTX _ctx)
void NSEEL_VM_remove_all_nonreg_vars (NSEEL_VMCTX _ctx)
void NSEEL_VM_clear_var_refcnts (NSEEL_VMCTX _ctx)
EEL_F * nseel_int_register_var (compileContext *ctx, const char *name, int isReg, const char **namePtrOut)
void NSEEL_VM_enumallvars (NSEEL_VMCTX ctx, int(*func)(const char *name, EEL_F *val, void *ctx), void *userctx)
EEL_F * NSEEL_VM_regvar (NSEEL_VMCTX _ctx, const char *var)
EEL_F * NSEEL_VM_getvar (NSEEL_VMCTX _ctx, const char *var)
int NSEEL_VM_get_var_refcnt (NSEEL_VMCTX _ctx, const char *name)
opcodeRecnseel_createFunctionByName (compileContext *ctx, const char *name, int np, opcodeRec *code1, opcodeRec *code2, opcodeRec *code3)
opcodeRecnseel_translate (compileContext *ctx, const char *tmp, size_t tmplen)
void NSEEL_VM_set_var_resolver (NSEEL_VMCTX _ctx, EEL_F *(*res)(void *userctx, const char *name), void *userctx)

Variables

static int nseel_evallib_stats [5]
static int nseel_vms_referencing_globallist_cnt
nseel_globalVarItemnseel_globalreg_list
static functionType fnTable1 []
static functionType fn_min2 = { "min2", nseel_asm_min_fp, 2|NSEEL_NPARAMS_FLAG_CONST|BIF_RETURNSONSTACK|BIF_TWOPARMSONFPSTACK_LAZY|BIF_FPSTACKUSE(2)|BIF_WONTMAKEDENORMAL }
static functionType fn_max2 = { "max2", nseel_asm_max_fp, 2|NSEEL_NPARAMS_FLAG_CONST|BIF_RETURNSONSTACK|BIF_TWOPARMSONFPSTACK_LAZY|BIF_FPSTACKUSE(2)|BIF_WONTMAKEDENORMAL }
static functionType fn_or0 = { "or0", nseel_asm_or0, 1|NSEEL_NPARAMS_FLAG_CONST|BIF_LASTPARMONSTACK|BIF_RETURNSONSTACK|BIF_CLEARDENORMAL }
static eel_function_table default_user_funcs

Macro Definition Documentation

◆ BIF_CLEARDENORMAL

#define BIF_CLEARDENORMAL   0x0200000

◆ BIF_FPSTACKUSE

#define BIF_FPSTACKUSE ( x)
Value:
(((x)>=0&&(x)<8) ? ((7-(x))<<16):0)
unsigned x[BMAX+1]
Definition inflate.c:1586

◆ BIF_GETFPSTACKUSE

#define BIF_GETFPSTACKUSE ( x)
Value:
(7 - (((x)>>16)&7))

◆ BIF_LASTPARM_ASBOOL

#define BIF_LASTPARM_ASBOOL   0x0000800

◆ BIF_LASTPARMONSTACK

#define BIF_LASTPARMONSTACK   0x0000200

◆ BIF_LAZYPARMORDERING

#define BIF_LAZYPARMORDERING   0x0002000

◆ BIF_NPARAMS_MASK

#define BIF_NPARAMS_MASK   0x7ffff00

◆ BIF_RETURNSBOOL

#define BIF_RETURNSBOOL   0x0000400

◆ BIF_RETURNSONSTACK

#define BIF_RETURNSONSTACK   0x0000100

◆ BIF_REVERSEFPORDER

#define BIF_REVERSEFPORDER   0x0004000

◆ BIF_SECONDLASTPARMST

#define BIF_SECONDLASTPARMST   0x0001000

◆ BIF_TAKES_VARPARM

#define BIF_TAKES_VARPARM   0x0400000

◆ BIF_TAKES_VARPARM_EX

#define BIF_TAKES_VARPARM_EX   0x0C00000

◆ BIF_TWOPARMSONFPSTACK

#define BIF_TWOPARMSONFPSTACK   (BIF_SECONDLASTPARMST|BIF_LASTPARMONSTACK)

◆ BIF_TWOPARMSONFPSTACK_LAZY

#define BIF_TWOPARMSONFPSTACK_LAZY   (BIF_LAZYPARMORDERING|BIF_SECONDLASTPARMST|BIF_LASTPARMONSTACK)

◆ BIF_WONTMAKEDENORMAL

#define BIF_WONTMAKEDENORMAL   0x0100000

◆ CHECK_SIZE_FORJMP

#define CHECK_SIZE_FORJMP ( x,
y )

◆ COMPUTABLE_EXTRA_SPACE

#define COMPUTABLE_EXTRA_SPACE   16

◆ DECL_ASMFUNC

#define DECL_ASMFUNC ( x)
Value:
void nseel_asm_##x(void);

◆ DENORMAL_CLEARING_THRESHOLD

#define DENORMAL_CLEARING_THRESHOLD   1.0e-50

◆ DOF

#define DOF ( x)
Value:
if (!strcmp(pfn->name,#x)) v = x(v); else
unsigned v[N_MAX]
Definition inflate.c:1584

◆ DOF2

#define DOF2 ( x,
y )
Value:
if (!strcmp(pfn->name,#x)) v = x(y); else
int y
Definition inflate.c:1588

◆ DOSTUB

#define DOSTUB ( np)
Value:
{ \
stub = (ret_type == 1 ? (char*)_asm_generic##np##parm_retd : (char*)_asm_generic##np##parm); \
}
void DWORD DWORD LPVOID parm
Definition swell-functions.h:807

◆ FNPTR_HAS_CONDITIONAL_EXEC

#define FNPTR_HAS_CONDITIONAL_EXEC ( op)
Value:
(op->fntype == FN_LOGICAL_AND || \
op->fntype == FN_LOGICAL_OR || \
op->fntype == FN_IF_ELSE || \
op->fntype == FN_WHILE || \
op->fntype == FN_LOOP)
@ FN_LOOP
Definition ns-eel-int.h:88
@ FN_WHILE
Definition ns-eel-int.h:87
@ FN_LOGICAL_AND
Definition ns-eel-int.h:69
@ FN_LOGICAL_OR
Definition ns-eel-int.h:70
@ FN_IF_ELSE
Definition ns-eel-int.h:71

◆ FUNCTIONTYPE_PARAMETERCOUNTMASK

#define FUNCTIONTYPE_PARAMETERCOUNTMASK   0xff

◆ MAX_SUB_NAMESPACES

#define MAX_SUB_NAMESPACES   32

◆ MIN_COMPUTABLE_SIZE

#define MIN_COMPUTABLE_SIZE   32

◆ newCodeBlock

#define newCodeBlock ( x,
a )
Value:
__newBlock_align(&ctx->blocks_head_code,x,a, 1)
uint8_t a
Definition Spc_Cpu.h:141
static void * __newBlock_align(llBlock **start, int size, int align, int code_page_size)
Definition nseel-compiler.c:829

◆ newCtxDataBlock

#define newCtxDataBlock ( x,
a )
Value:
__newBlock_align(&ctx->ctx_pblocks,x,a,0)

◆ newDataBlock

#define newDataBlock ( x,
a )
Value:
__newBlock_align(&ctx->blocks_head_data,x,a,0)

◆ newTmpBlock

#define newTmpBlock ( ctx,
size )
Value:
__newBlock_align(&(ctx)->tmpblocks, size, 8,0)
ulg size
Definition extract.c:2350

◆ NSEEL_ATOF

#define NSEEL_ATOF   atof

◆ NSEEL_VARS_MALLOC_CHUNKSIZE

#define NSEEL_VARS_MALLOC_CHUNKSIZE   8

◆ OPCODE_IS_TRIVIAL

#define OPCODE_IS_TRIVIAL ( x)
Value:
((x)->opcodeType <= OPCODETYPE_VARPTRPTR)
@ OPCODETYPE_VARPTRPTR
Definition nseel-compiler.c:190

◆ OPTFLAG_FULL_DENORMAL_CHECKS

#define OPTFLAG_FULL_DENORMAL_CHECKS   8

◆ OPTFLAG_NO_DENORMAL_CHECKS

#define OPTFLAG_NO_DENORMAL_CHECKS   16

◆ OPTFLAG_NO_FPSTACK

#define OPTFLAG_NO_FPSTACK   2

◆ OPTFLAG_NO_INLINEFUNC

#define OPTFLAG_NO_INLINEFUNC   4

◆ OPTFLAG_NO_OPTIMIZE

#define OPTFLAG_NO_OPTIMIZE   1

◆ RESTART_DIRECTVALUE

#define RESTART_DIRECTVALUE ( X)
Value:
{ op->parms.dv.directValue = (X); goto start_over_directvalue; }
#define X(str)
Definition juce_LV2Common.h:197

◆ RET_MINUS1_FAIL

#define RET_MINUS1_FAIL ( x)
Value:
return -1;

◆ RET_MINUS1_FAIL_FALLBACK

#define RET_MINUS1_FAIL_FALLBACK ( err,
j )
Value:
#define RET_MINUS1_FAIL(x)
Definition nseel-compiler.c:60

◆ RETURNVALUE_BOOL

#define RETURNVALUE_BOOL   4

◆ RETURNVALUE_BOOL_REVERSED

#define RETURNVALUE_BOOL_REVERSED   8

◆ RETURNVALUE_CACHEABLE

#define RETURNVALUE_CACHEABLE   16

◆ RETURNVALUE_FPSTACK

#define RETURNVALUE_FPSTACK   2

◆ RETURNVALUE_IGNORE

#define RETURNVALUE_IGNORE   0

◆ RETURNVALUE_NORMAL

#define RETURNVALUE_NORMAL   1

◆ RF [1/2]

#define RF ( x)
Value:
return (void*)_asm_##x

◆ RF [2/2]

#define RF ( x)
Value:
return (void*)nseel_asm_##x

Typedef Documentation

◆ topLevelCodeSegmentRec

typedef struct topLevelCodeSegmentRec topLevelCodeSegmentRec

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
OPCODETYPE_DIRECTVALUE 
OPCODETYPE_DIRECTVALUE_TEMPSTRING 
OPCODETYPE_VALUE_FROM_NAMESPACENAME 
OPCODETYPE_VARPTR 
OPCODETYPE_VARPTRPTR 
OPCODETYPE_FUNC1 
OPCODETYPE_FUNC2 
OPCODETYPE_FUNC3 
OPCODETYPE_FUNCX 
OPCODETYPE_MOREPARAMS 
OPCODETYPE_INVALID 

Function Documentation

◆ __growbuf_resize()

int __growbuf_resize ( eel_growbuf * buf,
int newsize )
static

◆ __newBlock_align()

void * __newBlock_align ( llBlock ** start,
int size,
int align,
int code_page_size )
static

◆ _asm_gmegabuf()

void _asm_gmegabuf ( void )

◆ _asm_megabuf()

void _asm_megabuf ( void )

◆ combineNamespaceFields()

void combineNamespaceFields ( char * nm,
const namespaceInformation * namespaceInfo,
const char * relname,
int thisctx )
static

◆ compileCodeBlockWithRet()

unsigned char * compileCodeBlockWithRet ( compileContext * ctx,
opcodeRec * rec,
int * computTableSize,
const namespaceInformation * namespacePathToThis,
int supportedReturnValues,
int * rvType,
int * fpStackUse,
int * canHaveDenormalOutput )
static

◆ compileEelFunctionCall()

int compileEelFunctionCall ( compileContext * ctx,
opcodeRec * op,
unsigned char * bufOut,
int bufOut_len,
int * computTableSize,
const namespaceInformation * namespacePathToThis,
int * rvMode,
int * fpStackUse,
int * canHaveDenormalOutput )
static

◆ compileNativeFunctionCall()

int compileNativeFunctionCall ( compileContext * ctx,
opcodeRec * op,
unsigned char * bufOut,
int bufOut_len,
int * computTableSize,
const namespaceInformation * namespacePathToThis,
int * rvMode,
int * fpStackUsage,
int preferredReturnValues,
int * canHaveDenormalOutput )
static

◆ compileOpcodes()

int compileOpcodes ( compileContext * ctx,
opcodeRec * op,
unsigned char * bufOut,
int bufOut_len,
int * computTable,
const namespaceInformation * namespacePathToThis,
int supportedReturnValues,
int * rvType,
int * fpStackUsage,
int * canHaveDenormalOutput )
static

◆ compileOpcodesInternal()

int compileOpcodesInternal ( compileContext * ctx,
opcodeRec * op,
unsigned char * bufOut,
int bufOut_len,
int * computTableSize,
const namespaceInformation * namespacePathToThis,
int * calledRvType,
int preferredReturnValues,
int * fpStackUse,
int * canHaveDenormalOutput )
static

◆ eel_createFunctionNamespacedInstance()

_codeHandleFunctionRec * eel_createFunctionNamespacedInstance ( compileContext * ctx,
_codeHandleFunctionRec * fr,
const char * nameptr )

◆ eel_get_llblock_buffer()

char * eel_get_llblock_buffer ( llBlock * llb)
static

◆ eel_get_page_size()

int eel_get_page_size ( void )
static

◆ eel_set_blocks_allow_execute()

void eel_set_blocks_allow_execute ( llBlock * llb,
int exec )
static

◆ findLineNumber()

int findLineNumber ( const char * exp,
int byteoffs )
static

◆ freeBlocks()

void freeBlocks ( llBlock ** start,
int is_code )
static

◆ functable_lowerbound()

int functable_lowerbound ( functionType * list,
int list_sz,
const char * name,
int * ismatch )
static

◆ funcTypeCmp()

int funcTypeCmp ( const void * a,
const void * b )
static

◆ generateValueToReg()

int generateValueToReg ( compileContext * ctx,
opcodeRec * op,
unsigned char * bufOut,
int whichReg,
const namespaceInformation * functionPrefix,
int allowCache )
static

◆ get_global_var()

EEL_F * get_global_var ( compileContext * ctx,
const char * gv,
int addIfNotPresent )
static

◆ newOpCode()

opcodeRec * newOpCode ( compileContext * ctx,
const char * str,
int opType )
static

◆ NSEEL_addfunc_ret_type()

void NSEEL_addfunc_ret_type ( const char * name,
int np,
int ret_type,
NSEEL_PPPROC pproc,
void * fptr,
eel_function_table * destination )

◆ NSEEL_addfunc_varparm_ctxptr()

void NSEEL_addfunc_varparm_ctxptr ( const char * name,
int min_np,
int want_exact,
void * ctxptr,
EEL_F(NSEEL_CGEN_CALL *fptr)(void *, INT_PTR, EEL_F **) ,
eel_function_table * destination )

◆ NSEEL_addfunc_varparm_ctxptr2()

void NSEEL_addfunc_varparm_ctxptr2 ( const char * name,
int min_np,
int want_exact,
NSEEL_PPPROC pproc,
void * ctx,
EEL_F(NSEEL_CGEN_CALL *fptr)(void *, void *, INT_PTR, EEL_F **) ,
eel_function_table * destination )

◆ NSEEL_addfunc_varparm_ex()

void NSEEL_addfunc_varparm_ex ( const char * name,
int min_np,
int want_exact,
NSEEL_PPPROC pproc,
EEL_F(NSEEL_CGEN_CALL *fptr)(void *, INT_PTR, EEL_F **) ,
eel_function_table * destination )

◆ NSEEL_addfunctionex2()

void NSEEL_addfunctionex2 ( const char * name,
int nparms,
char * code_startaddr,
int code_len,
NSEEL_PPPROC pproc,
void * fptr,
void * fptr2,
eel_function_table * destination )

◆ NSEEL_code_compile()

NSEEL_CODEHANDLE NSEEL_code_compile ( NSEEL_VMCTX _ctx,
const char * _expression,
int lineoffs )

◆ NSEEL_code_compile_ex()

NSEEL_CODEHANDLE NSEEL_code_compile_ex ( NSEEL_VMCTX _ctx,
const char * _expression,
int lineoffs,
int compile_flags )

◆ NSEEL_code_execute()

void NSEEL_code_execute ( NSEEL_CODEHANDLE code)

◆ NSEEL_code_free()

void NSEEL_code_free ( NSEEL_CODEHANDLE code)

◆ NSEEL_code_getcodeerror()

char * NSEEL_code_getcodeerror ( NSEEL_VMCTX ctx)

◆ NSEEL_code_geterror_flag()

int NSEEL_code_geterror_flag ( NSEEL_VMCTX ctx)

◆ NSEEL_code_getstats()

int * NSEEL_code_getstats ( NSEEL_CODEHANDLE code)

◆ nseel_createCompiledValue()

opcodeRec * nseel_createCompiledValue ( compileContext * ctx,
EEL_F value )

◆ nseel_createCompiledValuePtr()

opcodeRec * nseel_createCompiledValuePtr ( compileContext * ctx,
EEL_F * addrValue,
const char * namestr )

◆ nseel_createFunctionByName()

opcodeRec * nseel_createFunctionByName ( compileContext * ctx,
const char * name,
int np,
opcodeRec * code1,
opcodeRec * code2,
opcodeRec * code3 )

◆ nseel_createIfElse()

opcodeRec * nseel_createIfElse ( compileContext * ctx,
opcodeRec * code1,
opcodeRec * code2,
opcodeRec * code3 )

◆ nseel_createMemoryAccess()

opcodeRec * nseel_createMemoryAccess ( compileContext * ctx,
opcodeRec * code1,
opcodeRec * code2 )

◆ nseel_createMoreParametersOpcode()

opcodeRec * nseel_createMoreParametersOpcode ( compileContext * ctx,
opcodeRec * code1,
opcodeRec * code2 )

◆ nseel_createSimpleCompiledFunction()

opcodeRec * nseel_createSimpleCompiledFunction ( compileContext * ctx,
int fn,
int np,
opcodeRec * code1,
opcodeRec * code2 )

◆ nseel_createStringSegmentRec()

struct eelStringSegmentRec * nseel_createStringSegmentRec ( compileContext * ctx,
const char * str,
int len )

◆ nseel_eelMakeOpcodeFromStringSegments()

opcodeRec * nseel_eelMakeOpcodeFromStringSegments ( compileContext * ctx,
struct eelStringSegmentRec * rec )

◆ nseel_enumFunctions()

functionType * nseel_enumFunctions ( compileContext * ctx,
int idx )

◆ nseel_getBuiltinFunctionAddress()

void * nseel_getBuiltinFunctionAddress ( compileContext * ctx,
int fntype,
void * fn,
NSEEL_PPPROC * pProc,
void *** replList,
int * abiInfo,
int preferredReturnValues,
const EEL_F * hasConstParm1,
const EEL_F * hasConstParm2 )
static

◆ nseel_getEELFunctionAddress()

void * nseel_getEELFunctionAddress ( compileContext * ctx,
opcodeRec * op,
int * customFuncParmSize,
int * customFuncLocalStorageSize,
EEL_F *** customFuncLocalStorage,
int * computTableTop,
void ** endP,
int * isRaw,
int wantCodeGenerated,
const namespaceInformation * namespacePathToThis,
int * rvMode,
int * fpStackUse,
int * canHaveDenormalOutput,
opcodeRec ** ordered_parmptrs,
int num_ordered_parmptrs )
static

◆ nseel_getFunctionByName()

functionType * nseel_getFunctionByName ( compileContext * ctx,
const char * name,
int * mchk )

◆ NSEEL_getstats()

int * NSEEL_getstats ( )

◆ NSEEL_init()

int NSEEL_init ( )

◆ nseel_int_rand()

EEL_F NSEEL_CGEN_CALL nseel_int_rand ( EEL_F f)

◆ nseel_int_register_var()

EEL_F * nseel_int_register_var ( compileContext * ctx,
const char * name,
int isReg,
const char ** namePtrOut )

◆ NSEEL_PProc_GRAM()

void * NSEEL_PProc_GRAM ( void * data,
int data_size,
compileContext * ctx )
static

◆ NSEEL_PProc_RAM()

void * NSEEL_PProc_RAM ( void * data,
int data_size,
compileContext * ctx )

◆ NSEEL_PProc_Stack()

void * NSEEL_PProc_Stack ( void * data,
int data_size,
compileContext * ctx )
static

◆ NSEEL_PProc_Stack_PeekInt()

void * NSEEL_PProc_Stack_PeekInt ( void * data,
int data_size,
compileContext * ctx,
INT_PTR offs )
static

◆ NSEEL_PProc_Stack_PeekTop()

void * NSEEL_PProc_Stack_PeekTop ( void * data,
int data_size,
compileContext * ctx )
static

◆ NSEEL_PProc_THIS()

void * NSEEL_PProc_THIS ( void * data,
int data_size,
compileContext * ctx )

◆ NSEEL_quit()

void NSEEL_quit ( )

◆ nseel_resolve_named_symbol()

opcodeRec * nseel_resolve_named_symbol ( compileContext * ctx,
opcodeRec * rec,
int parmcnt,
int * errOut )

◆ nseel_setCompiledFunctionCallParameters()

opcodeRec * nseel_setCompiledFunctionCallParameters ( compileContext * ctx,
opcodeRec * fn,
opcodeRec * code1,
opcodeRec * code2,
opcodeRec * code3,
opcodeRec * postCode,
int * errOut )

◆ nseel_translate()

opcodeRec * nseel_translate ( compileContext * ctx,
const char * tmp,
size_t tmplen )

◆ NSEEL_VM_alloc()

NSEEL_VMCTX NSEEL_VM_alloc ( )

◆ NSEEL_VM_clear_var_refcnts()

void NSEEL_VM_clear_var_refcnts ( NSEEL_VMCTX _ctx)

◆ NSEEL_VM_enumallvars()

void NSEEL_VM_enumallvars ( NSEEL_VMCTX ctx,
int(* func )(const char *name, EEL_F *val, void *ctx),
void * userctx )

◆ NSEEL_VM_free()

void NSEEL_VM_free ( NSEEL_VMCTX _ctx)

◆ NSEEL_VM_get_var_refcnt()

int NSEEL_VM_get_var_refcnt ( NSEEL_VMCTX _ctx,
const char * name )

◆ NSEEL_VM_getvar()

EEL_F * NSEEL_VM_getvar ( NSEEL_VMCTX _ctx,
const char * var )

◆ NSEEL_VM_regvar()

EEL_F * NSEEL_VM_regvar ( NSEEL_VMCTX _ctx,
const char * var )

◆ NSEEL_VM_remove_all_nonreg_vars()

void NSEEL_VM_remove_all_nonreg_vars ( NSEEL_VMCTX _ctx)

◆ NSEEL_VM_remove_unused_vars()

void NSEEL_VM_remove_unused_vars ( NSEEL_VMCTX _ctx)

◆ NSEEL_VM_set_var_resolver()

void NSEEL_VM_set_var_resolver ( NSEEL_VMCTX _ctx,
EEL_F *(* res )(void *userctx, const char *name),
void * userctx )

◆ NSEEL_VM_SetCustomFuncThis()

void NSEEL_VM_SetCustomFuncThis ( NSEEL_VMCTX ctx,
void * thisptr )

◆ NSEEL_VM_SetFunctionTable()

void NSEEL_VM_SetFunctionTable ( NSEEL_VMCTX _ctx,
eel_function_table * tab )

◆ NSEEL_VM_SetFunctionValidator()

void NSEEL_VM_SetFunctionValidator ( NSEEL_VMCTX _ctx,
const char *(* validateFunc )(const char *fn_name, void *user),
void * user )

◆ NSEEL_VM_setramsize()

int NSEEL_VM_setramsize ( NSEEL_VMCTX _ctx,
int maxent )

◆ NSEEL_VM_SetStringFunc()

void NSEEL_VM_SetStringFunc ( NSEEL_VMCTX ctx,
EEL_F(* onString )(void *caller_this, struct eelStringSegmentRec *list),
EEL_F(* onNamedString )(void *caller_this, const char *name) )

◆ optimizeOpcodes()

char optimizeOpcodes ( compileContext * ctx,
opcodeRec * op,
int needsResult )
static

◆ validate_varname_for_function()

int validate_varname_for_function ( compileContext * ctx,
const char * name )
static

◆ vartable_cull_list()

void vartable_cull_list ( compileContext * ctx,
int refcnt_chk )
static

◆ vartable_lowerbound()

int vartable_lowerbound ( compileContext * ctx,
const char * name,
int * ismatch )
static

Variable Documentation

◆ default_user_funcs

eel_function_table default_user_funcs
static

◆ fn_max2

◆ fn_min2

◆ fn_or0

◆ fnTable1

functionType fnTable1[]
static

◆ nseel_evallib_stats

int nseel_evallib_stats[5]
static

◆ nseel_globalreg_list

nseel_globalVarItem* nseel_globalreg_list

◆ nseel_vms_referencing_globallist_cnt

int nseel_vms_referencing_globallist_cnt
static