pike.git / src / code / amd64.c

version» Context lines:

pike.git/src/code/amd64.c:1027:   {    LABELS();    if( reg == REG_RAX )    Pike_fatal("Using RAX in push_svaluep not supported\n" );    amd64_load_sp_reg();    mov_mem_reg(reg, OFFSETOF(svalue, type), REG_RAX);    mov_mem_reg(reg, OFFSETOF(svalue, u.refs), REG_RCX);    mov_reg_mem(REG_RAX, sp_reg, spoff*sizeof(struct svalue)+OFFSETOF(svalue, type));    and_reg_imm(REG_RAX, 0x1f);    mov_reg_mem(REG_RCX, sp_reg, spoff*sizeof(struct svalue)+OFFSETOF(svalue, u.refs)); -  cmp_reg32_imm(REG_RAX, MAX_REF_TYPE); -  jg(&label_A); +  cmp_reg32_imm(REG_RAX, MIN_REF_TYPE); +  jl(&label_A);    add_imm_mem( 1, 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:1089:   }      static void amd64_free_svalue(enum amd64_reg src, int guaranteed_ref )   {    LABELS();    if( src == REG_RAX )    Pike_fatal("Clobbering RAX for free-svalue\n");    /* load type -> RAX */    mov_sval_type( src, REG_RAX );    -  /* if RAX > MAX_REF_TYPE+1 */ -  cmp_reg32_imm( REG_RAX,MAX_REF_TYPE); -  jg( &label_A ); +  /* if RAX < MIN_REF_TYPE+1 */ +  cmp_reg32_imm( REG_RAX,MIN_REF_TYPE); +  jl( &label_A );       /* Load pointer to refs -> RAX */    mov_mem_reg( src, OFFSETOF(svalue, u.refs), REG_RAX);    /* if( !--*RAX ) */    add_mem32_imm( 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 */
pike.git/src/code/amd64.c:1114:    amd64_call_c_function(really_free_svalue);    }    LABEL_A;   }      /* Type already in RAX */   static void amd64_free_svalue_type(enum amd64_reg src, enum amd64_reg type,    int guaranteed_ref )   {    LABELS(); -  /* if type > MAX_REF_TYPE+1 */ +  /* if type < MIN_REF_TYPE+1 */    if( src == REG_RAX )    Pike_fatal("Clobbering RAX for free-svalue\n");    -  cmp_reg32_imm(type,MAX_REF_TYPE); -  jg( &label_A ); +  cmp_reg32_imm(type,MIN_REF_TYPE); +  jl( &label_A );       /* Load pointer to refs -> RAX */    mov_mem_reg( src, OFFSETOF(svalue, u.refs), REG_RAX);    /* if( !--*RAX ) */    add_mem32_imm( 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 */
pike.git/src/code/amd64.c:1146:      void amd64_ref_svalue( enum amd64_reg src, int already_have_type )   {    LABELS();    if( src == REG_RAX ) Pike_fatal("Clobbering src in ref_svalue\n");    if( !already_have_type )    mov_sval_type( src, REG_RAX );    else    and_reg_imm( REG_RAX, 0x1f );    -  /* if RAX > MAX_REF_TYPE+1 */ -  cmp_reg32_imm(REG_RAX, MAX_REF_TYPE ); -  jg( &label_A ); +  /* if RAX > MIN_REF_TYPE+1 */ +  cmp_reg32_imm(REG_RAX, MIN_REF_TYPE ); +  jl( &label_A );    /* Load pointer to refs -> RAX */    mov_mem_reg( src, OFFSETOF(svalue, u.refs), REG_RAX);    /* *RAX++ */    add_mem32_imm( REG_RAX, OFFSETOF(pike_string,refs), 1);    LABEL_A;   }      void amd64_assign_local( int b )   {    amd64_load_fp_reg();
pike.git/src/code/amd64.c:2114:    pop( REG_RDX );       /* Assign new value. */    mov_mem_reg( REG_RBX, 0, REG_RAX );    mov_mem_reg( REG_RBX, 8, REG_RCX );    mov_reg_mem( REG_RAX, REG_RDX, 0 );    mov_reg_mem( REG_RCX, REG_RDX, 8 );       /* inc refs? */    and_reg_imm( REG_RAX, 0x1f ); -  cmp_reg32_imm(REG_RAX, MAX_REF_TYPE); -  jg( &label_B ); +  cmp_reg32_imm(REG_RAX, MIN_REF_TYPE); +  jl( &label_B );    add_imm_mem( 1, REG_RCX, OFFSETOF(pike_string, refs));    jmp( &label_B );       LABEL_D;    /* Bad arg 1. Let the C opcode throw the error. */    amd64_call_c_opcode(instrs[off].address, flags);    /* NOT_REACHED */       LABEL_C;    add_reg_imm_reg( sp_reg, -3*sizeof(struct svalue), ARG1_REG );
pike.git/src/code/amd64.c:2199:    shl_reg32_reg(REG_RBX, REG_RCX);    and_reg_imm(REG_RBX, (BIT_FUNCTION|BIT_OBJECT|BIT_FLOAT));    jnz( &label_A );       mov_mem_reg( sp_reg, -sizeof(struct svalue)+8, REG_RBX );    sub_reg_mem( REG_RBX, sp_reg, -sizeof(struct svalue)*2+8);    /* RBX will now be 0 if they are equal.*/       /* Optimization: The types are equal, pop_stack can be greatly    * simplified if they are <= max_ref_type */ -  cmp_reg32_imm( REG_RCX,MAX_REF_TYPE+1); -  jl( &label_B ); +  cmp_reg32_imm( REG_RCX,MIN_REF_TYPE); +  jge( &label_B );    /* cheap pop. We know that both are > max_ref_type */    amd64_add_sp( -2 );    jmp( &label_D );       LABEL_A; /* Fallback - call opcode. */    amd64_call_c_opcode( instrs[F_BRANCH_WHEN_NE-F_OFFSET].address,    instrs[F_BRANCH_WHEN_NE-F_OFFSET].flags );    amd64_load_sp_reg();    /* Opcode returns 0 if equal, -1 if not. */    mov_reg_reg(REG_RAX, REG_RBX);