Add the new jit_pointer_p predicate interface. - lightning.git - Portable just-in-time compiler library

index : lightning.git
Portable just-in-time compiler library
summary refs log tree commit diff
path: root/lib/lightning.c
diff options
context:
space:
mode:
authorpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2013年09月14日 14:43:05 -0300
committerpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2013年09月14日 14:43:05 -0300
commit95e3fbc8bc674a3d9ab745ae9d0a8ff630016fdf (patch)
tree33cc4ad82218999bf764bd41f6daeae118d17e88 /lib/lightning.c
parent948315f45ebc6c378354d26738b376e87a1cb343 (diff)
downloadlightning-95e3fbc8bc674a3d9ab745ae9d0a8ff630016fdf.tar.gz
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.
Diffstat (limited to 'lib/lightning.c')
-rw-r--r--lib/lightning.c 7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/lightning.c b/lib/lightning.c
index 58e7130..817976c 100644
--- a/lib/lightning.c
+++ b/lib/lightning.c
@@ -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)
generated by cgit v1.2.3 (git 2.46.0) at 2025年10月02日 18:14:58 +0000

AltStyle によって変換されたページ (->オリジナル) /