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

Add the new jit_name call to mark function boundaries

* check/3to2.tst, check/add.tst, check/allocai.tst, check/bp.tst,
	check/call.tst, check/ccall.c, check/clobber.tst, check/divi.tst,
	check/fib.tst, check/ldsti.tst, check/ldstr-c.tst, check/ldstr.tst,
	check/ldstxi-c.tst, check/ldstxi.tst, check/ldstxr-c.tst,
	check/ldstxr.tst, check/lightning.c, check/rpn.tst, check/stack.tst,
	check/varargs.tst, include/lightning.h,
	include/lightning/jit_private.h, lib/jit_arm.c, lib/jit_disasm.c,
	lib/jit_mips.c, lib/jit_note.c, lib/jit_ppc.c, lib/jit_print.c,
	lib/jit_x86.c, lib/lightning.c:	Extend the "jit_note" abstraction
	with the new "jit_name" call, that receives a string argument, and
	should usually be called to mark boundaries of functions of code
	generating jit (that is, it is not expected that the language
	generating jit map its functions to jit functions).
This commit is contained in:
pcpa 2013-01-18 18:05:57 -02:00
parent c5421a8c76
commit 9e86ef12cf
31 changed files with 339 additions and 203 deletions

View file

@ -321,7 +321,8 @@ jit_pointer_t
_jit_address(jit_state_t *_jit, jit_node_t *node)
{
assert(_jit->done);
assert(node && node->code == jit_code_note);
assert(node &&
(node->code == jit_code_note || node->code == jit_code_name));
return ((jit_pointer_t)node->u.w);
}
@ -415,29 +416,6 @@ _jit_data(jit_state_t *_jit, jit_pointer_t data,
return (node);
}
jit_node_t *
_jit_note(jit_state_t *_jit, char *name, int line)
{
jit_node_t *node;
node = new_node(jit_code_note);
if (name)
node->v.n = jit_data(name, strlen(name) + 1, 1);
else
node->v.p = NULL;
node->w.w = line;
(void)link_node(node);
if (_jit->note.head == NULL)
_jit->note.head = _jit->note.tail = node;
else {
_jit->note.tail->link = node;
_jit->note.tail = node;
}
return (node);
}
static void
_new_pool(jit_state_t *_jit)
{
@ -812,8 +790,8 @@ _jit_classify(jit_state_t *_jit, jit_code_t code)
switch (code) {
case jit_code_data: case jit_code_save: case jit_code_load:
case jit_code_label: case jit_code_note: case jit_code_prolog:
case jit_code_epilog:
case jit_code_name: case jit_code_label: case jit_code_note:
case jit_code_prolog: case jit_code_epilog:
mask = 0;
break;
case jit_code_arg: case jit_code_arg_f: case jit_code_arg_d:
@ -1165,18 +1143,6 @@ _jit_optimize(jit_state_t *_jit)
}
}
void
_jit_annotate(jit_state_t *_jit)
{
jit_node_t *node;
for (node = _jit->note.head; node; node = node->link) {
if (node->v.p)
jit_set_note(node->v.n->u.p, node->w.w,
(jit_uint8_t *)node->u.p - _jit->code.ptr);
}
}
void
_jit_reglive(jit_state_t *_jit, jit_node_t *node)
{