pike.git / src / code / amd64.c

version» Context lines:

pike.git/src/code/amd64.c:1080:   static void amd64_push_svaluep_to(int reg, int spoff)   {    LABELS();    if( reg == P_REG_RAX )    Pike_fatal("Using RAX in push_svaluep not supported\n" );    amd64_load_sp_reg();    mov_mem_reg(reg, OFFSETOF(svalue, tu.t.type), P_REG_RAX);    mov_mem_reg(reg, OFFSETOF(svalue, u.refs), P_REG_RCX);    mov_reg_mem(P_REG_RAX, sp_reg,    spoff*sizeof(struct svalue)+OFFSETOF(svalue, tu.t.type)); -  and_reg_imm(P_REG_RAX, ~(MIN_REF_TYPE - 1) & 0x1f); +     mov_reg_mem(P_REG_RCX, sp_reg,    spoff*sizeof(struct svalue)+OFFSETOF(svalue, u.refs)); -  cmp_reg32_imm(P_REG_RAX, MIN_REF_TYPE); -  jne(&label_A); +  and_reg32_imm(P_REG_RAX, MIN_REF_TYPE); +  jz(&label_A);    add_imm_mem( 1, P_REG_RCX, OFFSETOF(pike_string, refs));    LABEL_A;   }      static void amd64_push_svaluep(int reg)   {    amd64_push_svaluep_to( reg, 0 );    amd64_add_sp( 1 );   }   
pike.git/src/code/amd64.c:1165:   }      static void amd64_free_svalue(enum amd64_reg src, int guaranteed_ref )   {    LABELS();    if( src == P_REG_RAX )    Pike_fatal("Clobbering RAX for free-svalue\n");    /* load type -> RAX */    mov_sval_type( src, P_REG_RAX );    -  and_reg_imm(P_REG_RAX, (~(MIN_REF_TYPE - 1)) & 0x1f); +  and_reg_imm(P_REG_RAX, MIN_REF_TYPE); +  jz( &label_A );    -  /* if RAX != MIN_REF_TYPE */ -  cmp_reg32_imm( P_REG_RAX,MIN_REF_TYPE); -  jne( &label_A ); -  +     /* Load pointer to refs -> RAX */    mov_mem_reg( src, OFFSETOF(svalue, u.refs), P_REG_RAX);    /* if( !--*RAX ) */    add_mem32_imm( P_REG_RAX, OFFSETOF(pike_string,refs), -1);    if( !guaranteed_ref )    {    /* We need to see if refs got to 0. */    jnz( &label_A );    /* if so, call really_free_svalue */    if( src != ARG1_REG )
pike.git/src/code/amd64.c:1196:      /* Type already in register. Note: Clobbers the type register. */   static void amd64_free_svalue_type(enum amd64_reg src, enum amd64_reg type,    int guaranteed_ref )   {    LABELS();    /* if type < MIN_REF_TYPE+1 */    if( src == P_REG_RAX )    Pike_fatal("Clobbering RAX for free-svalue\n");    -  and_reg_imm(type, ~(MIN_REF_TYPE - 1)); +  and_reg32_imm(type, MIN_REF_TYPE); +  jz( &label_A );    -  cmp_reg32_imm(type,MIN_REF_TYPE); -  jne( &label_A ); -  +     /* Load pointer to refs -> RAX */    mov_mem_reg( src, OFFSETOF(svalue, u.refs), P_REG_RAX);    /* if( !--*RAX ) */    add_mem32_imm( P_REG_RAX, OFFSETOF(pike_string,refs), -1);    if( !guaranteed_ref )    {    /* We need to see if refs got to 0. */    jnz( &label_A );    /* if so, call really_free_svalue */    if( src != ARG1_REG )
pike.git/src/code/amd64.c:1223:    }    LABEL_A;   }      void amd64_ref_svalue( enum amd64_reg src, int already_have_type )   {    LABELS();    if( src == P_REG_RAX ) Pike_fatal("Clobbering src in ref_svalue\n");    if( !already_have_type )    mov_sval_type( src, P_REG_RAX ); -  else -  and_reg_imm( P_REG_RAX, 0x1f ); -  -  /* if RAX > MIN_REF_TYPE+1 */ -  cmp_reg32_imm(P_REG_RAX, MIN_REF_TYPE ); -  jl( &label_A ); +  and_reg32_imm( P_REG_RAX, MIN_REF_TYPE ); +  jz( &label_A );    /* Load pointer to refs -> RAX */    mov_mem_reg( src, OFFSETOF(svalue, u.refs), P_REG_RAX);    /* *RAX++ */    add_mem32_imm( P_REG_RAX, OFFSETOF(pike_string,refs), 1);    LABEL_A;   }      void amd64_assign_svalue_no_free( enum amd64_reg dst, enum amd64_reg src, ptrdiff_t src_offset )   {    if( dst == P_REG_RAX ||src == P_REG_RAX )
pike.git/src/code/amd64.c:2183:    amd64_free_svalue( P_REG_RDX, 0 );    pop( P_REG_RDX );       /* Assign new value. */    mov_mem_reg( P_REG_RBX, 0, P_REG_RAX );    mov_mem_reg( P_REG_RBX, 8, P_REG_RCX );    mov_reg_mem( P_REG_RAX, P_REG_RDX, 0 );    mov_reg_mem( P_REG_RCX, P_REG_RDX, 8 );       /* inc refs? */ -  and_reg_imm( P_REG_RAX, 0x1f ); -  cmp_reg32_imm(P_REG_RAX, MIN_REF_TYPE); -  jl( &label_B ); +  and_reg32_imm( P_REG_RAX, MIN_REF_TYPE ); +  jz( &label_B );    add_imm_mem( 1, P_REG_RCX, OFFSETOF(pike_string, refs));    jmp( &label_B );       LABEL_C;    add_reg_imm_reg( sp_reg, -3*sizeof(struct svalue), ARG1_REG );    mov_reg_reg( P_REG_RBX, ARG2_REG );    amd64_call_c_function( assign_lvalue );    jmp(&label_B);       LABEL_A;