changed the block temporaries scheme
This commit is contained in:
33
lib/hcl.h
33
lib/hcl.h
@ -545,15 +545,15 @@ 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 5 /* this excludes literal frames and byte codes */
|
||||
#define HCL_FUNCTION_NAMED_INSTVARS 4 /* 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 5
|
||||
#define HCL_BLOCK_NAMED_INSTVARS 4
|
||||
typedef struct hcl_block_t hcl_block_t;
|
||||
typedef struct hcl_block_t* hcl_oop_block_t;
|
||||
|
||||
#define HCL_CONTEXT_NAMED_INSTVARS 8
|
||||
#define HCL_CONTEXT_NAMED_INSTVARS 7
|
||||
typedef struct hcl_context_t hcl_context_t;
|
||||
typedef struct hcl_context_t* hcl_oop_context_t;
|
||||
|
||||
@ -564,8 +564,7 @@ struct hcl_function_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_t tmpr_mask; /* smooi */
|
||||
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 */
|
||||
@ -584,11 +583,10 @@ 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 */
|
||||
hcl_oop_t ip; /* smooi. instruction pointer where the byte code begins in home->origin */
|
||||
hcl_oop_t flags;
|
||||
hcl_oop_t tmpr_mask; /* smooi */
|
||||
hcl_oop_context_t home; /* home context */
|
||||
hcl_oop_t ip; /* smooi. instruction pointer where the byte code begins in home->origin */
|
||||
};
|
||||
|
||||
struct hcl_context_t
|
||||
@ -598,6 +596,12 @@ struct hcl_context_t
|
||||
/* SmallInteger, context flags */
|
||||
hcl_oop_t flags;
|
||||
|
||||
/* SmallInteger. */
|
||||
hcl_oop_t tmpr_mask;
|
||||
|
||||
/* SmallInteger, instruction pointer */
|
||||
hcl_oop_t ip;
|
||||
|
||||
/* it points to the active context at the moment when
|
||||
* this context object has been activated. a new method context
|
||||
* is activated as a result of normal message sending and a block
|
||||
@ -605,15 +609,6 @@ struct hcl_context_t
|
||||
* nil if a block context created hasn't received 'value'. */
|
||||
hcl_oop_context_t sender; /* context or nil */
|
||||
|
||||
/* SmallInteger, instruction pointer */
|
||||
hcl_oop_t ip;
|
||||
|
||||
/* SmallInteger. Number of temporaries. Includes arguments as well */
|
||||
hcl_oop_t ntmprs;
|
||||
|
||||
/* SmallInteger. Number of arguments */
|
||||
hcl_oop_t nargs;
|
||||
|
||||
/* it points to the receiver of the message for a method context.
|
||||
* a block context points to a block object and a function context
|
||||
* points to a function object */
|
||||
|
Reference in New Issue
Block a user