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 CD4E56F873; Fri, 28 Jan 2022 15:51:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CD4E56F873 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1643374302; bh=dD5UtPW2O/80llAFA2Yb/ctCQkR7wAvvNYCQ1IZAbtM=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=gnFy9dGh8AaP2V3Zp6ULBrz7DB62QJexXkxDDeLgNFcLBQAsPrniOTSkTx3FdHkF7 ORVwPcFeRSaWuosNh6KtAXBKVX+KcpGHIrb0cz+Iprd8uaSZBdQtDoxHZWVZ3Oqlnu rcEsmt3RfSoGLvXyqzJqixms6c3+1kmcyH0CWnfI= Received: from smtp40.i.mail.ru (smtp40.i.mail.ru [94.100.177.100]) (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 2D7B86F873 for ; Fri, 28 Jan 2022 15:51:41 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2D7B86F873 Received: by smtp40.i.mail.ru with esmtpa (envelope-from ) id 1nDQj6-00059u-IK; Fri, 28 Jan 2022 15:51:40 +0300 Date: Fri, 28 Jan 2022 15:49:40 +0300 To: Igor Munkin , tarantool-patches@dev.tarantool.org Message-ID: References: <20210820154846.5515-1-skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD9DB8349C4A72921915232D984A6549A275B74A0BA3688A4391313CFAB8367EF908E2BE116634AD74D0A6623460C555734E05AE2915F704A52E444AD5EB36E4A3246FB58697BC30720 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7A8325FA649D0A450EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637DA223B75F41C64628638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D896D9F1F44E1448789E363992AD3AA4FF117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC8C7ADC89C2F0B2A5A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD182CC0D3CB04F14752D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6A45692FFBBD75A6A089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5086CCB51EB3E3BFAD6B11845B67EDD4439DDF65CE623504CD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75F04B387B5D7535DE410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D342B94C1DAF75C4D222F5C6FB391B1DD62C7BE07656B80F7AAECD101E7361A90A2823F3E2EA28E8A9A1D7E09C32AA3244C8448504A04AB85B7D8C3E9AB4525D8B455E75C8D0ED9F6EE729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojqLK0kLh8sGfldtHLsQnkCg== X-Mailru-Sender: 3B9A0136629DC91206CBC582EFEF4CB4E3FA9D1B915653FEFF9A41DA26E9F3D34D6B558138690059F2400F607609286E924004A7DEC283833C7120B22964430C52B393F8C72A41A84198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] Fix string.char() recording with no arguments. 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 Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Igor, On 28.01.22, Sergey Kaplun via Tarantool-patches wrote: > Igor, > Thanks for the review! > > On 28.01.22, Igor Munkin wrote: > > Sergey, > > > > Thanks for the patch! Please consider my comments below. > > > > On 20.08.21, Sergey Kaplun wrote: > > > > Minor: Strictly saying, this is not quite true. The right description is > > the following: > > * 1 -- instruction becomes hot. > > * 2 -- recording of the loop body. > > * 3 -- required for trace finalization, but this iteration runs the > > generated mcode. NB: the issue doesn't occur, since execution leaves > > the trace on table resizing guard. > > * 4 -- reproduces the issue. > > > > Hence, if you allocate the table with necessary size (3 in our case), > > then only 3 iterations are needed. Please adjust the comment above and > > the code below. > > Fixed, thanks! > > See the iterative patch below. > Branch is force-pushed. > =================================================================== > diff --git a/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua b/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua > index 6df93f07..61d02101 100644 > --- a/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua > +++ b/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua > @@ -6,11 +6,12 @@ local tap = require('tap') > > local test = tap.test('gh-6371-string-char-no-arg') > -- XXX: Number of loop iterations. > --- 1, 2 -- instruction becomes hot > --- 3 -- trace is recorded (considering loop recording specifics), > --- but bytecodes are still executed via VM > --- 4 -- trace is executed, need to check that emitted mcode is > --- correct > +-- * 1 -- instruction becomes hot. > +-- * 2 -- recording of the loop body. > +-- * 3 -- required for trace finalization, but this iteration runs the > +-- generated mcode. NB: the issue doesn't occur, since execution leaves > +-- the trace on table resizing guard. > +-- * 4 -- reproduces the issue. > local NTEST = 4 > test:plan(NTEST) > > =================================================================== Modified test for 3 iterations without side exit from trace. =================================================================== diff --git a/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua b/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua index 61d02101..93f0fbfb 100644 --- a/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua +++ b/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua @@ -8,15 +8,14 @@ local test = tap.test('gh-6371-string-char-no-arg') -- XXX: Number of loop iterations. -- * 1 -- instruction becomes hot. -- * 2 -- recording of the loop body. --- * 3 -- required for trace finalization, but this iteration runs the --- generated mcode. NB: the issue doesn't occur, since execution leaves --- the trace on table resizing guard. --- * 4 -- reproduces the issue. -local NTEST = 4 +-- * 3 -- reproduces the issue. +local NTEST = 3 test:plan(NTEST) -- Storage for the results to avoid trace aborting by `test:ok()`. -local results = {} +-- XXX: Use `table.new()` here to avoid side exit from trace by +-- table resizing. +local results = require('table.new')(3, 0) jit.opt.start('hotloop=1') for _ = 1, NTEST do table.insert(results, string.char()) =================================================================== > > > > > > > -- > > Best regards, > > IM > > -- > Best regards, > Sergey Kaplun -- Best regards, Sergey Kaplun