Implement jit_allocar for dynamic stack allocation - 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/jit_ia64-cpu.c
diff options
context:
space:
mode:
authorpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2015年02月17日 14:37:57 -0200
committerpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2015年02月17日 14:37:57 -0200
commitad589fbb0a308f86f7e1e2de815e05d6b39594bb (patch)
treead4c4cecad4c572f7da7395bb58fc5e739dd1946 /lib/jit_ia64-cpu.c
parent9f72e661164ef4e2a26ba7a185b24574c57903cb (diff)
downloadlightning-ad589fbb0a308f86f7e1e2de815e05d6b39594bb.tar.gz
Implement jit_allocar for dynamic stack allocation
* include/lightning.h, include/lightning/jit_private.h, lib/jit_aarch64-cpu.c, lib/jit_aarch64.c, lib/jit_alpha-cpu.c, lib/jit_alpha.c, lib/jit_arm-cpu.c, lib/jit_arm.c, lib/jit_hppa-cpu.c, lib/jit_hppa.c, lib/jit_ia64-cpu.c, lib/jit_ia64.c, lib/jit_mips-cpu.c, lib/jit_mips.c, lib/jit_ppc-cpu.c, lib/jit_ppc.c, lib/jit_s390-cpu.c, lib/jit_s390.c, lib/jit_sparc-cpu.c, lib/jit_sparc.c, lib/jit_x86-cpu.c, lib/jit_x86.c: Implement the new jit_allocar(offs, size) interface, that receives two integer registers arguments, allocates space dynamically in the stack, returns the offset in the first argument, and uses the second argument for the size in bytes of the memory to be allocated. * check/allocar.ok, check/allocar.tst: New files implementing test cases for the new jit_allocar interface. * check/Makefile.am, check/lightning.c: Update for the new test case and interface. * doc/body.texi: Add documentation of the new interface.
Diffstat (limited to 'lib/jit_ia64-cpu.c')
-rw-r--r--lib/jit_ia64-cpu.c 9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/jit_ia64-cpu.c b/lib/jit_ia64-cpu.c
index 7a9a974..5cbd327 100644
--- a/lib/jit_ia64-cpu.c
+++ b/lib/jit_ia64-cpu.c
@@ -5190,6 +5190,8 @@ _prolog(jit_state_t *_jit, jit_node_t *node)
return;
_jitc->function->self.aoff = frame;
}
+ if (_jitc->function->allocar)
+ _jitc->function->self.aoff &= -16;
_jitc->function->stack = ((_jitc->function->self.alen -
_jitc->function->self.aoff) + 15) & -16;
@@ -5253,6 +5255,13 @@ _prolog(jit_state_t *_jit, jit_node_t *node)
addi(GR_2, GR_4, 80);
STF_SPILL(GR_2, rn(JIT_F5));
}
+
+ if (_jitc->function->allocar) {
+ reg = jit_get_reg(jit_class_gpr);
+ movi(rn(reg), _jitc->function->self.aoff);
+ stxi_i(_jitc->function->aoffoff, GR_4, rn(reg));
+ jit_unget_reg(reg);
+ }
}
static void
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月26日 14:08:21 +0000

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