96 pc = ((uint32_t *) ra) - 3;
104 if ((mcode >> 16) == 0x3c19) {
111 offset = (int32_t) (mcode << 16);
117 assert((mcode >> 16) != 0x6739);
119 offset += (int16_t) (mcode & 0x0000ffff);
124 offset = (int16_t) (mcode & 0x0000ffff);
128 if ((mcode >> 16) == 0x81ad) {
131 pa = ((uint8_t *) pv) + offset;
133 else if ((mcode >> 16) == 0x81ac) {
141 pa = ((uint8_t *) mptr) + offset;
146 vm_abort(
"md_jit_method_patch_address: unknown instruction %x",
171 uint32_t mcode = *((uint32_t*) xpc);
231 #if defined(ENABLE_REPLACEMENT)
232 void md_patch_replacement_point(
u1 *
pc,
u1 *savedmcode,
bool revert)
238 *(
u4*)(pc) = *(
u4*)(savedmcode);
242 *(
u4*)(savedmcode) = *(
u4*)(pc);
249 *(
u4*)(pc) = (
u4) mcode;
intptr_t value
Value (numeric or address) passed with the trap.
#define M_INSTR_OP2_IMM_I(x)
Contains information about a decoded trap instruction.
void vm_abort(const char *text,...)
int type
Specific trap type (see md-trap.h).
#define M_INSTR_OP2_IMM_A(x)
#define M_INSTR_OP2_IMM_D(x)
void * md_jit_method_patch_address(void *pv, void *ra, void *mptr)
bool md_trap_decode(trapinfo_t *trp, int sig, void *xpc, executionstate_t *es)
Decode the trap instruction at the given PC.
uintptr_t intregs[INT_REG_CNT]
static void md_icacheflush(void *addr, int nbytes)
bool patcher_is_valid_trap_instruction_at(void *pc)
Check if the trap instruction at the given PC is valid.