pass direct u32 to bc_repr

This commit is contained in:
dzaima 2022-01-10 20:25:33 +02:00
parent af70ffa6c8
commit 3a510f99e5
3 changed files with 5 additions and 5 deletions

View File

@ -673,7 +673,7 @@ Nvm_res m_nvm(Body* body) {
case RETD: if (lGPos!=0) GS_SET(r_CS); MOV(R_A0,r_SC); CCALL(i_RETD); ret=true; break; // (Scope* sc)
case RETN: if (lGPos!=0) GS_SET(r_CS); ret=true; break;
case FAIL: TOPs; IMM(R_A0,off); MOV(R_A1,r_SC); INV(2,0,i_FAIL); ret=true; break;
default: print_fmt("JIT: Unsupported bytecode %i/%S", *s, bc_repr(s)); err("");
default: print_fmt("JIT: Unsupported bytecode %i/%S", *s, bc_repr(*s)); err("");
}
#undef GET
#undef GS_SET

View File

@ -22,15 +22,15 @@ i32 sD_m[BC_SIZE];
i32 sC_m[BC_SIZE];
i32 sA_m[BC_SIZE];
char* bc_repr(u32* p) {
switch(*p) { default: return "(unknown)";
char* bc_repr(u32 p) {
switch(p) { default: return "(unknown)";
#define F(X) case X: return #X;
FOR_BC(F)
#undef F
}
}
void print_BC(u32* p, i32 w) {
char* str = bc_repr(p);
char* str = bc_repr(*p);
printf("%s", str);
u32* n = nextBC(p);
p++;

View File

@ -185,7 +185,7 @@ static i32 stackAdded (u32* p) { return sA_m[*p]; }
static i32 stackDiff (u32* p) { if (*p==ARRO|*p==ARRM) return 1-p[1]; return sD_m[*p]; }
static i32 stackConsumed(u32* p) { if (*p==ARRO|*p==ARRM) return p[1]; return sC_m[*p]; }
char* bc_repr(u32* p);
char* bc_repr(u32 p);
typedef struct FunBlock { struct Fun; Scope* sc; Block* bl; } FunBlock;