|
@@ -222,6 +222,9 @@
|
|
|
|.define CFRAME_SPACE, aword*5 // Delta for rsp (see <--).
|
|
|
|.macro saveregs_
|
|
|
| push rbx; push r15; push r14
|
|
|
+|.if NO_UNWIND
|
|
|
+| push r13; push r12
|
|
|
+|.endif
|
|
|
| sub rsp, CFRAME_SPACE
|
|
|
|.endmacro
|
|
|
|.macro saveregs
|
|
@@ -229,15 +232,28 @@
|
|
|
|.endmacro
|
|
|
|.macro restoreregs
|
|
|
| add rsp, CFRAME_SPACE
|
|
|
+|.if NO_UNWIND
|
|
|
+| pop r12; pop r13
|
|
|
+|.endif
|
|
|
| pop r14; pop r15; pop rbx; pop rbp
|
|
|
|.endmacro
|
|
|
|
|
|
|
|//----- 16 byte aligned,
|
|
|
+|.if NO_UNWIND
|
|
|
+|.define SAVE_RET, aword [rsp+aword*11] //<-- rsp entering interpreter.
|
|
|
+|.define SAVE_R4, aword [rsp+aword*10]
|
|
|
+|.define SAVE_R3, aword [rsp+aword*9]
|
|
|
+|.define SAVE_R2, aword [rsp+aword*8]
|
|
|
+|.define SAVE_R1, aword [rsp+aword*7]
|
|
|
+|.define SAVE_RU2, aword [rsp+aword*6]
|
|
|
+|.define SAVE_RU1, aword [rsp+aword*5] //<-- rsp after register saves.
|
|
|
+|.else
|
|
|
|.define SAVE_RET, aword [rsp+aword*9] //<-- rsp entering interpreter.
|
|
|
|.define SAVE_R4, aword [rsp+aword*8]
|
|
|
|.define SAVE_R3, aword [rsp+aword*7]
|
|
|
|.define SAVE_R2, aword [rsp+aword*6]
|
|
|
|.define SAVE_R1, aword [rsp+aword*5] //<-- rsp after register saves.
|
|
|
+|.endif
|
|
|
|.define SAVE_CFRAME, aword [rsp+aword*4]
|
|
|
|.define SAVE_PC, dword [rsp+dword*7]
|
|
|
|.define SAVE_L, dword [rsp+dword*6]
|
|
@@ -6119,6 +6135,10 @@ static void emit_asm_debug(BuildCtx *ctx)
|
|
|
"\t.byte 0x83\n\t.uleb128 0x3\n" /* offset rbx */
|
|
|
"\t.byte 0x8f\n\t.uleb128 0x4\n" /* offset r15 */
|
|
|
"\t.byte 0x8e\n\t.uleb128 0x5\n" /* offset r14 */
|
|
|
+#if LJ_NO_UNWIND
|
|
|
+ "\t.byte 0x8d\n\t.uleb128 0x6\n" /* offset r13 */
|
|
|
+ "\t.byte 0x8c\n\t.uleb128 0x7\n" /* offset r12 */
|
|
|
+#endif
|
|
|
#else
|
|
|
"\t.long .Lbegin\n"
|
|
|
"\t.long %d\n"
|
|
@@ -6154,6 +6174,7 @@ static void emit_asm_debug(BuildCtx *ctx)
|
|
|
"\t.align " SZPTR "\n"
|
|
|
".LEFDE1:\n\n", (int)ctx->codesz - fcofs);
|
|
|
#endif
|
|
|
+#if !LJ_NO_UNWIND
|
|
|
#if (defined(__sun__) && defined(__svr4__))
|
|
|
#if LJ_64
|
|
|
fprintf(ctx->fp, "\t.section .eh_frame,\"a\",@unwind\n");
|
|
@@ -6241,8 +6262,10 @@ static void emit_asm_debug(BuildCtx *ctx)
|
|
|
#endif
|
|
|
"\t.align " SZPTR "\n"
|
|
|
".LEFDE3:\n\n", (int)ctx->codesz - fcofs);
|
|
|
+#endif
|
|
|
#endif
|
|
|
break;
|
|
|
+#if !LJ_NO_UNWIND
|
|
|
/* Mental note: never let Apple design an assembler.
|
|
|
** Or a linker. Or a plastic case. But I digress.
|
|
|
*/
|
|
@@ -6370,6 +6393,7 @@ static void emit_asm_debug(BuildCtx *ctx)
|
|
|
#endif
|
|
|
}
|
|
|
break;
|
|
|
+#endif
|
|
|
default: /* Difficult for other modes. */
|
|
|
break;
|
|
|
}
|