/* Internal DynASM encoder state. */
typedef struct dasm_State dasm_State;
-/* Action list type. */
-typedef const unsigned char *dasm_ActList;
-
/* Initialize and free DynASM state. */
DASM_FDEF void dasm_init(Dst_DECL, int maxsection);
DASM_FDEF void dasm_growpc(Dst_DECL, unsigned int maxpc);
/* Setup encoder. */
-DASM_FDEF void dasm_setup(Dst_DECL, dasm_ActList actionlist);
+DASM_FDEF void dasm_setup(Dst_DECL, const void *actionlist);
/* Feed encoder with actions. Calls are generated by pre-processor. */
DASM_FDEF void dasm_put(Dst_DECL, int start, ...);
#define DASM_POS2SEC(pos) ((pos)>>24)
#define DASM_POS2PTR(D, pos) (D->sections[DASM_POS2SEC(pos)].rbuf + (pos))
+/* Action list type. */
+typedef const unsigned char *dasm_ActList;
+
/* Per-section structure. */
typedef struct dasm_Section {
int *rbuf; /* Biased buffer pointer (negative section bias). */
}
/* Setup encoder. */
-void dasm_setup(Dst_DECL, dasm_ActList actionlist)
+void dasm_setup(Dst_DECL, const void *actionlist)
{
dasm_State *D = Dst_REF;
int i;
- D->actionlist = actionlist;
+ D->actionlist = (dasm_ActList)actionlist;
D->status = DASM_S_OK;
D->section = &D->sections[0];
memset((void *)D->lglabels, 0, D->lgsize);
ctx->npc = build_backend(ctx);
/* Finalize the code. */
- (void)dasm_checkstep(Dst, DASM_SECTION_CODE);
+ (void)dasm_checkstep(Dst, -1);
if ((status = dasm_link(Dst, &ctx->codesz))) return status;
ctx->code = (uint8_t *)malloc(ctx->codesz);
if ((status = dasm_encode(Dst, (void *)ctx->code))) return status;
}
switch (ctx->mode) {
-#if LJ_TARGET_X86ORX64
case BUILD_peobj:
-#endif
case BUILD_raw:
binmode = 1;
break;
emit_asm(ctx);
emit_asm_debug(ctx);
break;
-#if LJ_TARGET_X86ORX64
case BUILD_peobj:
emit_peobj(ctx);
break;
-#endif
case BUILD_raw:
emit_raw(ctx);
break;