mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-21 00:52:51 -06:00
bug fixes in the JIT compiler
This commit is contained in:
@@ -358,8 +358,9 @@ pgf_jit_function(PgfReader* rdr, PgfAbstr* abstr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PGF_JIT_DEBUG
|
#ifdef PGF_JIT_DEBUG
|
||||||
gu_printf(out, err, "%04d ", curr_label++);
|
gu_printf(out, err, "%04d ", curr_label);
|
||||||
#endif
|
#endif
|
||||||
|
curr_label++;
|
||||||
|
|
||||||
uint8_t opcode = pgf_read_tag(rdr);
|
uint8_t opcode = pgf_read_tag(rdr);
|
||||||
switch (opcode) {
|
switch (opcode) {
|
||||||
@@ -374,7 +375,7 @@ pgf_jit_function(PgfReader* rdr, PgfAbstr* abstr,
|
|||||||
jit_prepare(1);
|
jit_prepare(1);
|
||||||
jit_pusharg_p(JIT_V0);
|
jit_pusharg_p(JIT_V0);
|
||||||
jit_finish(gu_buf_last);
|
jit_finish(gu_buf_last);
|
||||||
jit_ldxr_p(JIT_V0, JIT_RET, -index*sizeof(PgfClosure*));
|
jit_ldxi_p(JIT_V0, JIT_RET, -index*sizeof(PgfClosure*));
|
||||||
jit_prepare(2);
|
jit_prepare(2);
|
||||||
jit_pusharg_p(JIT_V0);
|
jit_pusharg_p(JIT_V0);
|
||||||
jit_getarg_p(JIT_V2, es_arg);
|
jit_getarg_p(JIT_V2, es_arg);
|
||||||
@@ -523,6 +524,7 @@ pgf_jit_function(PgfReader* rdr, PgfAbstr* abstr,
|
|||||||
jit_finish(gu_buf_last);
|
jit_finish(gu_buf_last);
|
||||||
jit_ldxi_p(JIT_V0, JIT_RET, -index*sizeof(PgfClosure*));
|
jit_ldxi_p(JIT_V0, JIT_RET, -index*sizeof(PgfClosure*));
|
||||||
jit_stxi_p(curr_offset*sizeof(void*), JIT_V1, JIT_V0);
|
jit_stxi_p(curr_offset*sizeof(void*), JIT_V1, JIT_V0);
|
||||||
|
curr_offset++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PGF_INSTR_TAIL_CALL: {
|
case PGF_INSTR_TAIL_CALL: {
|
||||||
|
|||||||
Reference in New Issue
Block a user