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

Implement and document the new jit_indirect call.

* include/lightning.h, lib/lightning.c: Add the new
	jit_indirect() call, that returns a special label node,
	and tells lightning that the label may be the target of
	an indirect jump.

	* doc/body.texi: Document the new jit_indirect() call, and
	add examples of different ways to create labels and branches.
This commit is contained in:
pcpa 2014-03-06 18:20:29 -03:00
parent c146f06793
commit a9433b5a2c
4 changed files with 88 additions and 2 deletions

View file

@ -548,7 +548,10 @@ _jit_address(jit_state_t *_jit, jit_node_t *node)
{
assert(_jitc->done);
assert(node &&
(node->code == jit_code_note || node->code == jit_code_name));
/* If a node type that is documented to be a fixed marker */
(node->code == jit_code_note || node->code == jit_code_name ||
/* If another special fixed marker, returned by jit_indirect() */
(node->code == jit_code_label && (node->flag & jit_flag_use))));
return ((jit_pointer_t)node->u.w);
}
@ -1083,6 +1086,17 @@ _jit_forward(jit_state_t *_jit)
return (jit_new_node_no_link(jit_code_label));
}
jit_node_t *
_jit_indirect(jit_state_t *_jit)
{
jit_node_t *node;
node = jit_label();
node->flag |= jit_flag_use;
return (node);
}
void
_jit_link(jit_state_t *_jit, jit_node_t *node)
{