Move flags from F_CODE_BLOCK to F_BLOCK for further space savings

db4
Slava Pestov 2009-03-19 03:49:49 -05:00
parent 78f168e304
commit 8f059e07a7
5 changed files with 16 additions and 16 deletions

View File

@ -97,7 +97,7 @@ F_CODE_BLOCK *frame_code(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)

View File

@ -107,12 +107,12 @@ void update_literal_references(F_CODE_BLOCK *compiled)
aging and nursery collections */
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())
compiled->last_scan = collecting_gen;
compiled->block.last_scan = collecting_gen;
else
compiled->last_scan = collecting_gen + 1;
compiled->block.last_scan = collecting_gen + 1;
/* initialize chase pointer */
CELL scan = newspace->here;
@ -153,7 +153,7 @@ to update references to other words, without worrying about literals
or dlsyms. */
void update_word_references(F_CODE_BLOCK *compiled)
{
if(compiled->needs_fixup)
if(compiled->block.needs_fixup)
relocate_code_block(compiled);
else
{
@ -305,8 +305,8 @@ void relocate_code_block_step(F_REL *rel, F_CODE_BLOCK *compiled)
/* Perform all fixups on a code block */
void relocate_code_block(F_CODE_BLOCK *compiled)
{
compiled->last_scan = NURSERY;
compiled->needs_fixup = false;
compiled->block.last_scan = NURSERY;
compiled->block.needs_fixup = false;
iterate_relocations(compiled,relocate_code_block_step);
flush_icache_for(compiled);
}
@ -411,9 +411,9 @@ F_CODE_BLOCK *add_code_block(
UNREGISTER_ROOT(literals);
/* compiled header */
compiled->type = type;
compiled->last_scan = NURSERY;
compiled->needs_fixup = true;
compiled->block.type = type;
compiled->block.last_scan = NURSERY;
compiled->block.needs_fixup = true;
compiled->literals = literals;
compiled->relocation = relocation;

View File

@ -14,7 +14,7 @@ bool in_code_heap_p(CELL ptr)
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);
word->code = compiled;

View File

@ -111,7 +111,10 @@ typedef enum
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 */
CELL size;
@ -131,9 +134,6 @@ typedef struct _F_FREE_BLOCK
typedef struct
{
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 relocation; /* tagged pointer to byte-array or f */
} F_CODE_BLOCK;

View File

@ -157,7 +157,7 @@ bool jit_stack_frame_p(F_ARRAY *array)
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);
quot->code = code;