mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-18 09:40:25 +02:00
JIT fixes for arena overflow
* libguile/jit.c (compute_mcode): Move analysis outside the code emitter, as it doesn't need to re-run on overflow. (compile): Clear labels before emitting, as they may have changed if we overflowed.
This commit is contained in:
parent
9ff21412ff
commit
891e7600f4
1 changed files with 8 additions and 2 deletions
|
@ -4687,9 +4687,10 @@ analyze (scm_jit_state *j)
|
||||||
static void
|
static void
|
||||||
compile (scm_jit_state *j)
|
compile (scm_jit_state *j)
|
||||||
{
|
{
|
||||||
analyze (j);
|
for (ptrdiff_t offset = 0; j->ip + offset < j->end; offset++)
|
||||||
|
j->labels[offset] = NULL;
|
||||||
j->reloc_idx = 0;
|
j->reloc_idx = 0;
|
||||||
|
|
||||||
j->ip = (uint32_t *) j->start;
|
j->ip = (uint32_t *) j->start;
|
||||||
set_register_state (j, SP_IN_REGISTER | FP_IN_REGISTER);
|
set_register_state (j, SP_IN_REGISTER | FP_IN_REGISTER);
|
||||||
|
|
||||||
|
@ -4706,6 +4707,9 @@ compile (scm_jit_state *j)
|
||||||
j->register_state = state;
|
j->register_state = state;
|
||||||
}
|
}
|
||||||
compile1 (j);
|
compile1 (j);
|
||||||
|
|
||||||
|
if (jit_has_overflow (j->jit))
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < j->reloc_idx; i++)
|
for (size_t i = 0; i < j->reloc_idx; i++)
|
||||||
|
@ -4811,6 +4815,8 @@ compute_mcode (scm_thread *thread, uint32_t *entry_ip,
|
||||||
INFO ("vcode: start=%p,+%zu entry=+%zu\n", j->start, j->end - j->start,
|
INFO ("vcode: start=%p,+%zu entry=+%zu\n", j->start, j->end - j->start,
|
||||||
j->entry - j->start);
|
j->entry - j->start);
|
||||||
|
|
||||||
|
analyze (j);
|
||||||
|
|
||||||
data->mcode = emit_code (j, compile);
|
data->mcode = emit_code (j, compile);
|
||||||
if (data->mcode)
|
if (data->mcode)
|
||||||
entry_mcode = j->labels[j->entry - j->start];
|
entry_mcode = j->labels[j->entry - j->start];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue