Merge branch 'master' into v2.1
This commit is contained in:
@@ -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]
|
||||
@@ -5422,6 +5438,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"
|
||||
@@ -5457,6 +5477,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");
|
||||
@@ -5544,8 +5565,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.
|
||||
*/
|
||||
@@ -5679,6 +5702,7 @@ static void emit_asm_debug(BuildCtx *ctx)
|
||||
fprintf(ctx->fp, ".subsections_via_symbols\n");
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default: /* Difficult for other modes. */
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user