From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id E18075278F8; Sat, 15 Jul 2023 18:13:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E18075278F8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1689433993; bh=VXrzytkJG7T5JNm1JzoXn7ggkYlnl9PRLpbQHMI+D4E=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=bGgLxIn2F2fhYxJeNWnvvm2mFLDwlvayIyK2Y9GPseMseohdK578LPoB+V+v82nI2 G+Y3nV82NHlGeediq+bJzN+gfBDg4RSj4pmE8ctjC0hZt+Nty11xTLRANHXlYAbqyH zyv2bWfhHCOm8i6HpnLyBDDykilDeiP7qaAlLbl8= Received: from smtpng3.i.mail.ru (smtpng3.i.mail.ru [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id B4DDB47F90E for ; Sat, 15 Jul 2023 18:13:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B4DDB47F90E Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1qKgxK-0006N3-PE; Sat, 15 Jul 2023 18:13:11 +0300 Date: Sat, 15 Jul 2023 18:08:47 +0300 To: Maxim Kokryashkin Message-ID: References: <1689338483.354213109@f763.i.mail.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1689338483.354213109@f763.i.mail.ru> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9A075ED6396529197719E315D036F0456EE92739D00BFCE97182A05F5380850407A5072041F11997AA47F760F17D865D281C3556A2F8565DDA61C535CBCE39254 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE758E3775C3D7FDEE4EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637D0C488966F20D4908638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D844AC09B4DB9AAF5519B1B7343E938369117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735200AC5B80A05675ACD2CC0D3CB04F14752D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B613439FA09F3DCB32089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5AA43449B411AB24B89BCFC26EC1445FC11B9AA7018537A7FF87CCE6106E1FC07E67D4AC08A07B9B00A6B3CD6EB70C818BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFB648FAD2B7368E4B0379F65FD79AC9A3163ED8CC3012D6F15283588297D737225585C02E945303B37BBDB0A562C82D598B79769E48F3DD547D552A31296BFC9EE48CAC7CA610320002C26D483E81D6BE5EF9655DD6DEA7D65774BB76CC95456EEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojTPX5czuwuGFj9INAj14Q8w== X-DA7885C5: 7FD9FB6DDBCC2C3AC1DC1CF2F6858734B34C2F07158557B78A1BDC927DD4D548262E2D401490A4A0DB037EFA58388B346E8BC1A9835FDE71 X-Mailru-Sender: 689FA8AB762F73930F533AC2B33E986B1DAB0408CFA7A4D098082A1FAF2CF51E0FBE9A32752B8C9C2AA642CC12EC09F1FB559BB5D741EB962F61BD320559CF1EFD657A8799238ED55FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 2/2] Fix maxslots when recording BC_VARG, part 2. X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Maxim! Thanks for the review! Fixed your comments, branch is force-pushed. On 14.07.23, Maxim Kokryashkin wrote: > > Hi! > Thanks for the patch! > LGTM, except for a few nits below. > >  > >>From: Mike Pall > >> > >>Analyzed by Sergey Kaplun. > >> > >>(cherry-picked from commit a01cba9d2d74efc57376822aa43db2d5043af5a4) > >> > >>This patch is the follow-up for the previous one. It removes the > >Typo: s/the/a > >Typo: s/for the/to the/ Fixed, thanks! > >>condition for `maxslot` changing in the case when varargs are defined > >>on the trace (i.e. `framedepth` > 0). > >Typo: s/i.e./i.e.,/ I prefer to avoid double punctuation symbols as mentioned here[1]. Also, this style is allowed by Oxford dictionary (as referenced in [1]). > >> > >>Sergey Kaplun: > >>* added the description and the test for the problem > >> > >>Part of tarantool/tarantool#8825 > >>--- > >> src/lj_record.c | 8 ++------ > >> .../lj-1024-varg-maxslot.test.lua | 19 ++++++++++++++++++- > >> 2 files changed, 20 insertions(+), 7 deletions(-) > >> > >>diff --git a/src/lj_record.c b/src/lj_record.c > >>index 112524d3..02d9db9e 100644 > >>--- a/src/lj_record.c > >>+++ b/src/lj_record.c > >>@@ -1775,12 +1775,8 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults) > >>   if (J->framedepth > 0) { /* Simple case: varargs defined on-trace. */ > >>     ptrdiff_t i; > >>     if (nvararg < 0) nvararg = 0; > >>- if (nresults == -1) { > >>- nresults = nvararg; > >>- J->maxslot = dst + (BCReg)nvararg; > >>- } else if (dst + nresults > J->maxslot) { > >>- J->maxslot = dst + (BCReg)nresults; > >>- } > >>+ if (nresults == -1) nresults = nvararg; > >>+ J->maxslot = dst + (BCReg)nresults; > >>     for (i = 0; i < nresults; i++) > >>       J->base[dst+i] = i < nvararg ? getslot(J, i - nvararg - 1 - LJ_FR2) : TREF_NIL; > >>   } else { /* Unknown number of varargs passed to trace. */ > >>diff --git a/test/tarantool-tests/lj-1024-varg-maxslot.test.lua b/test/tarantool-tests/lj-1024-varg-maxslot.test.lua > >>index 14270595..f8d74e8a 100644 > >>--- a/test/tarantool-tests/lj-1024-varg-maxslot.test.lua > >>+++ b/test/tarantool-tests/lj-1024-varg-maxslot.test.lua > >>@@ -3,7 +3,7 @@ local test = tap.test('lj-noticket-varg-usedef'):skipcond({ > >>   ['Test requires JIT enabled'] = not jit.status(), > >> }) > >>  > >>-test:plan(1) > >>+test:plan(2) > >>  > >> jit.opt.start('hotloop=1') > >>  > >>@@ -20,4 +20,21 @@ end > >>  > >> test:ok(true, 'BC_VARG recording 0th frame depth') > >>  > >>+-- Now the same case, but with additional frame, so VARG slots > >Typo: s/with/with an/ Fixed, thanks! > >>+-- are defined on the trace. > >>+local function bump_varg_frame(...) > >Nit: Not sure about the name here, maybe it is better to call it > >just `varg_frame` or something like that. Feel free to ignore, though. Changed to the `varg_frame()`. See the iterative patch below. =================================================================== diff --git a/test/tarantool-tests/lj-1024-varg-maxslot.test.lua b/test/tarantool-tests/lj-1024-varg-maxslot.test.lua index f8d74e8a..cdefbe83 100644 --- a/test/tarantool-tests/lj-1024-varg-maxslot.test.lua +++ b/test/tarantool-tests/lj-1024-varg-maxslot.test.lua @@ -20,9 +20,9 @@ end test:ok(true, 'BC_VARG recording 0th frame depth') --- Now the same case, but with additional frame, so VARG slots +-- Now the same case, but with an additional frame, so VARG slots -- are defined on the trace. -local function bump_varg_frame(...) +local function varg_frame(...) -- BC_VARG 1 1 0. `...` is nil (argument for the script). -- luacheck: ignore -- XXX: some condition to use several slots on the Lua stack. @@ -32,7 +32,7 @@ end counter = 0 while counter < 3 do counter = counter + 1 - bump_varg_frame() + varg_frame() end test:ok(true, 'BC_VARG recording with defined on trace VARG slots') =================================================================== > >>+ -- BC_VARG 1 1 0. `...` is nil (argument for the script). > >>+ -- luacheck: ignore > >>+ -- XXX: some condition to use several slots on the Lua stack. > >>+ anchor = 1 >= 1, ... > >>+end > >>+ > >>+counter = 0 > >>+while counter < 3 do > >>+ counter = counter + 1 > >>+ bump_varg_frame() > >>+end > >>+ > >>+test:ok(true, 'BC_VARG recording with defined on trace VARG slots') > >>+ > >> os.exit(test:check() and 0 or 1) > >>-- > >>2.34.1 > >-- > >Best regards, > >Maxim Kokryashkin > >  [1]: https://english.stackexchange.com/questions/352253/why-does-oxforddictionaries-com-not-use-a-comma-after-the-abbreviations-i-e-a -- Best regards, Sergey Kaplun