Move flags from F_CODE_BLOCK to F_BLOCK for further space savings
parent
78f168e304
commit
8f059e07a7
|
@ -97,7 +97,7 @@ F_CODE_BLOCK *frame_code(F_STACK_FRAME *frame)
|
||||||
|
|
||||||
CELL frame_type(F_STACK_FRAME *frame)
|
CELL frame_type(F_STACK_FRAME *frame)
|
||||||
{
|
{
|
||||||
return frame_code(frame)->type;
|
return frame_code(frame)->block.type;
|
||||||
}
|
}
|
||||||
|
|
||||||
CELL frame_executing(F_STACK_FRAME *frame)
|
CELL frame_executing(F_STACK_FRAME *frame)
|
||||||
|
|
|
@ -107,12 +107,12 @@ void update_literal_references(F_CODE_BLOCK *compiled)
|
||||||
aging and nursery collections */
|
aging and nursery collections */
|
||||||
void copy_literal_references(F_CODE_BLOCK *compiled)
|
void copy_literal_references(F_CODE_BLOCK *compiled)
|
||||||
{
|
{
|
||||||
if(collecting_gen >= compiled->last_scan)
|
if(collecting_gen >= compiled->block.last_scan)
|
||||||
{
|
{
|
||||||
if(collecting_accumulation_gen_p())
|
if(collecting_accumulation_gen_p())
|
||||||
compiled->last_scan = collecting_gen;
|
compiled->block.last_scan = collecting_gen;
|
||||||
else
|
else
|
||||||
compiled->last_scan = collecting_gen + 1;
|
compiled->block.last_scan = collecting_gen + 1;
|
||||||
|
|
||||||
/* initialize chase pointer */
|
/* initialize chase pointer */
|
||||||
CELL scan = newspace->here;
|
CELL scan = newspace->here;
|
||||||
|
@ -153,7 +153,7 @@ to update references to other words, without worrying about literals
|
||||||
or dlsyms. */
|
or dlsyms. */
|
||||||
void update_word_references(F_CODE_BLOCK *compiled)
|
void update_word_references(F_CODE_BLOCK *compiled)
|
||||||
{
|
{
|
||||||
if(compiled->needs_fixup)
|
if(compiled->block.needs_fixup)
|
||||||
relocate_code_block(compiled);
|
relocate_code_block(compiled);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -305,8 +305,8 @@ void relocate_code_block_step(F_REL *rel, F_CODE_BLOCK *compiled)
|
||||||
/* Perform all fixups on a code block */
|
/* Perform all fixups on a code block */
|
||||||
void relocate_code_block(F_CODE_BLOCK *compiled)
|
void relocate_code_block(F_CODE_BLOCK *compiled)
|
||||||
{
|
{
|
||||||
compiled->last_scan = NURSERY;
|
compiled->block.last_scan = NURSERY;
|
||||||
compiled->needs_fixup = false;
|
compiled->block.needs_fixup = false;
|
||||||
iterate_relocations(compiled,relocate_code_block_step);
|
iterate_relocations(compiled,relocate_code_block_step);
|
||||||
flush_icache_for(compiled);
|
flush_icache_for(compiled);
|
||||||
}
|
}
|
||||||
|
@ -411,9 +411,9 @@ F_CODE_BLOCK *add_code_block(
|
||||||
UNREGISTER_ROOT(literals);
|
UNREGISTER_ROOT(literals);
|
||||||
|
|
||||||
/* compiled header */
|
/* compiled header */
|
||||||
compiled->type = type;
|
compiled->block.type = type;
|
||||||
compiled->last_scan = NURSERY;
|
compiled->block.last_scan = NURSERY;
|
||||||
compiled->needs_fixup = true;
|
compiled->block.needs_fixup = true;
|
||||||
compiled->literals = literals;
|
compiled->literals = literals;
|
||||||
compiled->relocation = relocation;
|
compiled->relocation = relocation;
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ bool in_code_heap_p(CELL ptr)
|
||||||
|
|
||||||
void set_word_code(F_WORD *word, F_CODE_BLOCK *compiled)
|
void set_word_code(F_WORD *word, F_CODE_BLOCK *compiled)
|
||||||
{
|
{
|
||||||
if(compiled->type != WORD_TYPE)
|
if(compiled->block.type != WORD_TYPE)
|
||||||
critical_error("bad param to set_word_xt",(CELL)compiled);
|
critical_error("bad param to set_word_xt",(CELL)compiled);
|
||||||
|
|
||||||
word->code = compiled;
|
word->code = compiled;
|
||||||
|
|
|
@ -111,7 +111,10 @@ typedef enum
|
||||||
|
|
||||||
typedef struct _F_BLOCK
|
typedef struct _F_BLOCK
|
||||||
{
|
{
|
||||||
F_BLOCK_STATUS status;
|
char status; /* free or allocated? */
|
||||||
|
char type; /* this is WORD_TYPE or QUOTATION_TYPE */
|
||||||
|
char last_scan; /* the youngest generation in which this block's literals may live */
|
||||||
|
char needs_fixup; /* is this a new block that needs full fixup? */
|
||||||
|
|
||||||
/* In bytes, includes this header */
|
/* In bytes, includes this header */
|
||||||
CELL size;
|
CELL size;
|
||||||
|
@ -131,9 +134,6 @@ typedef struct _F_FREE_BLOCK
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
F_BLOCK block;
|
F_BLOCK block;
|
||||||
char type; /* this is WORD_TYPE or QUOTATION_TYPE */
|
|
||||||
char last_scan; /* the youngest generation in which this block's literals may live */
|
|
||||||
char needs_fixup; /* is this a new block that needs full fixup? */
|
|
||||||
CELL literals; /* # bytes */
|
CELL literals; /* # bytes */
|
||||||
CELL relocation; /* tagged pointer to byte-array or f */
|
CELL relocation; /* tagged pointer to byte-array or f */
|
||||||
} F_CODE_BLOCK;
|
} F_CODE_BLOCK;
|
||||||
|
|
|
@ -157,7 +157,7 @@ bool jit_stack_frame_p(F_ARRAY *array)
|
||||||
|
|
||||||
void set_quot_xt(F_QUOTATION *quot, F_CODE_BLOCK *code)
|
void set_quot_xt(F_QUOTATION *quot, F_CODE_BLOCK *code)
|
||||||
{
|
{
|
||||||
if(code->type != QUOTATION_TYPE)
|
if(code->block.type != QUOTATION_TYPE)
|
||||||
critical_error("Bad param to set_quot_xt",(CELL)code);
|
critical_error("Bad param to set_quot_xt",(CELL)code);
|
||||||
|
|
||||||
quot->code = code;
|
quot->code = code;
|
||||||
|
|
Loading…
Reference in New Issue