Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Bronnikov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Kaplun <skaplun@tarantool.org>,
	Maxim Kokryashkin <m.kokryashkin@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit] Handle table unsinking in the presence of IRFL_TAB_NOMM.
Date: Sat, 16 Sep 2023 20:31:53 +0300	[thread overview]
Message-ID: <9e40b101-6a55-4961-0eda-7c8a955deb13@tarantool.org> (raw)
In-Reply-To: <20230829123641.3303-1-skaplun@tarantool.org>

Hi, Sergey


Thanks for the patch! LGTM

See a minor comment below.


On 8/29/23 15:36, Sergey Kaplun wrote:

<snipped>

> diff --git a/test/tarantool-tests/lj-1052-unsink-with-irfl-tab-nomm.test.lua b/test/tarantool-tests/lj-1052-unsink-with-irfl-tab-nomm.test.lua
> new file mode 100644
> index 00000000..aaf5349f
> --- /dev/null
> +++ b/test/tarantool-tests/lj-1052-unsink-with-irfl-tab-nomm.test.lua
> @@ -0,0 +1,36 @@
> +local tap = require('tap')
> +
> +-- Test file to demonstrate LuaJIT's incorrect restoration of a
> +-- table from a snapshot with the presence of `IRFL_TAB_NOMM`.
> +-- See also: https://github.com/LuaJIT/LuaJIT/issues/1052.
> +
> +local test = tap.test('lj-1052-unsink-with-irfl-tab-nomm'):skipcond({
> +  ['Test requires JIT enabled'] = not jit.status(),
> +})
> +
> +test:plan(2)
> +
> +local TEST_VALUE = 'test'
> +
> +jit.opt.start('hotloop=1')
> +
> +local counter = 0
> +local slot = 'slot'
> +while true do

You are using endless loop here, but loop is limited by 3 iterations 
(break after counter > 2).

Why "while true do end" is used here? Should we left a comment here?

> +  counter = counter + 1
> +  -- Use a non-constant slot to emit `FREF` with `IRFL_TAB_NOMM`.
> +  -- After re-emitting the variant part of the loop, NEWREF will
> +  -- contain a constant key (see below).
> +  slot = {[slot] = TEST_VALUE}
> +  -- Emit exit here to be sure that the table will be restored
> +  -- from the snapshot.
> +  if counter > 2 then break end
> +  -- We need a constant reference for NEWREF. Just use the old
> +  -- value.
> +  slot = 'slot'
> +end
<snipped>

  parent reply	other threads:[~2023-09-16 17:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-29 12:36 Sergey Kaplun via Tarantool-patches
2023-08-30 11:22 ` Maxim Kokryashkin via Tarantool-patches
2023-09-16 17:31 ` Sergey Bronnikov via Tarantool-patches [this message]
2023-09-18  7:56   ` Sergey Kaplun via Tarantool-patches
2023-09-18  8:41     ` Sergey Bronnikov via Tarantool-patches
2023-09-27 12:33 ` Igor Munkin via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9e40b101-6a55-4961-0eda-7c8a955deb13@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=m.kokryashkin@tarantool.org \
    --cc=sergeyb@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit] Handle table unsinking in the presence of IRFL_TAB_NOMM.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox