pike.git / src / code / amd64.c

version» Context lines:

pike.git/src/code/amd64.c:650:    }   }      static void cmp_reg_reg( enum amd64_reg reg1, enum amd64_reg reg2 )   {    rex(1, reg1, 0, reg2);    opcode( 0x39 );    modrm( 3, reg1, reg2 );   }    - static int jmp_rel_imm32( int rel ) + static int jmp_rel_imm32( int addr )   { -  +  int rel = addr - (PIKE_PC + 5); // counts from the next instruction    int res;    opcode( 0xe9 );    res = PIKE_PC;    id( rel );    return res;   }    - static void jmp_rel_imm( int rel ) + static void jmp_rel_imm( int addr )   { -  +  int rel = addr - (PIKE_PC + 2); // counts from the next instruction    if(rel >= -0x80 && rel <= 0x7f )    {    opcode( 0xeb );    ib( rel );    return;    } -  jmp_rel_imm32( rel ); +  jmp_rel_imm32( addr );   }    - static void call_rel_imm32( int rel ) + static void call_rel_imm32( int addr )   { -  rel -= 5; // counts from the next instruction +  int rel = addr - (PIKE_PC + 5); // counts from the next instruction    opcode( 0xe8 );    id( rel );    sp_reg = -1;    return;   }         static void jmp_reg( enum amd64_reg reg )   {    rex(0,reg,0,0);
pike.git/src/code/amd64.c:1386:    while( PIKE_PC & 3 )    ib( 0x90 );   }      static void amd64_ins_branch_check_threads_etc(int code_only)   {    LABELS();       if( !branch_check_threads_update_etc )    { -  /* Create update + call to branch_check_threds_etc */ +  /* Create update + call to branch_check_threads_etc */    if( !code_only )    jmp( &label_A );    branch_check_threads_update_etc = PIKE_PC;    if( (unsigned long long)&fast_check_threads_counter < 0x7fffffffULL )    {    /* Short pointer. */    clear_reg( REG_RAX );    add_mem32_imm( REG_RAX,    (int)(ptrdiff_t)&fast_check_threads_counter,    0x80 );
pike.git/src/code/amd64.c:1413:    mov_imm_reg( (ptrdiff_t)branch_check_threads_etc, REG_RAX );    jmp_reg(REG_RAX); /* ret in BCTE will return to desired point. */    amd64_align();    }    if( !code_only )    {    LABEL_A;    /* Use C-stack for counter. We have padding added in entry */    add_mem8_imm( REG_RSP, 0, 1 );    jno( &label_B ); -  call_rel_imm32( branch_check_threads_update_etc-PIKE_PC ); +  call_rel_imm32( branch_check_threads_update_etc );    LABEL_B;    }   }         void amd64_init_interpreter_state(void)   {    instrs[F_CATCH - F_OFFSET].address = inter_return_opcode_F_CATCH;   }      static void amd64_return_from_function()   {    if( ret_for_func )    { -  jmp_rel_imm( ret_for_func - PIKE_PC ); +  jmp_rel_imm( ret_for_func );    }    else    {    ret_for_func = PIKE_PC;    pop(REG_RBX); /* Stack padding. */    pop(REG_RBX);    pop(REG_R12);    pop(REG_R13);    pop(REG_R14);    pop(REG_R15);