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

Update code to build and pass test cases in the arm port.

* configure.ac, include/lightning/jit_private.h, lib/jit_arm-cpu.c,
	lib/jit_arm-swf.c, lib/jit_arm.c, check/Makefile.am: Correct
	implementation of the arm backend port to build and pass the
	current test cases. Tested on armv7 with softfp abi.

	* lib/jit_disasm.c: Rename and change prototype of static
	disassemble function as in the arm backend it is required
	to access state information stored in the jit_state_t object.

	* check/3to2.tst, check/add.tst: Correct test case code assuming
	JIT_RO and JIT_RET are the same, and even if they are the same,
	the logic was incorrect because it must always call jit_retval*
	to fetch a function call return before any other instruction.
	The arm backend hash a special condition if jit_retval is not
	called, because "r0" is not JIT_R0, but is JIT_RET and *also*
	the first argument for a called function, so JIT_RET must be
	only used as an argument to jit_retval.

	* TODO: New file listing important tasks to be resolved.
This commit is contained in:
pcpa 2012-12-03 14:27:27 -02:00
parent 712877a5a4
commit 1c9088beca
11 changed files with 119 additions and 52 deletions

View file

@ -29,8 +29,9 @@ disasm_compare_symbols(const void *ap, const void *bp);
static void
disasm_print_address(bfd_vma addr, struct disassemble_info *info);
#define disassemble(u, v) _disassemble(_jit, u, v)
static void
disassemble(jit_pointer_t code, jit_int32_t length);
_disassemble(jit_state_t *_jit, jit_pointer_t code, jit_int32_t length);
#endif
/*
@ -238,19 +239,20 @@ disasm_print_address(bfd_vma addr, struct disassemble_info *info)
}
static void
disassemble(jit_pointer_t code, jit_int32_t length)
_disassemble(jit_state_t *_jit, jit_pointer_t code, jit_int32_t length)
{
int bytes;
int bytes;
#if __arm__
jit_data_info_t *data_info;
jit_int32_t data_offset;
jit_int32_t offset;
jit_bool_t data_info;
jit_int32_t data_offset;
#endif
bfd_vma pc = (jit_uword_t)code;
bfd_vma end = (jit_uword_t)code + length;
char buffer[address_buffer_length];
bfd_vma pc = (jit_uword_t)code;
bfd_vma end = (jit_uword_t)code + length;
char buffer[address_buffer_length];
#if __arm__
data_info = _jit->data_info;
data_info = 1;
data_offset = 0;
#endif
disasm_info.buffer = code;
@ -260,16 +262,16 @@ disassemble(jit_pointer_t code, jit_int32_t length)
#if __arm__
again:
if (data_info) {
while (data_info.ptr[data_offset].code < pc) {
while (_jit->data_info.ptr[data_offset].code < pc) {
data_offset += 2;
if (data_offset >= data_info.length) {
data_info = NULL;
if (data_offset >= _jit->data_info.length) {
data_info = 0;
goto again;
}
}
if (pc == data_info.ptr[data_offset].code) {
line = data_info.ptr[data_offset].length;
for (; line >= 4; line -= 4, pc += 4) {
if (pc == _jit->data_info.ptr[data_offset].code) {
offset = _jit->data_info.ptr[data_offset].length;
for (; offset >= 4; offset -= 4, pc += 4) {
bytes = sprintf(buffer, address_buffer_format, pc);
(*disasm_info.fprintf_func)(disasm_stream,
"%*c0x%s\t.data\t0x%08x\n",