diff options
author | Mike Pall <mike> | 2021-03-23 00:48:27 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2021-03-23 00:48:27 +0100 |
commit | a4c9fc3d6cca87cc6ff9c6343ddb9b4716823201 (patch) | |
tree | 4425d68a46f885c8987b16e7397f3abe88cb1782 /src | |
parent | a32aeadc6878305658fb3939830e6abaef587e40 (diff) | |
parent | 33e3f4badfde8cd9c202cedd1f4ed9275bc92e7d (diff) | |
download | luajit-a4c9fc3d6cca87cc6ff9c6343ddb9b4716823201.tar.gz luajit-a4c9fc3d6cca87cc6ff9c6343ddb9b4716823201.tar.bz2 luajit-a4c9fc3d6cca87cc6ff9c6343ddb9b4716823201.zip |
Merge branch 'master' into v2.1
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_asm.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c index 8a516eba..db180315 100644 --- a/src/lj_asm.c +++ b/src/lj_asm.c | |||
@@ -72,6 +72,7 @@ typedef struct ASMState { | |||
72 | SnapNo snapno; /* Current snapshot number. */ | 72 | SnapNo snapno; /* Current snapshot number. */ |
73 | SnapNo loopsnapno; /* Loop snapshot number. */ | 73 | SnapNo loopsnapno; /* Loop snapshot number. */ |
74 | int snapalloc; /* Current snapshot needs allocation. */ | 74 | int snapalloc; /* Current snapshot needs allocation. */ |
75 | BloomFilter snapfilt1, snapfilt2; /* Filled with snapshot refs. */ | ||
75 | 76 | ||
76 | IRRef fuseref; /* Fusion limit (loopref, 0 or FUSE_DISABLED). */ | 77 | IRRef fuseref; /* Fusion limit (loopref, 0 or FUSE_DISABLED). */ |
77 | IRRef sectref; /* Section base reference (loopref or 0). */ | 78 | IRRef sectref; /* Section base reference (loopref or 0). */ |
@@ -894,7 +895,10 @@ static int asm_sunk_store(ASMState *as, IRIns *ira, IRIns *irs) | |||
894 | static void asm_snap_alloc1(ASMState *as, IRRef ref) | 895 | static void asm_snap_alloc1(ASMState *as, IRRef ref) |
895 | { | 896 | { |
896 | IRIns *ir = IR(ref); | 897 | IRIns *ir = IR(ref); |
897 | if (!irref_isk(ref) && (!(ra_used(ir) || ir->r == RID_SUNK))) { | 898 | if (!irref_isk(ref) && ir->r != RID_SUNK) { |
899 | bloomset(as->snapfilt1, ref); | ||
900 | bloomset(as->snapfilt2, hashrot(ref, ref + HASH_BIAS)); | ||
901 | if (ra_used(ir)) return; | ||
898 | if (ir->r == RID_SINK) { | 902 | if (ir->r == RID_SINK) { |
899 | ir->r = RID_SUNK; | 903 | ir->r = RID_SUNK; |
900 | #if LJ_HASFFI | 904 | #if LJ_HASFFI |
@@ -954,6 +958,7 @@ static void asm_snap_alloc(ASMState *as, int snapno) | |||
954 | SnapShot *snap = &as->T->snap[snapno]; | 958 | SnapShot *snap = &as->T->snap[snapno]; |
955 | SnapEntry *map = &as->T->snapmap[snap->mapofs]; | 959 | SnapEntry *map = &as->T->snapmap[snap->mapofs]; |
956 | MSize n, nent = snap->nent; | 960 | MSize n, nent = snap->nent; |
961 | as->snapfilt1 = as->snapfilt2 = 0; | ||
957 | for (n = 0; n < nent; n++) { | 962 | for (n = 0; n < nent; n++) { |
958 | SnapEntry sn = map[n]; | 963 | SnapEntry sn = map[n]; |
959 | IRRef ref = snap_ref(sn); | 964 | IRRef ref = snap_ref(sn); |
@@ -978,18 +983,12 @@ static void asm_snap_alloc(ASMState *as, int snapno) | |||
978 | */ | 983 | */ |
979 | static int asm_snap_checkrename(ASMState *as, IRRef ren) | 984 | static int asm_snap_checkrename(ASMState *as, IRRef ren) |
980 | { | 985 | { |
981 | SnapShot *snap = &as->T->snap[as->snapno]; | 986 | if (bloomtest(as->snapfilt1, ren) && |
982 | SnapEntry *map = &as->T->snapmap[snap->mapofs]; | 987 | bloomtest(as->snapfilt2, hashrot(ren, ren + HASH_BIAS))) { |
983 | MSize n, nent = snap->nent; | 988 | IRIns *ir = IR(ren); |
984 | for (n = 0; n < nent; n++) { | 989 | ra_spill(as, ir); /* Register renamed, so force a spill slot. */ |
985 | SnapEntry sn = map[n]; | 990 | RA_DBGX((as, "snaprensp $f $s", ren, ir->s)); |
986 | IRRef ref = snap_ref(sn); | 991 | return 1; /* Found. */ |
987 | if (ref == ren || (LJ_SOFTFP && (sn & SNAP_SOFTFPNUM) && ++ref == ren)) { | ||
988 | IRIns *ir = IR(ref); | ||
989 | ra_spill(as, ir); /* Register renamed, so force a spill slot. */ | ||
990 | RA_DBGX((as, "snaprensp $f $s", ref, ir->s)); | ||
991 | return 1; /* Found. */ | ||
992 | } | ||
993 | } | 992 | } |
994 | return 0; /* Not found. */ | 993 | return 0; /* Not found. */ |
995 | } | 994 | } |