1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-02 04:40:29 +02:00
Commit graph

6 commits

Author SHA1 Message Date
pcpa
9afca85921 Rework to better describe what is used only during jit generation.
* include/lightning/jit_private.h, lib/jit_arm-cpu.c,
	lib/jit_arm.c, lib/jit_disasm.c, lib/jit_mips-cpu.c,
	lib/jit_mips.c, lib/jit_note.c, lib/jit_ppc-cpu.c,
	lib/jit_ppc.c, lib/jit_print.c, lib/jit_sparc-cpu.c,
	lib/jit_sparc.c, lib/jit_x86-cpu.c, lib/jit_x86.c,
	lib/lightning.c: Add an extra structure for data storage
	during jit generation, and release it after generating
	jit, to reduce a bit memory usage, and also to make it
	easier to understand what data is available during
	jit runtime.
2013-03-06 16:49:26 -03:00
pcpa
8f020fe044 Add code to release all memory used by the jit state.
* include/lightning.h, lib/lightning.c: Implement the new
	jit_clear_state and jit_destroy_state calls. jit_clear_state
	releases all memory not required during jit_execution; that
	is, leaves only the mmap'ed data and code buffers allocated.
	jit_destroy_state releases the mmap'ed buffers as well as
	the jit_state_t object itself, that holds pointers to the
	code and data buffers, as well as annotation pointers (for
	disassembly or backtrace) in the data buffer.

	* lib/jit_note.c: Correct invalid vector offset access.

	* check/ccall.c, check/lightning.c, doc/ifib.c, doc/incr.c,
	doc/printf.c, doc/rfib.c, doc/rpn.c: Use the new jit_clear_state
	and jit_destroy_state calls, to demonstrate the new code to
	release all jit memory.

	* doc/body.texi: Add basic documentation and usage description
	of jit_clear_state and jit_destroy_state.
2013-02-11 15:51:55 -02:00
pcpa
6039794ec3 Store all annotation information in the read only data buffer.
* include/lightning/jit_private.h, lib/jit_note.c, lib/lightning.c:
	  Store all annotation information in the mmap'ed area reserved for
	read only data. This adds code to not allocate memory for jit_note_t
	objects, and to	relocate jit_line_t objects and its contents after
	calculating annotation information. The jit_line_t objects are
	relocated because it is not possible to always calculate before
	hand data layout because note information may be extended or
	redundant entries removed, as well as allowed to be added in
	non sequential order.
	  A bug was also corrected in _jit_set_note, that was causing it
	to allocate new jit_line_t objects when not needed. It was still
	working correctly, but allocating way more memory than required.
2013-02-11 15:50:59 -02:00
pcpa
2da31e82fa Correct reference to dangling pointer and better note bounds checking
lib/jit_note.c: Correct bounds check and wrong code keeping
	a pointer that could be changed after a realloc call.
2013-01-18 18:26:14 -02:00
pcpa
9e86ef12cf 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).
2013-01-18 18:05:57 -02:00
pcpa
a34410eee2 Add filename and line number annotation abstraction.
* lib/jit_note.c: New file implementing a simple string+integer
	annotation, that should be used to map filename and line number
	to offsets in the generated jit.

	* include/lightning.h, lib/lightning.c: Update for the new
	note code.
	  Add an extra mandatory argument to init_jit, that is used
	as argument to bfd_openr.
	  Change from generic void* to char* the argument to jit_note
	and add an extra integer argument, to map to filename and
	line number.

	* check/ccall.c, check/lightning.c, include/lightning/jit_private.h,
	lib/jit_arm.c, lib/jit_disasm.c, lib/jit_mips.c, lib/jit_ppc.c,
	lib/jit_print.c, lib/jit_x86.c: lib/Makefile.am: Update for the
	new annotation code.

	* configure.ac, check/Makefile.am: Update to work with latest
	automake.
2013-01-11 15:29:35 -02:00