1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-21 19:20:21 +02:00

Add the new jit_pointer_p predicate interface.

* include/lightning.h, lib/lightning.c: Add the new
	jit_pointer_p interface, that returns a boolean value
	telling if the pointer argument is inside the jit
	code buffer. This is useful to avoid the need to add
	extra labels and calls to jit_address to figure bounds
	of code buffer, and still keep internal data private.
This commit is contained in:
pcpa 2013-09-14 14:43:05 -03:00
parent 948315f45e
commit 95e3fbc8bc
3 changed files with 18 additions and 0 deletions

View file

@ -337,6 +337,13 @@ _jit_callee_save_p(jit_state_t *_jit, jit_int32_t regno)
return (!!(_rvs[regno].spec & jit_class_sav));
}
extern jit_bool_t
_jit_pointer_p(jit_state_t *_jit, jit_pointer_t address)
{
return ((jit_uint8_t *)address >= _jit->code.ptr &&
(jit_word_t)address < _jit->pc.w);
}
#if __ia64__
void
jit_regset_com(jit_regset_t *u, jit_regset_t *v)