mirror of
https://github.com/love2d/megasource.git
synced 2026-08-19 04:05:09 +02:00
Update LuaJIT to 2.0.5
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
|// Low-level VM code for MIPS CPUs.
|
||||
|// Bytecode interpreter, fast functions and helper functions.
|
||||
|// Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
|
||||
|// Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h
|
||||
|
|
||||
|.arch mips
|
||||
|.section code_op, code_sub
|
||||
@@ -1621,6 +1621,7 @@ static void build_subroutines(BuildCtx *ctx)
|
||||
|
|
||||
|.ffunc string_char // Only handle the 1-arg case here.
|
||||
| ffgccheck
|
||||
|. nop
|
||||
| lw CARG3, HI(BASE)
|
||||
| ldc1 FARG1, 0(BASE)
|
||||
| li AT, 8
|
||||
@@ -1648,6 +1649,7 @@ static void build_subroutines(BuildCtx *ctx)
|
||||
|
|
||||
|.ffunc string_sub
|
||||
| ffgccheck
|
||||
|. nop
|
||||
| addiu AT, NARGS8:RC, -16
|
||||
| lw CARG3, 16+HI(BASE)
|
||||
| ldc1 f0, 16(BASE)
|
||||
@@ -1697,6 +1699,7 @@ static void build_subroutines(BuildCtx *ctx)
|
||||
|
|
||||
|.ffunc string_rep // Only handle the 1-char case inline.
|
||||
| ffgccheck
|
||||
|. nop
|
||||
| lw TMP0, HI(BASE)
|
||||
| addiu AT, NARGS8:RC, -16 // Exactly 2 arguments.
|
||||
| lw CARG4, 8+HI(BASE)
|
||||
@@ -1731,6 +1734,7 @@ static void build_subroutines(BuildCtx *ctx)
|
||||
|
|
||||
|.ffunc string_reverse
|
||||
| ffgccheck
|
||||
|. nop
|
||||
| lw CARG3, HI(BASE)
|
||||
| lw STR:CARG1, LO(BASE)
|
||||
| beqz NARGS8:RC, ->fff_fallback
|
||||
@@ -1756,6 +1760,7 @@ static void build_subroutines(BuildCtx *ctx)
|
||||
|.macro ffstring_case, name, lo
|
||||
| .ffunc name
|
||||
| ffgccheck
|
||||
|. nop
|
||||
| lw CARG3, HI(BASE)
|
||||
| lw STR:CARG1, LO(BASE)
|
||||
| beqz NARGS8:RC, ->fff_fallback
|
||||
@@ -3614,24 +3619,24 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
|
||||
case BC_ISNEXT:
|
||||
| // RA = base*8, RD = target (points to ITERN)
|
||||
| addu RA, BASE, RA
|
||||
| lw TMP0, -24+HI(RA)
|
||||
| lw CFUNC:TMP1, -24+LO(RA)
|
||||
| lw TMP2, -16+HI(RA)
|
||||
| lw TMP3, -8+HI(RA)
|
||||
| srl TMP0, RD, 1
|
||||
| lw CARG1, -24+HI(RA)
|
||||
| lw CFUNC:CARG2, -24+LO(RA)
|
||||
| addu TMP0, PC, TMP0
|
||||
| lw CARG3, -16+HI(RA)
|
||||
| lw CARG4, -8+HI(RA)
|
||||
| li AT, LJ_TFUNC
|
||||
| bne TMP0, AT, >5
|
||||
|. addiu TMP2, TMP2, -LJ_TTAB
|
||||
| lbu TMP1, CFUNC:TMP1->ffid
|
||||
| addiu TMP3, TMP3, -LJ_TNIL
|
||||
| srl TMP0, RD, 1
|
||||
| or TMP2, TMP2, TMP3
|
||||
| addiu TMP1, TMP1, -FF_next_N
|
||||
| addu TMP0, PC, TMP0
|
||||
| or TMP1, TMP1, TMP2
|
||||
| bnez TMP1, >5
|
||||
|. lui TMP2, (-(BCBIAS_J*4 >> 16) & 65535)
|
||||
| bne CARG1, AT, >5
|
||||
|. lui TMP2, (-(BCBIAS_J*4 >> 16) & 65535)
|
||||
| lbu CARG2, CFUNC:CARG2->ffid
|
||||
| addiu CARG3, CARG3, -LJ_TTAB
|
||||
| addiu CARG4, CARG4, -LJ_TNIL
|
||||
| or CARG3, CARG3, CARG4
|
||||
| addiu CARG2, CARG2, -FF_next_N
|
||||
| or CARG2, CARG2, CARG3
|
||||
| bnez CARG2, >5
|
||||
|. lui TMP1, 0xfffe
|
||||
| addu PC, TMP0, TMP2
|
||||
| lui TMP1, 0xfffe
|
||||
| ori TMP1, TMP1, 0x7fff
|
||||
| sw r0, -8+LO(RA) // Initialize control var.
|
||||
| sw TMP1, -8+HI(RA)
|
||||
@@ -3641,7 +3646,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
|
||||
| li TMP3, BC_JMP
|
||||
| li TMP1, BC_ITERC
|
||||
| sb TMP3, -4+OFS_OP(PC)
|
||||
| addu PC, TMP0, TMP2
|
||||
| addu PC, TMP0, TMP2
|
||||
| b <1
|
||||
|. sb TMP1, OFS_OP(PC)
|
||||
break;
|
||||
@@ -4165,6 +4170,7 @@ static void emit_asm_debug(BuildCtx *ctx)
|
||||
"\t.align 2\n"
|
||||
".LEFDE1:\n\n", (int)ctx->codesz - fcofs);
|
||||
#endif
|
||||
#if !LJ_NO_UNWIND
|
||||
fprintf(ctx->fp, "\t.section .eh_frame,\"aw\",@progbits\n");
|
||||
fprintf(ctx->fp,
|
||||
"\t.globl lj_err_unwind_dwarf\n"
|
||||
@@ -4232,6 +4238,7 @@ static void emit_asm_debug(BuildCtx *ctx)
|
||||
"\t.byte 0xd\n\t.uleb128 0x10\n"
|
||||
"\t.align 2\n"
|
||||
".LEFDE3:\n\n", (int)ctx->codesz - fcofs);
|
||||
#endif
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user