From 9adf01a91e00831737a024480d817e2658df8db0 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Mon, 1 Sep 2014 12:53:14 +0000 Subject: [PATCH] bug fixes in the JIT compiler --- src/runtime/c/pgf/jit.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/runtime/c/pgf/jit.c b/src/runtime/c/pgf/jit.c index 20ddd9f68..646115c4e 100644 --- a/src/runtime/c/pgf/jit.c +++ b/src/runtime/c/pgf/jit.c @@ -358,8 +358,9 @@ pgf_jit_function(PgfReader* rdr, PgfAbstr* abstr, } #ifdef PGF_JIT_DEBUG - gu_printf(out, err, "%04d ", curr_label++); + gu_printf(out, err, "%04d ", curr_label); #endif + curr_label++; uint8_t opcode = pgf_read_tag(rdr); switch (opcode) { @@ -374,7 +375,7 @@ pgf_jit_function(PgfReader* rdr, PgfAbstr* abstr, jit_prepare(1); jit_pusharg_p(JIT_V0); 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_pusharg_p(JIT_V0); jit_getarg_p(JIT_V2, es_arg); @@ -523,6 +524,7 @@ pgf_jit_function(PgfReader* rdr, PgfAbstr* abstr, jit_finish(gu_buf_last); jit_ldxi_p(JIT_V0, JIT_RET, -index*sizeof(PgfClosure*)); jit_stxi_p(curr_offset*sizeof(void*), JIT_V1, JIT_V0); + curr_offset++; break; } case PGF_INSTR_TAIL_CALL: {