pike.git / src / code / amd64.c

version» Context lines:

pike.git/src/code/amd64.c:655:    }   }      static void amd64_call_c_function(void *addr)   {    CALL_ABSOLUTE(addr);    next_reg = REG_RAX;    CLEAR_REGS();   }    + static void amd64_stack_error(void) + { +  Pike_fatal("Stack error\n"); + } +    void amd64_update_pc(void)   {    INT32 tmp = PIKE_PC, disp;       if (amd64_prev_stored_pc == -1) {    enum amd64_reg tmp_reg = alloc_reg(0);    amd64_load_fp_reg();    AMD64_LOAD_RIP32(tmp - (PIKE_PC + 7), tmp_reg);    AMD64_MOVE_REG_TO_RELADDR(tmp_reg, fp_reg, OFFSETOF(pike_frame, pc));   #ifdef PIKE_DEBUG
pike.git/src/code/amd64.c:685:    amd64_load_fp_reg();    AMD64_ADD_VAL_TO_RELADDR (disp, OFFSETOF (pike_frame, pc), fp_reg);    }    else {   #ifdef PIKE_DEBUG    if (a_flag >= 60)    fprintf (stderr, "pc %d update pc - already up-to-date\n", tmp);   #endif    }    amd64_prev_stored_pc = tmp; + #ifdef PIKE_DEBUG +  if (d_flag) { +  /* Check that the stack keeps being 16 byte aligned. */ +  AMD64_MOV_REG(REG_RSP, REG_RAX); +  AMD64_AND_IMM32(REG_RAX, 0x08); +  AMD64_JE(0x09); +  CALL_ABSOLUTE(amd64_stack_error);    } -  + #endif + }         static void maybe_update_pc(void)   {    static int last_prog_id=-1;    static size_t last_num_linenumbers=-1;       if(   #ifdef PIKE_DEBUG    /* Update the pc more often for the sake of the opcode level trace. */