mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-05 06:50: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:
parent
c39def9dce
commit
51c96f9e19
9 changed files with 49 additions and 10 deletions
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include <lightning.h>
|
||||
#include <lightning/jit_private.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
/*
|
||||
* Prototypes
|
||||
|
@ -83,6 +84,29 @@ jit_free(jit_pointer_t *ptr)
|
|||
*ptr = NULL;
|
||||
}
|
||||
|
||||
#if HAVE_MREMAP
|
||||
jit_bool_t
|
||||
_jit_remap(jit_state_t *_jit)
|
||||
{
|
||||
jit_uint8_t *code;
|
||||
jit_word_t length;
|
||||
|
||||
length = _jitc->pool.length * 1024 * (_jitc->mult + 1);
|
||||
|
||||
code = mremap(_jit->code.ptr, _jit->code.length, length, 0, NULL);
|
||||
if (code != MAP_FAILED) {
|
||||
assert(code == _jit->code.ptr);
|
||||
++_jitc->mult;
|
||||
_jit->code.length = length;
|
||||
_jitc->code.end = _jit->code.ptr + _jit->code.length - 64;
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void *
|
||||
jit_default_alloc_func(size_t size)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue