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

Change type of return of jit_arg* and argument to jit_getarg*

* check/lightning.c, include/lightning.h, lib/jit_arm.c,
	lib/jit_mips.c, lib/jit_ppc.c, lib/jit_print.c,	lib/jit_x86.c,
	lib/lightning.c: Change return value of jit_arg{,_f,_d} to
	a jit_node_t* object, that should be used as argument to
	jit_getarg_{c,uc,s,us,i,ui,l,f,d}. This just requires changing
	from jit_int32_t to jit_pointer_t (or jit_node_t*) the "handle"
	for the getarg calls, with the benefit that it makes it easy
	to implement patching of the stack address of non register
	arguments, this way allowing to implement variable size stack
	frames if applicable; useful if there are too many registers and
	jit functions uses only a few callee save registers.
This commit is contained in:
pcpa 2012-12-28 10:35:14 -02:00
parent 1287a2d448
commit 2e6c680d70
9 changed files with 304 additions and 256 deletions

View file

@ -239,8 +239,8 @@ static symbol_t *get_symbol(void);
static void jmp_forward(void *value, label_t *label);
static void mov_forward(void *value, label_t *label);
static void call_forward(void *value, label_t *label);
static void make_arg(long value);
static long get_arg(void);
static void make_arg(void *value);
static jit_pointer_t get_arg(void);
static long get_imm(void);
static void prolog(void); static void ellipsis(void);
static void allocai(void);
@ -812,23 +812,23 @@ call_forward(void *value, label_t *label)
}
static void
make_arg(long value)
make_arg(void *value)
{
symbol_t *symbol = get_symbol();
symbol->type = type_l;
symbol->value.i = value;
symbol->type = type_p;
symbol->value.p = value;
}
static long
static jit_pointer_t
get_arg(void)
{
symbol_t *symbol = get_symbol();
if (symbol->type != type_l)
if (symbol->type != type_p)
error("bad argument %s type", symbol->name);
return symbol->value.i;
return symbol->value.p;
}
static long
@ -885,8 +885,8 @@ name(void) \
static void \
name(void) \
{ \
jit_gpr_t r0 = get_ireg(); \
jit_int32_t ac = get_arg(); \
jit_gpr_t r0 = get_ireg(); \
jit_pointer_t ac = get_arg(); \
jit_##name(r0, ac); \
}
#define entry_im(name) \
@ -1010,8 +1010,8 @@ name(void) \
static void \
name(void) \
{ \
jit_fpr_t r0 = get_freg(); \
jit_int32_t ac = get_arg(); \
jit_fpr_t r0 = get_freg(); \
jit_pointer_t ac = get_arg(); \
jit_##name(r0, ac); \
}
#define entry_fr_fr_fr(name) \