trying to support variable arguments and return variables

This commit is contained in:
2021-05-03 15:31:19 +00:00
parent c65c384d59
commit 5d83fdbfe2
2 changed files with 39 additions and 29 deletions

View File

@ -545,11 +545,11 @@ struct hcl_fpdec_t
#define HCL_FUNCTION_GET_CODE_BYTE(m) HCL_OBJ_GET_TRAILER_BYTE(m)
#define HCL_FUNCTION_GET_CODE_SIZE(m) HCL_OBJ_GET_TRAILER_SIZE(m)
#define HCL_FUNCTION_NAMED_INSTVARS 4 /* this excludes literal frames and byte codes */
#define HCL_FUNCTION_NAMED_INSTVARS 5 /* this excludes literal frames and byte codes */
typedef struct hcl_function_t hcl_function_t;
typedef struct hcl_function_t* hcl_oop_function_t;
#define HCL_BLOCK_NAMED_INSTVARS 4
#define HCL_BLOCK_NAMED_INSTVARS 5
typedef struct hcl_block_t hcl_block_t;
typedef struct hcl_block_t* hcl_oop_block_t;
@ -557,12 +557,15 @@ typedef struct hcl_block_t* hcl_oop_block_t;
typedef struct hcl_context_t hcl_context_t;
typedef struct hcl_context_t* hcl_oop_context_t;
#define HCL_CALL_FLAG_VA (1 << 0)
struct hcl_function_t
{
HCL_OBJ_HEADER;
hcl_oop_t ntmprs; /* smooi. number of temporaries. includes arguments as well */
hcl_oop_t nargs; /* smooi. number of arguments */
hcl_oop_t flags;
hcl_oop_t ntmprs; /* smooi. number of temporaries. includes arguments as well */
hcl_oop_t nargs; /* smooi. number of arguments */
hcl_oop_context_t home; /* home context. nil for the initial function */
hcl_oop_t dbgi; /* byte array containing debug information. nil if not available */
@ -580,6 +583,8 @@ struct hcl_function_t
struct hcl_block_t
{
HCL_OBJ_HEADER;
hcl_oop_t flags;
hcl_oop_t ntmprs; /* smooi. number of temporaries. includes arguments as well */
hcl_oop_t nargs; /* smooi. number of arguments */
hcl_oop_context_t home; /* home context */
@ -639,7 +644,7 @@ struct hcl_context_t
hcl_oop_context_t origin;
/* variable indexed part */
hcl_oop_t slot[1]; /* stack */
hcl_oop_t slot[1]; /* arguments, return variables, local variables, other arguments, etc */
};
#define HCL_PROCESS_NAMED_INSTVARS 13