mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-21 19:20:21 +02:00
Make it clear stdarg like abstraction is not supported.
* include/lightning.h, include/lightning/jit_private.h, lib/jit_arm.c, lib/jit_mips.c, lib/jit_ppc.c, lib/jit_x86.c, lib/lightning.c: Make jit_ellipsis implementation not backend specific. It is not intended to handle va_list like objects at runtime, as jit_arg* and jit_getarg* return constant values resolved at parse time, so, effectively it is not possible to create printf like jit functions, as there is no va_start, va_arg, va_end, etc, abstraction. This limitation should be kept for the sake of making new ports easier.
This commit is contained in:
parent
074056499f
commit
03559bb8cc
8 changed files with 67 additions and 45 deletions
|
@ -305,6 +305,7 @@ _jit_prolog(jit_state_t *_jit)
|
|||
_jit->function->self.aoff = _jit->function->self.alen = 0;
|
||||
/* sse/x87 conversion */
|
||||
_jit->function->self.aoff = -8;
|
||||
_jit->function->self.call = jit_call_default;
|
||||
_jit->function->regoff = calloc(_jit->reglen, sizeof(jit_int32_t));
|
||||
|
||||
_jit->function->prolog = jit_new_node_no_link(jit_code_prolog);
|
||||
|
@ -320,12 +321,6 @@ _jit_prolog(jit_state_t *_jit)
|
|||
jit_regset_new(_jit->function->regset);
|
||||
}
|
||||
|
||||
void
|
||||
_jit_ellipsis(jit_state_t *_jit)
|
||||
{
|
||||
_jit->function->call.kind = jit_call_varargs;
|
||||
}
|
||||
|
||||
jit_int32_t
|
||||
_jit_allocai(jit_state_t *_jit, jit_int32_t length)
|
||||
{
|
||||
|
@ -732,7 +727,7 @@ _jit_finishr(jit_state_t *_jit, jit_int32_t r0)
|
|||
if (_jit->function->self.alen < _jit->function->call.size)
|
||||
_jit->function->self.alen = _jit->function->call.size;
|
||||
#if __WORDSIZE == 64
|
||||
if (_jit->function->call.kind & jit_call_varargs) {
|
||||
if (_jit->function->call.call & jit_call_varargs) {
|
||||
if (jit_regno(reg) == _RAX) {
|
||||
reg = jit_get_reg(jit_class_gpr);
|
||||
jit_movr(reg, _RAX);
|
||||
|
@ -750,6 +745,7 @@ _jit_finishr(jit_state_t *_jit, jit_int32_t r0)
|
|||
call->w.w = _jit->function->call.argf;
|
||||
_jit->function->call.argi = _jit->function->call.argf =
|
||||
_jit->function->call.size = 0;
|
||||
_jit->prepare = 0;
|
||||
}
|
||||
|
||||
jit_node_t *
|
||||
|
@ -764,13 +760,13 @@ _jit_finishi(jit_state_t *_jit, jit_pointer_t i0)
|
|||
if (_jit->function->self.alen < _jit->function->call.size)
|
||||
_jit->function->self.alen = _jit->function->call.size;
|
||||
#if __WORDSIZE == 64
|
||||
if (_jit->function->call.kind & jit_call_varargs)
|
||||
if (_jit->function->call.call & jit_call_varargs)
|
||||
jit_regset_setbit(_jit->regarg, _RAX);
|
||||
reg = jit_get_reg(jit_class_gpr);
|
||||
node = jit_movi(reg, (jit_word_t)i0);
|
||||
jit_finishr(reg);
|
||||
jit_unget_reg(reg);
|
||||
if (_jit->function->call.kind & jit_call_varargs)
|
||||
if (_jit->function->call.call & jit_call_varargs)
|
||||
jit_regset_clrbit(_jit->regarg, _RAX);
|
||||
#else
|
||||
node = jit_calli(i0);
|
||||
|
@ -779,6 +775,7 @@ _jit_finishi(jit_state_t *_jit, jit_pointer_t i0)
|
|||
#endif
|
||||
_jit->function->call.argi = _jit->function->call.argf =
|
||||
_jit->function->call.size = 0;
|
||||
_jit->prepare = 0;
|
||||
return (node);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue