summaryrefslogtreecommitdiff
path: root/src/buildvm_x64win.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildvm_x64win.h')
-rw-r--r--src/buildvm_x64win.h65
1 files changed, 24 insertions, 41 deletions
diff --git a/src/buildvm_x64win.h b/src/buildvm_x64win.h
index 7876c9b3..b5cc4679 100644
--- a/src/buildvm_x64win.h
+++ b/src/buildvm_x64win.h
@@ -2404,50 +2404,33 @@ static void emit_asm_debug(BuildCtx *ctx)
2404 "\t.align " BSZPTR "\n" 2404 "\t.align " BSZPTR "\n"
2405 "LECIEX:\n\n"); 2405 "LECIEX:\n\n");
2406 for (i = 0; i < ctx->nsym; i++) { 2406 for (i = 0; i < ctx->nsym; i++) {
2407 int pi = ctx->perm[i]; 2407 const char *name = ctx->sym[i].name;
2408 int ni = ctx->perm[i+1]; 2408 int32_t size = ctx->sym[i+1].ofs - ctx->sym[i].ofs;
2409 int size = ctx->sym_ofs[ni] - ctx->sym_ofs[pi]; 2409 fprintf(ctx->fp,
2410 if (ctx->sym_ofs[pi] >= 0 && size > 0) { 2410 "%s.eh:\n"
2411 char name[80]; 2411 "LSFDE%d:\n"
2412 if (pi >= ctx->npc) { 2412 "\t.set L$set$%d,LEFDE%d-LASFDE%d\n"
2413 char *p; 2413 "\t.long L$set$%d\n"
2414 sprintf(name, "_" LABEL_PREFIX "%s", ctx->globnames[pi - ctx->npc]); 2414 "LASFDE%d:\n"
2415 p = strchr(name, '@'); if (p) *p = '\0'; 2415 "\t.long LASFDE%d-EH_frame1\n"
2416#if LJ_HASJIT 2416 "\t.long %s-.\n"
2417 } else { 2417 "\t.long %d\n"
2418#else 2418 "\t.byte 0\n" /* augmentation length */
2419 } else if (!(pi == BC_JFORI || pi == BC_JFORL || pi == BC_JITERL || 2419 "\t.byte 0xe\n\t.byte %d\n" /* def_cfa_offset */
2420 pi == BC_JLOOP || pi == BC_IFORL || pi == BC_IITERL ||
2421 pi == BC_ILOOP)) {
2422#endif
2423 sprintf(name, "_" LABEL_PREFIX_BC "%s", bc_names[pi]);
2424 }
2425 fprintf(ctx->fp,
2426 "%s.eh:\n"
2427 "LSFDE%d:\n"
2428 "\t.set L$set$%d,LEFDE%d-LASFDE%d\n"
2429 "\t.long L$set$%d\n"
2430 "LASFDE%d:\n"
2431 "\t.long LASFDE%d-EH_frame1\n"
2432 "\t.long %s-.\n"
2433 "\t.long %d\n"
2434 "\t.byte 0\n" /* augmentation length */
2435 "\t.byte 0xe\n\t.byte %d\n" /* def_cfa_offset */
2436#if LJ_64 2420#if LJ_64
2437 "\t.byte 0x86\n\t.byte 0x2\n" /* offset rbp */ 2421 "\t.byte 0x86\n\t.byte 0x2\n" /* offset rbp */
2438 "\t.byte 0x83\n\t.byte 0x3\n" /* offset rbx */ 2422 "\t.byte 0x83\n\t.byte 0x3\n" /* offset rbx */
2439 "\t.byte 0x8f\n\t.byte 0x4\n" /* offset r15 */ 2423 "\t.byte 0x8f\n\t.byte 0x4\n" /* offset r15 */
2440 "\t.byte 0x8e\n\t.byte 0x5\n" /* offset r14 */ 2424 "\t.byte 0x8e\n\t.byte 0x5\n" /* offset r14 */
2441#else 2425#else
2442 "\t.byte 0x84\n\t.byte 0x2\n" /* offset ebp (4 for MACH-O)*/ 2426 "\t.byte 0x84\n\t.byte 0x2\n" /* offset ebp (4 for MACH-O)*/
2443 "\t.byte 0x87\n\t.byte 0x3\n" /* offset edi */ 2427 "\t.byte 0x87\n\t.byte 0x3\n" /* offset edi */
2444 "\t.byte 0x86\n\t.byte 0x4\n" /* offset esi */ 2428 "\t.byte 0x86\n\t.byte 0x4\n" /* offset esi */
2445 "\t.byte 0x83\n\t.byte 0x5\n" /* offset ebx */ 2429 "\t.byte 0x83\n\t.byte 0x5\n" /* offset ebx */
2446#endif 2430#endif
2447 "\t.align " BSZPTR "\n" 2431 "\t.align " BSZPTR "\n"
2448 "LEFDE%d:\n\n", 2432 "LEFDE%d:\n\n",
2449 name, i, i, i, i, i, i, i, name, size, CFRAME_SIZE, i); 2433 name, i, i, i, i, i, i, i, name, size, CFRAME_SIZE, i);
2450 }
2451 } 2434 }
2452#if LJ_64 2435#if LJ_64
2453 fprintf(ctx->fp, "\t.subsections_via_symbols\n"); 2436 fprintf(ctx->fp, "\t.subsections_via_symbols\n");