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 62CA052ED6E; Tue, 18 Jul 2023 17:16:26 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 62CA052ED6E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1689689786; bh=mKsomfG4FNg0cCnhxNGofrmRgPnCQuvTwTu0jByLzRc=; 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=czcbVFROyDwkG7LNJuL77+OcDOWLtzGBMUnL4nOzxCUvQ6j27TFPYopVvv1gxrmi8 X9TyxZr4SCwHjWboFabYoPyXSj9WS6FY/udMw+eaBNzi3MUnSk7/ZdBNHKaltwMun1 77/EsI+TcS/gMqOjXyWAckJtgLRGHeQEKQ+W95vo= Received: from smtp47.i.mail.ru (smtp47.i.mail.ru [95.163.41.85]) (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 0FDB1482AA0 for ; Tue, 18 Jul 2023 17:16:25 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0FDB1482AA0 Received: by smtp47.i.mail.ru with esmtpa (envelope-from ) id 1qLlV2-00Afhb-A3; Tue, 18 Jul 2023 17:16:24 +0300 Date: Tue, 18 Jul 2023 17:12:00 +0300 To: Igor Munkin Message-ID: References: <323f1c0c6a33a31f0ad7691bd68886bfd195eae4.1688985402.git.skaplun@tarantool.org> 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: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD97569A0FE902DCB3DF525A235365A19A2D5B01E069C4E5BA91867C24CE74E72BB5FE18E9CBFBE7C07ABB8801FE638EFEA7564AC49604BE17F2D9A032FED1B49DAB57612C3CDEB6A40 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE79683A3C835791080EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637835928C62272F24E8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8F73C6532147E5518DB26CE7C21DFA533117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735204B6963042765DA4BF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947CF8BD4E506CFA3D88C0837EA9F3D197644AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C3D8561A2FEC730ACEBA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CFE478A468B35FE7671DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C3A1C30C8AFC676C8B35872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A54A6A1A92DA1C8039A2A9E8188EE3B3D432666FDB01EEA4AFF87CCE6106E1FC07E67D4AC08A07B9B06A1CB4668A9CA5FACB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF8F66341F9B42D195082CAB3EB095E3948AEC856BE7023B6BC2D7E61B7CD9FE1523277A7B3C315D4EDA6E887A44188BD657F3124830949C7E4B1418B453DBC8F3E48CAC7CA610320002C26D483E81D6BE5EF9655DD6DEA7D65774BB76CC95456EEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojLxQD/rvAZi6Ym2eN1TlFtg== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A7696834186D1C1AD4B1B91CEDBD3DC57DA2F7F5837242FA16B2DEDBA653FF35249392D99EB8CC7091A70E183A470755BFD208F19895AA18418972D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 1/2] Fix maxslots when recording BC_VARG. 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! The commit message is OK after fixing Max nits, > but I still have some questions regarding the test. > > 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 > > new file mode 100644 > > index 00000000..14270595 > > --- /dev/null > > +++ b/test/tarantool-tests/lj-1024-varg-maxslot.test.lua > > @@ -0,0 +1,23 @@ > > +local tap = require('tap') > > +local test = tap.test('lj-noticket-varg-usedef'):skipcond({ > > Now you have a ticket number. Fixed, thanks! > > > + ['Test requires JIT enabled'] = not jit.status(), > > +}) > > + > > +test:plan(1) > > + > > +jit.opt.start('hotloop=1') > > + > > +local counter = 0 > > +-- luacheck: ignore > > +local anchor > > +while counter < 3 do > > + counter = counter + 1 > > + -- BC_VARG 5 1 0. `...` is nil (argument for the script). > > + -- luacheck: ignore > > + -- XXX: some condition to use several slots on the Lua stack. > > + anchor = 1 >= 1, ... > > Well, I have no idea, why this black voodoo magic is required. Comment > doesn't make it clear either. It would be nice to describe the purpose > of this in a more verbose way. Added more verbose description. See the full diff 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 14270595..9a968b0c 100644 --- a/test/tarantool-tests/lj-1024-varg-maxslot.test.lua +++ b/test/tarantool-tests/lj-1024-varg-maxslot.test.lua @@ -1,5 +1,5 @@ local tap = require('tap') -local test = tap.test('lj-noticket-varg-usedef'):skipcond({ +local test = tap.test('lj-1024-varg-usedef'):skipcond({ ['Test requires JIT enabled'] = not jit.status(), }) @@ -13,8 +13,20 @@ local anchor while counter < 3 do counter = counter + 1 -- BC_VARG 5 1 0. `...` is nil (argument for the script). + -- We have the following bytecodes to be recorded: + -- 0031 ADDVN 2 2 0 ; 1 + -- 0032 KSHORT 4 1 + -- 0033 KSHORT 5 1 + -- 0034 ISLE 4 5 + -- 0035 JMP 4 => 0038 + -- 0038 KPRI 4 2 + -- 0039 VARG 5 1 0 + -- + -- 0033 KSHORT bytecode uses the 6th JIT slot and the 5th Lua + -- slot. This Lua slot will be set to nil after 0039 VARG + -- bytecode execution, so after VARG recording maxslot should + -- point to the 5th JIT slot. -- luacheck: ignore - -- XXX: some condition to use several slots on the Lua stack. anchor = 1 >= 1, ... end =================================================================== > > > +end > > + > > +test:ok(true, 'BC_VARG recording 0th frame depth') > > + > > +os.exit(test:check() and 0 or 1) > > -- > > 2.34.1 > > > > -- > Best regards, > IM -- Best regards, Sergey Kaplun