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 1CD041CF646; Thu, 1 Dec 2022 23:43:25 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1CD041CF646 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1669927405; bh=fVg4si1URS7blV7xDC1yO/FE2pWCyOdtiC2bC9IOFd8=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=U/FcJamNRDS2sZ7fR1/EU2EbqzUMmnV6i/te1BfjPJTW+8rZMu9FK6uEJmZhDOmBY 7CqGsQC1SRnVvIMA7DRB50UhewruGRl1oRKdHBKjvzQxXahPTESkFoCKrxMziR29pJ WapczJl2Z6baQEggkiKMTrC2vzG2qwaZblzFCv4U= Received: from smtpng2.i.mail.ru (smtpng2.i.mail.ru [94.100.179.3]) (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 D4D021CF646 for ; Thu, 1 Dec 2022 23:42:54 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D4D021CF646 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1p0qOT-00058t-TN; Thu, 01 Dec 2022 23:42:54 +0300 To: Sergey Kaplun , Maxim Kokryashkin Date: Thu, 1 Dec 2022 23:28:58 +0300 Message-Id: X-Mailer: git-send-email 2.34.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD908190A22B884CF14855A40DFE37B658E095539BC96655932182A05F53808504029E6AFC7D42828C7C018EF0796F9442023948F22E1629988634480B903D41B13 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE746D93DAA4671895CEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637A0569EA9A35E44F48638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8CFC5D445BC238147D927DF676D653E3E117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC4871F77D444DC01FA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520D76C6ED7039589DEF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8B851EDB9C5A93305EEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A5F5B0CC0EC307B4BA69C26F58FD99A348192006C818DA97BC4EAF44D9B582CE87C8A4C02DF684249CC203C45FEA855C8F X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34E318F287A436F24CCEAA582719417A5AAE0E44C11E40AD04F799CFD4752E6EC39D9421A1AD35A47D1D7E09C32AA3244CE5D4BC331DC0744C25C1F453E93FF93969B6CAE0477E908D927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojdH6LJGuFcapbnjUDoB2org== X-DA7885C5: F45F46DC0395F06EF04B55BE425D9EB7E756321CEF16A7ED5F912361F054783C262E2D401490A4A0DB037EFA58388B346E8BC1A9835FDE71 X-Mailru-Sender: 689FA8AB762F73933AF1F914F131DBF5B3D3888A2E6E375BA63B9EB47169270FA7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E3365FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 1/2] test: relax JIT setup in lj-430-maxirconst test 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: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" JIT engine setup in tarantool-tests/lj-430-maxirconst.test.lua is too tight for the build with LUAJIT_ENABLE_CHECKHOOK option enabled. Originally test limits value with 3 for the default IRRef constants set: nil, true, false. However, with LUAJIT_ENABLE_CHECKHOOK enabled there are three more auxiliary IRRef constants for the internal purposes. Hence, the test is reimplemented the following way: * The first trace for the empty function is recorded * The number of IRRef constants is obtained via * parameter is set to this value * The second trace for the function with a single local variable, initialized with a constant, fails to record As a result there is no need to explicitly respect any configuration. Relates to tarantool/tarantool#7762 Signed-off-by: Igor Munkin --- .../lj-430-maxirconst.test.lua | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/test/tarantool-tests/lj-430-maxirconst.test.lua b/test/tarantool-tests/lj-430-maxirconst.test.lua index cd3587a8..eaa0cd1b 100644 --- a/test/tarantool-tests/lj-430-maxirconst.test.lua +++ b/test/tarantool-tests/lj-430-maxirconst.test.lua @@ -1,8 +1,3 @@ --- XXX: avoid any other traces compilation due to hotcount --- collisions for predictable results. -jit.off() -jit.flush() - -- Disabled on *BSD due to #4819. require('utils').skipcond(jit.os == 'BSD', 'Disabled due to #4819') @@ -12,10 +7,6 @@ local traceinfo = require('jit.util').traceinfo local test = tap.test('lj-430-maxirconst') test:plan(2) --- XXX: trace always has at least 3 IR constants: for nil, false --- and true. -jit.opt.start('hotloop=1', 'maxirconst=3') - -- This function has only 3 IR constant. local function irconst3() end @@ -25,6 +16,12 @@ local function irconst4() local _ = 42 end +-- XXX: Avoid any other traces compilation due to hotcount +-- collisions for predictable results. +jit.off() +jit.flush() +jit.opt.start('hotloop=1') + assert(not traceinfo(1), 'no traces compiled after flush') jit.on() irconst3() @@ -32,6 +29,14 @@ irconst3() jit.off() test:ok(traceinfo(1), 'new trace created') +-- XXX: Trace 1 always has at least 3 IR constants: for nil, false +-- and true. In case when LUAJIT_ENABLE_CHECKHOOK is set to ON, +-- three more constants are emitted to the trace. +-- Tight up and try to record the next trace with one +-- more constant to be emitted. +jit.opt.start(('maxirconst=%d'):format(traceinfo(1).nk)) + +assert(not traceinfo(2), 'only one trace is created to this moment') jit.on() irconst4() irconst4() -- 2.34.0