From 20a2f1f9c539c6b7509f9a32ef926b9b9dd98cc9 Mon Sep 17 00:00:00 2001 From: pcpa Date: 2014年10月14日 17:04:13 -0300 Subject: 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. --- lib/jit_mips.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'lib/jit_mips.c') diff --git a/lib/jit_mips.c b/lib/jit_mips.c index 88f128c..3eec489 100644 --- a/lib/jit_mips.c +++ b/lib/jit_mips.c @@ -1343,15 +1343,19 @@ _emit_code(jit_state_t *_jit) jmpr(rn(node->u.w)); break; case jit_code_jmpi: - temp = node->u.n; - assert(temp->code == jit_code_label || - temp->code == jit_code_epilog); - if (temp->flag & jit_flag_patch) - jmpi(temp->u.w); - else { - word = jmpi(_jit->pc.w); - patch(word, node); + if (node->flag & jit_flag_node) { + temp = node->u.n; + assert(temp->code == jit_code_label || + temp->code == jit_code_epilog); + if (temp->flag & jit_flag_patch) + jmpi(temp->u.w); + else { + word = jmpi(_jit->pc.w); + patch(word, node); + } } + else + jmpi(node->u.w); break; case jit_code_callr: callr(rn(node->u.w)); -- cgit v1.2.3

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