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

Do not start over jit generation if can safely grow buffer size.

* include/lightning/jit_private.h, lib/jit_arm.c, lib/jit_memory.c,
	lib/jit_mips.c, lib/jit_ppc.c, lib/jit_sparc.c, lib/jit_x86.c,
	lib/lightning.c: Do not start over jit generation if can grow
	the code buffer with mremap without moving the base pointer.
This commit is contained in:
pcpa 2013-03-29 12:53:40 -03:00
parent c39def9dce
commit 51c96f9e19
9 changed files with 49 additions and 10 deletions

View file

@ -1455,7 +1455,6 @@ _jit_emit(jit_state_t *_jit)
{
jit_pointer_t code;
jit_node_t *node;
jit_int32_t mult;
size_t length;
int result;
@ -1464,11 +1463,11 @@ _jit_emit(jit_state_t *_jit)
jit_optimize();
/* Heuristic to guess code buffer size */
mult = 4;
_jitc->mult = 4;
_jitc->emit = 1;
_jit->code.length = _jitc->pool.length * 1024 * mult;
_jit->code.length = _jitc->pool.length * 1024 * _jitc->mult;
_jit->code.ptr = mmap(NULL, _jit->code.length,
PROT_EXEC | PROT_READ | PROT_WRITE,
@ -1485,8 +1484,8 @@ _jit_emit(jit_state_t *_jit)
node->code == jit_code_epilog))
node->flag &= ~jit_flag_patch;
}
++mult;
length = _jitc->pool.length * 1024 * mult;
++_jitc->mult;
length = _jitc->pool.length * 1024 * _jitc->mult;
#if !HAVE_MREMAP
munmap(_jit->code.ptr, _jit->code.length);