summaryrefslogtreecommitdiff
path: root/src/buildvm_x86.dasc
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildvm_x86.dasc')
-rw-r--r--src/buildvm_x86.dasc65
1 files changed, 24 insertions, 41 deletions
diff --git a/src/buildvm_x86.dasc b/src/buildvm_x86.dasc
index e0a70daa..579e39da 100644
--- a/src/buildvm_x86.dasc
+++ b/src/buildvm_x86.dasc
@@ -5133,50 +5133,33 @@ static void emit_asm_debug(BuildCtx *ctx)
5133 "\t.align " BSZPTR "\n" 5133 "\t.align " BSZPTR "\n"
5134 "LECIEX:\n\n"); 5134 "LECIEX:\n\n");
5135 for (i = 0; i < ctx->nsym; i++) { 5135 for (i = 0; i < ctx->nsym; i++) {
5136 int pi = ctx->perm[i]; 5136 const char *name = ctx->sym[i].name;
5137 int ni = ctx->perm[i+1]; 5137 int32_t size = ctx->sym[i+1].ofs - ctx->sym[i].ofs;
5138 int size = ctx->sym_ofs[ni] - ctx->sym_ofs[pi]; 5138 fprintf(ctx->fp,
5139 if (ctx->sym_ofs[pi] >= 0 && size > 0) { 5139 "%s.eh:\n"
5140 char name[80]; 5140 "LSFDE%d:\n"
5141 if (pi >= ctx->npc) { 5141 "\t.set L$set$%d,LEFDE%d-LASFDE%d\n"
5142 char *p; 5142 "\t.long L$set$%d\n"
5143 sprintf(name, "_" LABEL_PREFIX "%s", ctx->globnames[pi - ctx->npc]); 5143 "LASFDE%d:\n"
5144 p = strchr(name, '@'); if (p) *p = '\0'; 5144 "\t.long LASFDE%d-EH_frame1\n"
5145#if LJ_HASJIT 5145 "\t.long %s-.\n"
5146 } else { 5146 "\t.long %d\n"
5147#else 5147 "\t.byte 0\n" /* augmentation length */
5148 } else if (!(pi == BC_JFORI || pi == BC_JFORL || pi == BC_JITERL || 5148 "\t.byte 0xe\n\t.byte %d\n" /* def_cfa_offset */
5149 pi == BC_JLOOP || pi == BC_IFORL || pi == BC_IITERL ||
5150 pi == BC_ILOOP)) {
5151#endif
5152 sprintf(name, "_" LABEL_PREFIX_BC "%s", bc_names[pi]);
5153 }
5154 fprintf(ctx->fp,
5155 "%s.eh:\n"
5156 "LSFDE%d:\n"
5157 "\t.set L$set$%d,LEFDE%d-LASFDE%d\n"
5158 "\t.long L$set$%d\n"
5159 "LASFDE%d:\n"
5160 "\t.long LASFDE%d-EH_frame1\n"
5161 "\t.long %s-.\n"
5162 "\t.long %d\n"
5163 "\t.byte 0\n" /* augmentation length */
5164 "\t.byte 0xe\n\t.byte %d\n" /* def_cfa_offset */
5165#if LJ_64 5149#if LJ_64
5166 "\t.byte 0x86\n\t.byte 0x2\n" /* offset rbp */ 5150 "\t.byte 0x86\n\t.byte 0x2\n" /* offset rbp */
5167 "\t.byte 0x83\n\t.byte 0x3\n" /* offset rbx */ 5151 "\t.byte 0x83\n\t.byte 0x3\n" /* offset rbx */
5168 "\t.byte 0x8f\n\t.byte 0x4\n" /* offset r15 */ 5152 "\t.byte 0x8f\n\t.byte 0x4\n" /* offset r15 */
5169 "\t.byte 0x8e\n\t.byte 0x5\n" /* offset r14 */ 5153 "\t.byte 0x8e\n\t.byte 0x5\n" /* offset r14 */
5170#else 5154#else
5171 "\t.byte 0x84\n\t.byte 0x2\n" /* offset ebp (4 for MACH-O)*/ 5155 "\t.byte 0x84\n\t.byte 0x2\n" /* offset ebp (4 for MACH-O)*/
5172 "\t.byte 0x87\n\t.byte 0x3\n" /* offset edi */ 5156 "\t.byte 0x87\n\t.byte 0x3\n" /* offset edi */
5173 "\t.byte 0x86\n\t.byte 0x4\n" /* offset esi */ 5157 "\t.byte 0x86\n\t.byte 0x4\n" /* offset esi */
5174 "\t.byte 0x83\n\t.byte 0x5\n" /* offset ebx */ 5158 "\t.byte 0x83\n\t.byte 0x5\n" /* offset ebx */
5175#endif 5159#endif
5176 "\t.align " BSZPTR "\n" 5160 "\t.align " BSZPTR "\n"
5177 "LEFDE%d:\n\n", 5161 "LEFDE%d:\n\n",
5178 name, i, i, i, i, i, i, i, name, size, CFRAME_SIZE, i); 5162 name, i, i, i, i, i, i, i, name, size, CFRAME_SIZE, i);
5179 }
5180 } 5163 }
5181#if LJ_64 5164#if LJ_64
5182 fprintf(ctx->fp, "\t.subsections_via_symbols\n"); 5165 fprintf(ctx->fp, "\t.subsections_via_symbols\n");