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 7588650D721; Tue, 18 Jul 2023 17:23:50 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7588650D721 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1689690230; bh=OyCk5nWgGBIcGiU6z10T4+Tay1KS3qXQft4qhV8UUfY=; 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=ZiBYQ6iV5vtC3hKTmeqKvVtmkkrH56CmD7LERwhJBef/fKS3UjjSubFvZyLohHM3h Q+RvSQUofdqX3DqR+MJylk0XqRDkmcUjTr+Q+Q1wKgY4ge0hyqLJuhYHRva3mMrTo5 rqr2ODy5gOfFNX7+YtJuYw0dldSWd2MSgCxphALI= Received: from smtp29.i.mail.ru (smtp29.i.mail.ru [95.163.41.68]) (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 D9CE550D721 for ; Tue, 18 Jul 2023 17:23:48 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D9CE550D721 Received: by smtp29.i.mail.ru with esmtpa (envelope-from ) id 1qLlcC-00EVjd-0w; Tue, 18 Jul 2023 17:23:48 +0300 Date: Tue, 18 Jul 2023 17:19:24 +0300 To: Igor Munkin Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9A075ED63965291970579FBC130BD7639A4E6932D6ABD2688182A05F538085040EDEF466AE5AAE5914F8004EE4FA0369291E9021F0C59EB42B1631A3D1C1AAEA7 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE78BAADB77C21FF6F2EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637369CDFF96C7994428638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8CA770FCC60848E36D611B3EB3FECB6D0117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520CCD848CCB6FE560C6FD1C55BDD38FC3FD2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE0AC5B80A05675ACD9100238FE36DC7A2D8FC6C240DEA76429C9F4D5AE37F343AA9539A8B242431040A6AB1C7CE11FEE3F8BD4E506CFA3D886136E347CC761E07C4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637870CFFD37CCFDD3AEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A5FA4D8616FD92058E4F61E2C0A499543B3FF1683D2892DDEEF87CCE6106E1FC07E67D4AC08A07B9B06A1CB4668A9CA5FACB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF4220D2256AF1082777828F1286B1354AE7F3508BB98BC5AA0D3F7E9EA2E89ED8BA297A5F7262141FDA6E887A44188BD6239D5EB20D830FB6379A1F5F42073A60E48CAC7CA610320002C26D483E81D6BE5EF9655DD6DEA7D65774BB76CC95456EEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojLxQD/rvAZi41wl7iUbdm2g== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A769012F4F6443F2BCD04F8004EE4FA036928A2AC75D222269F8DEDBA653FF35249392D99EB8CC7091A70E183A470755BFD208F19895AA18418972D6B4FCE48DF648AE208404248635DF 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, Igor! Thanks for the review! On 18.07.23, Igor Munkin wrote: > Sergey, > > Thanks for the patch! Again, everything is fine with the commit message > after resolving the comments left by Max, but the black voodoo magic > condition is still unclear (see my comments to the first patch). > > On 10.07.23, Sergey Kaplun wrote: > > From: Mike Pall > > > > > > > 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 > > > > > @@ -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 > > +-- are defined on the trace. > > +local function bump_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. > > + anchor = 1 >= 1, ... > > Clarification is required here as well as for the first test. Fixed! > > > +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') > > Minor: I believe it should be "BC_VARG recording with VARG slots defined > on the trace", but I might be missing something. Fixed, as you suggested. See the iterative patch below, branch is force-pushed. =================================================================== diff --git a/test/tarantool-tests/lj-1024-varg-maxslot.test.lua b/test/tarantool-tests/lj-1024-varg-maxslot.test.lua index ec8afbb5..e33ddba2 100644 --- a/test/tarantool-tests/lj-1024-varg-maxslot.test.lua +++ b/test/tarantool-tests/lj-1024-varg-maxslot.test.lua @@ -36,8 +36,19 @@ test:ok(true, 'BC_VARG recording 0th frame depth') -- are defined on the trace. local function varg_frame(...) -- BC_VARG 1 1 0. `...` is nil (argument for the script). + -- We have the following bytecodes to be recorded: + -- 0001 . . KSHORT 0 1 + -- 0002 . . KSHORT 1 1 + -- 0003 . . ISLE 0 1 + -- 0004 . . JMP 0 => 0007 + -- 0007 . . KPRI 0 2 + -- 0008 . . VARG 1 1 0 + -- + -- 0002 KSHORT bytecode uses the 2nd JIT slot and the 1st Lua + -- slot. This Lua slot will be set to nil after 0008 VARG + -- bytecode execution, so after VARG recording maxslot should + -- point to the 1st JIT slot. -- luacheck: ignore - -- XXX: some condition to use several slots on the Lua stack. anchor = 1 >= 1, ... end @@ -47,6 +58,6 @@ while counter < 3 do varg_frame() end -test:ok(true, 'BC_VARG recording with defined on trace VARG slots') +test:ok(true, 'BC_VARG recording with VARG slots defined on trace') os.exit(test:check() and 0 or 1) =================================================================== > > > + > > os.exit(test:check() and 0 or 1) > > -- > > 2.34.1 > > > > -- > Best regards, > IM -- Best regards, Sergey Kaplun