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

Allow jit_jmpi on an immediate constant address.

* lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c,
	lib/jit_hppa.c, lib/jit_ia64.c, lib/jit_mips.c,
	lib/jit_ppc.c, lib/jit_s390x.c, lib/jit_sparc.c,
	lib/jit_x86.c, lib/lightning.c: Allow jit_jmpi on a
	target that is not a node. This may lead to hard to
	debug code generation, but is a required feature for
	certain generators, like the ones that used lightning
	1.2x. Note that previously, but not really well
	documented, it was instructed to use:
	jit_movi(rn, addr); jit_jmpr(rn);
	but now, plain:
	jit_patch_abs(jit_jmpi(), addr);
	should also work.
This commit is contained in:
pcpa 2014-10-14 17:04:13 -03:00
parent 1d75fe625a
commit 20a2f1f9c5
12 changed files with 144 additions and 87 deletions

View file

@ -2295,6 +2295,8 @@ _shortcut_jump(jit_state_t *_jit, jit_node_t *prev, jit_node_t *node)
for (next = jump->next; next; next = next->next) {
switch (next->code) {
case jit_code_jmpi:
if (!(next->flag & jit_flag_node))
return (0);
if (jump->link == node)
jump->link = node->link;
else {
@ -2500,7 +2502,8 @@ _reverse_jump(jit_state_t *_jit, jit_node_t *prev, jit_node_t *node)
return (0);
/* =><cond_jump L0> <jump L1> <label L0> */
local_next = node->next;
if (local_next->code != jit_code_jmpi)
if (local_next->code != jit_code_jmpi ||
!(local_next->flag & jit_flag_node))
return (0);
/* <cond_jump L0> =><jump L1> <label L0> */