From da5280021cb2157de756169a8a981dab583781ee Mon Sep 17 00:00:00 2001 From: dzaima Date: Sat, 27 May 2023 15:38:57 +0300 Subject: [PATCH] =?UTF-8?q?rename=20compile=20=E2=86=92=20compileAll?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/load.c | 10 +++++----- src/vm.c | 2 +- src/vm.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/load.c b/src/load.c index 18feca9d..101edbe7 100644 --- a/src/load.c +++ b/src/load.c @@ -109,8 +109,8 @@ Block* load_compObj(B x, B src, B path, Scope* sc) { // consumes x,src SGet(x) usz xia = IA(x); if (xia!=6 & xia!=4) thrM("load_compObj: bad item count"); - Block* r = xia==6? compile(Get(x,0),Get(x,1),Get(x,2),Get(x,3),Get(x,4),Get(x,5), src, inc(path), sc) - : compile(Get(x,0),Get(x,1),Get(x,2),Get(x,3),bi_N, bi_N, src, inc(path), sc); + Block* r = xia==6? compileAll(Get(x,0),Get(x,1),Get(x,2),Get(x,3),Get(x,4),Get(x,5), src, inc(path), sc) + : compileAll(Get(x,0),Get(x,1),Get(x,2),Get(x,3),bi_N, bi_N, src, inc(path), sc); decG(x); return r; } @@ -121,11 +121,11 @@ Block* load_compObj(B x, B src, B path, Scope* sc) { // consumes x,src #if RT_SRC Block* load_compImport(char* name, B bc, B objs, B blocks, B bodies, B inds, B src) { // consumes all - return compile(bc, objs, blocks, bodies, inds, bi_N, src, m_c8vec_0(name), NULL); + return compileAll(bc, objs, blocks, bodies, inds, bi_N, src, m_c8vec_0(name), NULL); } #else Block* load_compImport(char* name, B bc, B objs, B blocks, B bodies) { // consumes all - return compile(bc, objs, blocks, bodies, bi_N, bi_N, bi_N, m_c8vec_0(name), NULL); + return compileAll(bc, objs, blocks, bodies, bi_N, bi_N, bi_N, m_c8vec_0(name), NULL); } #endif @@ -510,7 +510,7 @@ void load_init() { // very last init function #ifdef PRECOMP - Block* c = compile( + Block* c = compileAll( #include "../build/interp" , bi_N, bi_N, bi_N, bi_N, NULL ); diff --git a/src/vm.c b/src/vm.c index be3bab36..fe00e57a 100644 --- a/src/vm.c +++ b/src/vm.c @@ -444,7 +444,7 @@ Block* compileBlock(B block, Comp* comp, bool* bDone, u32* bc, usz bcIA, B allBl // consumes all; assumes arguments are valid (verifies some stuff, but definitely not everything) // if sc isn't NULL, this block must only be evaluated directly in that scope precisely once -NOINLINE Block* compile(B bcq, B objs, B allBlocks, B allBodies, B indices, B tokenInfo, B src, B path, Scope* sc) { +NOINLINE Block* compileAll(B bcq, B objs, B allBlocks, B allBodies, B indices, B tokenInfo, B src, B path, Scope* sc) { usz bIA = IA(allBlocks); I32Arr* bca = toI32Arr(bcq); u32* bc = (u32*)bca->a; diff --git a/src/vm.h b/src/vm.h index 90af486a..18046451 100644 --- a/src/vm.h +++ b/src/vm.h @@ -154,7 +154,7 @@ struct Scope { Block* bqn_comp(B str, B path, B args); // consumes all Block* bqn_compSc(B str, B path, B args, Scope* sc, bool repl); // consumes str,path,args -Block* compile(B bcq, B objs, B blocks, B bodies, B indices, B tokenInfo, B src, B path, Scope* sc); +Block* compileAll(B bcq, B objs, B blocks, B bodies, B indices, B tokenInfo, B src, B path, Scope* sc); Scope* m_scope(Body* body, Scope* psc, u16 varAm, i32 initVarAm, B* initVars); Body* m_body(i32 vam, i32 pos, u32 maxStack, u16 maxPSC); // leaves varData uninitialized void init_comp(B* set, B prim, B sys); // doesn't consume; writes into first 3 elements of set