6 #define FRAME_RETURN_ADDRESS(frame,vm) *(void **)(vm->frame_successor(frame) + 1)
8 inline static void flush_icache(cell start, cell len) {}
10 /* In the instruction sequence:
15 the offset from the immediate operand to MOV to the instruction after
16 the jump is a cell for the immediate operand, 4 bytes for the JMP
17 destination, and one byte for the JMP opcode. */
18 static const fixnum xt_tail_pic_offset = 4 + 1;
20 static const unsigned char call_opcode = 0xe8;
21 static const unsigned char jmp_opcode = 0xe9;
23 inline static unsigned char call_site_opcode(cell return_address)
25 return *(unsigned char *)(return_address - 5);
28 inline static void check_call_site(cell return_address)
30 unsigned char opcode = call_site_opcode(return_address);
31 assert(opcode == call_opcode || opcode == jmp_opcode);
34 inline static void *get_call_target(cell return_address)
36 check_call_site(return_address);
37 return (void *)(*(int *)(return_address - 4) + return_address);
40 inline static void set_call_target(cell return_address, void *target)
42 check_call_site(return_address);
43 *(int *)(return_address - 4) = (u32)((cell)target - return_address);
46 inline static bool tail_call_site_p(cell return_address)
48 switch(call_site_opcode(return_address))
50 case jmp_opcode: return true;
51 case call_opcode: return false;
52 default: abort(); return false;
56 inline static unsigned int fpu_status(unsigned int status)
61 r |= FP_TRAP_INVALID_OPERATION;
63 r |= FP_TRAP_ZERO_DIVIDE;
65 r |= FP_TRAP_OVERFLOW;
67 r |= FP_TRAP_UNDERFLOW;