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

@ -195,6 +195,7 @@ static void
disasm_print_address(bfd_vma addr, struct disassemble_info *info)
{
char *name;
char *file;
int line;
char buffer[address_buffer_length];
@ -205,12 +206,11 @@ disasm_print_address(bfd_vma addr, struct disassemble_info *info)
# define jit_pointer_p(u) \
((u) >= _jit->code.ptr && (u) < _jit->pc.uc)
if (jit_pointer_p((jit_uint8_t *)(jit_word_t)addr)) {
if (jit_get_note((jit_uint8_t *)(jit_word_t)addr, &name, &line)) {
if (line)
(*info->fprintf_func)(info->stream, " %s:%d", name, line);
else
(*info->fprintf_func)(info->stream, " %s", name);
}
if (jit_get_note((jit_uint8_t *)(jit_word_t)addr, &name, &file, &line))
(*info->fprintf_func)(info->stream, " %s:%s:%d",
name ? name : "",
file ? file : "",
line);
}
# undef jit_pointer_p
# undef _jit
@ -259,6 +259,7 @@ _disassemble(jit_state_t *_jit, jit_pointer_t code, jit_int32_t length)
{
int bytes;
char *name, *old_name;
char *file, *old_file;
int line, old_line;
#if __arm__
jit_int32_t offset;
@ -276,7 +277,7 @@ _disassemble(jit_state_t *_jit, jit_pointer_t code, jit_int32_t length)
disasm_info.buffer = code;
disasm_info.buffer_vma = (jit_uword_t)code;
disasm_info.buffer_length = length;
old_name = NULL;
old_file = old_name = NULL;
old_line = 0;
disasm_jit = _jit;
while (pc < end) {
@ -310,15 +311,14 @@ _disassemble(jit_state_t *_jit, jit_pointer_t code, jit_int32_t length)
}
}
#endif
if (jit_get_note((jit_uint8_t *)(jit_word_t)pc, &name, &line) &&
(name != old_name || line != old_line)) {
if (line)
(*disasm_info.fprintf_func)(disasm_stream, "# %s:%d\n",
name, line);
else
(*disasm_info.fprintf_func)(disasm_stream, "# %s\n",
name);
if (jit_get_note((jit_uint8_t *)(jit_word_t)pc, &name, &file, &line) &&
(name != old_name || file != old_file || line != old_line)) {
(*disasm_info.fprintf_func)(disasm_stream, "# %s:%s:%d\n",
name ? name : "",
file ? file : "",
line);
old_name = name;
old_file = file;
old_line = line;
}