1
0
forked from GitHub/gf-core

a major revision of the bytecode generator and JIT compiler. the effect is that now we can compute with lambda functions and with true tail recursion

This commit is contained in:
kr.angelov
2014-09-11 15:39:39 +00:00
parent 18ee232497
commit 621d748bac
10 changed files with 433 additions and 276 deletions

View File

@@ -268,6 +268,17 @@ pgf_evaluate_save_variables(PgfEvalState* state, PgfValue* val)
}
}
void
pgf_evaluate_slide(PgfEvalState* state, size_t a, size_t b)
{
size_t len = gu_buf_length(state->stack);
for (size_t i = 0; i < b-a; i++) {
PgfClosure* c = gu_buf_get(state->stack, PgfClosure*, len-(b-a)+i);
gu_buf_set(state->stack, PgfClosure*, len-b+i, c);
}
gu_buf_trim_n(state->stack, a);
}
static PgfExpr
pgf_value2expr(PgfEvalState* state, int level, PgfClosure* clos, GuPool* pool)
{