diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lj_asm_arm.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lj_asm_arm.h b/src/lj_asm_arm.h index 348cd79f..bd5fbeb1 100644 --- a/src/lj_asm_arm.h +++ b/src/lj_asm_arm.h | |||
| @@ -2042,11 +2042,12 @@ static void asm_stack_restore(ASMState *as, SnapShot *snap) | |||
| 2042 | SnapEntry *map = &as->T->snapmap[snap->mapofs]; | 2042 | SnapEntry *map = &as->T->snapmap[snap->mapofs]; |
| 2043 | SnapEntry *flinks = &as->T->snapmap[snap_nextofs(as->T, snap)-1]; | 2043 | SnapEntry *flinks = &as->T->snapmap[snap_nextofs(as->T, snap)-1]; |
| 2044 | MSize n, nent = snap->nent; | 2044 | MSize n, nent = snap->nent; |
| 2045 | int32_t bias = 0; | ||
| 2045 | /* Store the value of all modified slots to the Lua stack. */ | 2046 | /* Store the value of all modified slots to the Lua stack. */ |
| 2046 | for (n = 0; n < nent; n++) { | 2047 | for (n = 0; n < nent; n++) { |
| 2047 | SnapEntry sn = map[n]; | 2048 | SnapEntry sn = map[n]; |
| 2048 | BCReg s = snap_slot(sn); | 2049 | BCReg s = snap_slot(sn); |
| 2049 | int32_t ofs = 8*((int32_t)s-1); | 2050 | int32_t ofs = 8*((int32_t)s-1) - bias; |
| 2050 | IRRef ref = snap_ref(sn); | 2051 | IRRef ref = snap_ref(sn); |
| 2051 | IRIns *ir = IR(ref); | 2052 | IRIns *ir = IR(ref); |
| 2052 | if ((sn & SNAP_NORESTORE)) | 2053 | if ((sn & SNAP_NORESTORE)) |
| @@ -2065,6 +2066,12 @@ static void asm_stack_restore(ASMState *as, SnapShot *snap) | |||
| 2065 | emit_lso(as, ARMI_STR, tmp, RID_BASE, ofs+4); | 2066 | emit_lso(as, ARMI_STR, tmp, RID_BASE, ofs+4); |
| 2066 | #else | 2067 | #else |
| 2067 | Reg src = ra_alloc1(as, ref, RSET_FPR); | 2068 | Reg src = ra_alloc1(as, ref, RSET_FPR); |
| 2069 | if (LJ_UNLIKELY(ofs < -1020 || ofs > 1020)) { | ||
| 2070 | int32_t adj = ofs & 0xffffff00; /* K12-friendly. */ | ||
| 2071 | bias += adj; | ||
| 2072 | ofs -= adj; | ||
| 2073 | emit_addptr(as, RID_BASE, -adj); | ||
| 2074 | } | ||
| 2068 | emit_vlso(as, ARMI_VSTR_D, src, RID_BASE, ofs); | 2075 | emit_vlso(as, ARMI_VSTR_D, src, RID_BASE, ofs); |
| 2069 | #endif | 2076 | #endif |
| 2070 | } else { | 2077 | } else { |
| @@ -2093,6 +2100,7 @@ static void asm_stack_restore(ASMState *as, SnapShot *snap) | |||
| 2093 | } | 2100 | } |
| 2094 | checkmclim(as); | 2101 | checkmclim(as); |
| 2095 | } | 2102 | } |
| 2103 | emit_addptr(as, RID_BASE, bias); | ||
| 2096 | lj_assertA(map + nent == flinks, "inconsistent frames in snapshot"); | 2104 | lj_assertA(map + nent == flinks, "inconsistent frames in snapshot"); |
| 2097 | } | 2105 | } |
| 2098 | 2106 | ||
