pike.git / src / code / amd64.c

version» Context lines:

pike.git/src/code/amd64.c:1022:    mov_reg_mem(PIKE_MARK_SP_REG, Pike_interpreter_reg,    OFFSETOF(Pike_interpreter_struct, mark_stack_pointer));    dirty_regs &= ~(1 << PIKE_MARK_SP_REG);    }   }         /* NB: We load Pike_fp et al into registers that    * are persistent across function calls.    */ - void amd64_load_fp_reg(void) + static void amd64_load_fp_reg(void)   {    if (fp_reg < 0) {    mov_mem_reg(Pike_interpreter_reg,    OFFSETOF(Pike_interpreter_struct, frame_pointer),    PIKE_FP_REG);    fp_reg = PIKE_FP_REG;    }   }    - void amd64_load_sp_reg(void) + static void amd64_load_sp_reg(void)   {    if (sp_reg < 0) {    mov_mem_reg(Pike_interpreter_reg,    OFFSETOF(Pike_interpreter_struct, stack_pointer),    PIKE_SP_REG);    sp_reg = PIKE_SP_REG;    }   }    - void amd64_load_mark_sp_reg(void) + static void amd64_load_mark_sp_reg(void)   {    if (mark_sp_reg < 0) {    mov_mem_reg(Pike_interpreter_reg,    OFFSETOF(Pike_interpreter_struct, mark_stack_pointer),    PIKE_MARK_SP_REG);    mark_sp_reg = PIKE_MARK_SP_REG;    }   }    -  +  + static void mov_sval_type(enum amd64_reg src, enum amd64_reg dst ) + { +  mov_mem8_reg( src, OFFSETOF(svalue, tu.t.type), dst); + /* and_reg32_imm( dst, 0x1f );*/ + } +  +  + static void svalue_is_referenced(enum amd64_reg in, struct label *not ) + { +  /* bit 4 set, and no higher bit set (all with 8bit values). */ +  /* aka: type & 248 == 8. Incidentally, 248 is equal to -8 in signed 8bit*/ +  and_reg_imm(in,-8); +  /* jz(not) -- saves one comparison in most cases, adds code size, more jumps. */ +  cmp_reg_imm(in,MIN_REF_TYPE); +  jne( not ); + } +  + static void mem_svalue_is_referenced(enum amd64_reg in, struct label *not ) + { +  /* bit 4 set, and no higher bit set. */ +  if( in == P_REG_RAX ) Pike_error("RAX not supported here.\n"); +  mov_sval_type(in,P_REG_RAX); +  svalue_is_referenced(P_REG_RAX, not ); + } +  +    static void update_arg1(INT32 value)   {    mov_imm_reg(value, ARG1_REG);    /* FIXME: Alloc stack space on NT. */   }      static void update_arg2(INT32 value)   {    mov_imm_reg(value, ARG2_REG);    /* FIXME: Alloc stack space on NT. */
pike.git/src/code/amd64.c:1153:    amd64_load_mark_sp_reg();    if (offset) {    add_reg_imm_reg(sp_reg, -offset * sizeof(struct svalue), P_REG_RAX);    mov_reg_mem(P_REG_RAX, mark_sp_reg, 0);    } else {    mov_reg_mem(sp_reg, mark_sp_reg, 0);    }    amd64_add_mark_sp( 1 );   }    - static void mov_sval_type(enum amd64_reg src, enum amd64_reg dst ) - { -  mov_mem8_reg( src, OFFSETOF(svalue, tu.t.type), dst); - /* and_reg32_imm( dst, 0x1f );*/ - } -  -  +    static void amd64_call_c_function(void *addr)   {    flush_dirty_regs();    call_imm(addr);   }      static void amd64_free_svalue(enum amd64_reg src, int guaranteed_ref )   {    LABELS();    if( src == P_REG_RAX )