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

Implement the new jit_set_code interface.

* include/lightning.h, include/lightning/jit_private.h,
	lib/lightning.c: Implement the new jit_set_code() interface,
	that allows instructing lightning to use an alternate code
	buffer. The new jit_realize() function should be called
	before jit_set_code(), and usually call jit_get_code()
	to query the amount of bytes expected to be required for
	the code.

	* lib/jit_size.c: Minor update to have less chances of
	miscalculating the code buffer by starting the counter
	with the size of the longest instruction instead of zero,
	as code emit fails if at any moment less than the longest
	instruction bytes are available.

	* check/setcode.c: New file implementing some basic tests
	of the new jit_set_code() interface.

	* check/Makefile.am: Update for newer test case.
This commit is contained in:
pcpa 2014-03-11 11:40:42 -03:00
parent a9433b5a2c
commit 79bc3d03dd
9 changed files with 209 additions and 45 deletions

View file

@ -336,6 +336,7 @@ struct jit_compiler {
#endif
jit_node_t *head;
jit_node_t *tail;
jit_uint32_t realize : 1; /* jit_realize() called? */
jit_uint32_t done : 1; /* emit state finished */
jit_uint32_t emit : 1; /* emit state entered */
jit_uint32_t again : 1; /* start over emiting function */
@ -464,6 +465,8 @@ struct jit_state {
jit_word_t length;
} note;
jit_compiler_t *comp;
/* Flags to know if user did set the code and data buffers */
jit_uint32_t user_code : 1;
};
struct jit_register {