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

db4
Slava Pestov 2010-02-03 20:32:18 +13:00
parent eed0b27d5d
commit bf40237a17
2 changed files with 0 additions and 4 deletions

View File

@ -14,13 +14,11 @@ static const fixnum xt_tail_pic_offset = 4;
inline static void check_call_site(cell return_address)
{
#ifdef FACTOR_DEBUG
cell insn = *(cell *)return_address;
/* Check that absolute bit is 0 */
assert((insn & 0x2) == 0x0);
/* Check that instruction is branch */
assert((insn >> 26) == 0x12);
#endif
}
static const cell b_mask = 0x3fffffc;

View File

@ -27,10 +27,8 @@ inline static unsigned char call_site_opcode(cell return_address)
inline static void check_call_site(cell return_address)
{
#ifdef FACTOR_DEBUG
unsigned char opcode = call_site_opcode(return_address);
assert(opcode == call_opcode || opcode == jmp_opcode);
#endif
}
inline static void *get_call_target(cell return_address)