vm: always check call sites when installing PICs, not just when FACTOR_DEBUG is on, since the check is cheap and saves debugging time when compiler is changed
parent
eed0b27d5d
commit
bf40237a17
|
@ -14,13 +14,11 @@ static const fixnum xt_tail_pic_offset = 4;
|
||||||
|
|
||||||
inline static void check_call_site(cell return_address)
|
inline static void check_call_site(cell return_address)
|
||||||
{
|
{
|
||||||
#ifdef FACTOR_DEBUG
|
|
||||||
cell insn = *(cell *)return_address;
|
cell insn = *(cell *)return_address;
|
||||||
/* Check that absolute bit is 0 */
|
/* Check that absolute bit is 0 */
|
||||||
assert((insn & 0x2) == 0x0);
|
assert((insn & 0x2) == 0x0);
|
||||||
/* Check that instruction is branch */
|
/* Check that instruction is branch */
|
||||||
assert((insn >> 26) == 0x12);
|
assert((insn >> 26) == 0x12);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const cell b_mask = 0x3fffffc;
|
static const cell b_mask = 0x3fffffc;
|
||||||
|
|
|
@ -27,10 +27,8 @@ inline static unsigned char call_site_opcode(cell return_address)
|
||||||
|
|
||||||
inline static void check_call_site(cell return_address)
|
inline static void check_call_site(cell return_address)
|
||||||
{
|
{
|
||||||
#ifdef FACTOR_DEBUG
|
|
||||||
unsigned char opcode = call_site_opcode(return_address);
|
unsigned char opcode = call_site_opcode(return_address);
|
||||||
assert(opcode == call_opcode || opcode == jmp_opcode);
|
assert(opcode == call_opcode || opcode == jmp_opcode);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static void *get_call_target(cell return_address)
|
inline static void *get_call_target(cell return_address)
|
||||||
|
|
Loading…
Reference in New Issue