From 32803b443c300f7dd2742d2f5edb95a7777c6af4 Mon Sep 17 00:00:00 2001 From: Aleksey Demakov Date: Sat, 28 Mar 2009 01:29:43 +0000 Subject: [PATCH] cosmetic changes --- jit/jit-dump.c | 2 +- jit/jit-reg-alloc.c | 28 +++++++++++++--------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/jit/jit-dump.c b/jit/jit-dump.c index be8af1f..e64b834 100644 --- a/jit/jit-dump.c +++ b/jit/jit-dump.c @@ -411,7 +411,7 @@ void jit_dump_insn(FILE *stream, jit_function_t func, jit_insn_t insn) putc('(', stream); jit_dump_value(stream, func, jit_insn_get_value1(insn), 0); fputs(", ", stream); - fputs(_jit_reg_info[(int)reg].name, stream); + fputs(jit_reg_name(reg), stream); putc(')', stream); return; } diff --git a/jit/jit-reg-alloc.c b/jit/jit-reg-alloc.c index 696cf7c..d66d84e 100644 --- a/jit/jit-reg-alloc.c +++ b/jit/jit-reg-alloc.c @@ -54,7 +54,7 @@ mostly don't have to worry about it: * Check if the register is on the register stack. */ #ifdef JIT_REG_STACK -#define IS_STACK_REG(reg) ((_jit_reg_info[reg].flags & JIT_REG_IN_STACK) != 0) +#define IS_STACK_REG(reg) ((jit_reg_flags(reg) & JIT_REG_IN_STACK) != 0) #else #define IS_STACK_REG(reg) (0) #endif @@ -104,7 +104,7 @@ static void dump_regs(jit_gencode_t gen, const char *name) { continue; } - printf("\t%s: ", _jit_reg_info[reg].name); + printf("\t%s: ", jit_reg_name(reg)); if(gen->contents[reg].num_values > 0) { for(index = 0; index < gen->contents[reg].num_values; ++index) @@ -2613,7 +2613,7 @@ _jit_regs_lookup(char *name) { for(reg = 0; reg < JIT_NUM_REGS; reg++) { - if(strcmp(_jit_reg_info[reg].name, name) == 0) + if(strcmp(jit_reg_name(reg), name) == 0) { return reg; } @@ -2653,8 +2653,7 @@ void _jit_regs_alloc_global(jit_gencode_t gen, jit_function_t func) { for(reg = 0; reg < JIT_NUM_REGS; ++reg) { - if((_jit_reg_info[reg].flags & - (JIT_REG_FIXED | JIT_REG_CALL_USED)) == 0) + if((jit_reg_flags(reg) & (JIT_REG_FIXED|JIT_REG_CALL_USED)) == 0) { jit_reg_set_used(gen->permanent, reg); } @@ -2674,8 +2673,7 @@ void _jit_regs_alloc_global(jit_gencode_t gen, jit_function_t func) } for(posn = 0; posn < num; ++posn) { - value = (jit_value_t)(block->data + posn * - sizeof(struct _jit_value)); + value = (jit_value_t)(block->data + posn * sizeof(struct _jit_value)); if(value->global_candidate && value->usage_count >= JIT_MIN_USED && !(value->is_addressable) && !(value->is_volatile)) { @@ -2708,7 +2706,7 @@ void _jit_regs_alloc_global(jit_gencode_t gen, jit_function_t func) reg = JIT_NUM_REGS - 1; for(index = 0; index < num_candidates; ++index) { - while(reg >= 0 && (_jit_reg_info[reg].flags & JIT_REG_GLOBAL) == 0) + while(reg >= 0 && (jit_reg_flags(reg) & JIT_REG_GLOBAL) == 0) { --reg; } @@ -2734,8 +2732,8 @@ void _jit_regs_init_for_block(jit_gencode_t gen) for(reg = 0; reg < JIT_NUM_REGS; ++reg) { /* Clear everything except permanent and fixed registers */ - if(!jit_reg_is_used(gen->permanent, reg) && - (_jit_reg_info[reg].flags & JIT_REG_FIXED) == 0) + if(!jit_reg_is_used(gen->permanent, reg) + && (jit_reg_flags(reg) & JIT_REG_FIXED) == 0) { gen->contents[reg].num_values = 0; gen->contents[reg].is_long_start = 0; @@ -2770,8 +2768,8 @@ _jit_regs_spill_all(jit_gencode_t gen) for(reg = 0; reg < JIT_NUM_REGS; reg++) { /* Skip this register if it is permanent or fixed */ - if(jit_reg_is_used(gen->permanent, reg) || - (_jit_reg_info[reg].flags & JIT_REG_FIXED) != 0) + if(jit_reg_is_used(gen->permanent, reg) + || (jit_reg_flags(reg) & JIT_REG_FIXED) != 0) { continue; } @@ -3022,7 +3020,7 @@ _jit_regs_load_value(jit_gencode_t gen, jit_value_t value, int destroy, int used suitable_age = -1; for(reg = 0; reg < JIT_NUM_REGS; reg++) { - if((_jit_reg_info[reg].flags & type) == 0) + if((jit_reg_flags(reg) & type) == 0) { continue; } @@ -3275,7 +3273,7 @@ _jit_regs_clobber_all(jit_gencode_t gen, _jit_regs_t *regs) for(index = 0; index < JIT_NUM_REGS; index++) { - if((_jit_reg_info[index].flags & JIT_REG_FIXED) != 0) + if((jit_reg_flags(index) & JIT_REG_FIXED) != 0) { continue; } @@ -3406,7 +3404,7 @@ _jit_regs_gen(jit_gencode_t gen, _jit_regs_t *regs) /* Spill clobbered registers. */ for(reg = 0; reg < JIT_NUM_REGS; reg++) { - if((_jit_reg_info[reg].flags & JIT_REG_FIXED)) + if((jit_reg_flags(reg) & JIT_REG_FIXED)) { continue; }