[Tarantool-patches] [PATCH luajit] Simplify handling of instable types in TNEW/TDUP load forwarding.
Igor Munkin
imun at tarantool.org
Thu Feb 15 16:45:11 MSK 2024
Sergey,
I've checked the patchset into all long-term branches in
tarantool/luajit and bumped a new version in master, release/3.0 and
release/2.11.
On 22.01.24, Sergey Kaplun via Tarantool-patches wrote:
> From: Mike Pall <mike>
>
> Thanks to Peter Cawley.
>
> (cherry picked from commit c42c62e71a45a677b8b1cbf749bd33cf4d5918ff)
>
> This patch is a follow-up for the commit
> b89186cb03e79359847cdbeb000a830cc464db35 ("Fix handling of instable
> types in TNEW/TDUP load forwarding."). The problem still occurs when
> TDUP load forwarding is performed for the boolean value. The
> `fwd_ahload()` always takes the type of IR without checking the type of
> the TValue for this iteration.
>
> This patch solves the issue by returning the expected type of the TValue
> from the constant table (or `nil` for TNEW IR) instead. In the case of
> type instability, the error in `loop_unroll()` will be raised, and the
> loop will be unrolled for one more iteration to prevent inconsistencies.
>
> Sergey Kaplun:
> * added the description and the test for the problem
>
> Part of tarantool/tarantool#9595
> ---
>
> Branch: https://github.com/tarantool/luajit/tree/skaplun/lj-994-instable-pri-types
> Tarantool PR: https://github.com/tarantool/tarantool/pull/9608
> Related issues:
> * https://github.com/tarantool/tarantool/issues/9595
> * https://github.com/LuaJIT/LuaJIT/issues/994
>
> src/lj_opt_mem.c | 20 +++++++++----------
> ...instable-types-during-loop-unroll.test.lua | 15 +++++++++++++-
> 2 files changed, 23 insertions(+), 12 deletions(-)
>
<snipped>
> --
> 2.43.0
>
--
Best regards,
IM
More information about the Tarantool-patches
mailing list