mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 06:41:13 +02:00
Fix some aspects of instruction mcode addresses
* libguile/jit.c (struct scm_jit_state): Remove entry_mcode member. (add_inter_instruction_patch): Fix off-by-one. (compile): Reset reloc_idx when restarting a compile. All instructions record their addresses.
This commit is contained in:
parent
c0369df5e7
commit
f8fa1156a9
1 changed files with 3 additions and 5 deletions
|
@ -177,7 +177,6 @@ struct scm_jit_state {
|
||||||
uint32_t *next_ip;
|
uint32_t *next_ip;
|
||||||
const uint32_t *end;
|
const uint32_t *end;
|
||||||
uint32_t *entry;
|
uint32_t *entry;
|
||||||
void *entry_mcode;
|
|
||||||
uint8_t *op_attrs;
|
uint8_t *op_attrs;
|
||||||
struct pending_reloc *relocs;
|
struct pending_reloc *relocs;
|
||||||
size_t reloc_idx;
|
size_t reloc_idx;
|
||||||
|
@ -1486,7 +1485,7 @@ add_inter_instruction_patch (scm_jit_state *j, jit_reloc_t reloc,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT (j->reloc_idx <= j->reloc_count);
|
ASSERT (j->reloc_idx < j->reloc_count);
|
||||||
j->relocs[j->reloc_idx].reloc = reloc;
|
j->relocs[j->reloc_idx].reloc = reloc;
|
||||||
j->relocs[j->reloc_idx].target_vcode_offset = offset;
|
j->relocs[j->reloc_idx].target_vcode_offset = offset;
|
||||||
j->reloc_idx++;
|
j->reloc_idx++;
|
||||||
|
@ -4702,6 +4701,7 @@ compile (scm_jit_state *j)
|
||||||
{
|
{
|
||||||
analyze (j);
|
analyze (j);
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
@ -4709,16 +4709,14 @@ compile (scm_jit_state *j)
|
||||||
{
|
{
|
||||||
ptrdiff_t offset = j->ip - j->start;
|
ptrdiff_t offset = j->ip - j->start;
|
||||||
uint8_t attrs = j->op_attrs[offset];
|
uint8_t attrs = j->op_attrs[offset];
|
||||||
|
j->labels[offset] = jit_address (j->jit);
|
||||||
if (attrs & OP_ATTR_BLOCK)
|
if (attrs & OP_ATTR_BLOCK)
|
||||||
{
|
{
|
||||||
uint32_t state = SP_IN_REGISTER;
|
uint32_t state = SP_IN_REGISTER;
|
||||||
if (attrs & OP_ATTR_ENTRY)
|
if (attrs & OP_ATTR_ENTRY)
|
||||||
state |= FP_IN_REGISTER;
|
state |= FP_IN_REGISTER;
|
||||||
j->register_state = state;
|
j->register_state = state;
|
||||||
j->labels[offset] = jit_address (j->jit);
|
|
||||||
}
|
}
|
||||||
if (j->ip == j->entry)
|
|
||||||
j->entry_mcode = jit_address (j->jit);
|
|
||||||
compile1 (j);
|
compile1 (j);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue