Merge branch 'master' into v2.1
This commit is contained in:
@@ -143,6 +143,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
|
||||
@@ -150,15 +153,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, aword [rsp+aword*3]
|
||||
|.define SAVE_L, aword [rsp+aword*2]
|
||||
@@ -4682,6 +4698,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
|
||||
"\t.align 8\n"
|
||||
".LEFDE0:\n\n", fcofs, CFRAME_SIZE);
|
||||
#if LJ_HASFFI
|
||||
@@ -4699,6 +4719,7 @@ static void emit_asm_debug(BuildCtx *ctx)
|
||||
"\t.align 8\n"
|
||||
".LEFDE1:\n\n", (int)ctx->codesz - fcofs);
|
||||
#endif
|
||||
#if !LJ_NO_UNWIND
|
||||
#if (defined(__sun__) && defined(__svr4__))
|
||||
fprintf(ctx->fp, "\t.section .eh_frame,\"a\",@unwind\n");
|
||||
#else
|
||||
@@ -4768,8 +4789,10 @@ static void emit_asm_debug(BuildCtx *ctx)
|
||||
"\t.byte 0x83\n\t.uleb128 0x3\n" /* offset rbx */
|
||||
"\t.align 8\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.
|
||||
*/
|
||||
@@ -4864,6 +4887,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