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 9C3B9C7CE42; Wed, 21 Aug 2024 12:21:03 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9C3B9C7CE42 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1724232063; bh=CRuweJy5ITYcXfpfSrazyz1lVU2jfDnf0hN3EOFIiOM=; 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=LvYLuXHGGBsVCAfL9kw4VKSnhc5N99SH+8Xxe9JcmJWm+hk38vpP/mTN2fvgJwoRi +rmQBhD11y7qCmJ2wLfFrj54+tWEQHRAoEfPK1fra3Oysyo/EC+gay82RafrDvnaHo rdGufoN0egs1cT/vPXV6jDkHUSfLHOpvAhESDAHI= Received: from smtp35.i.mail.ru (smtp35.i.mail.ru [95.163.41.76]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 3D5FCC6DD83 for ; Wed, 21 Aug 2024 12:03:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3D5FCC6DD83 Received: by smtp35.i.mail.ru with esmtpa (envelope-from ) id 1sghFE-00000005aRz-0q9J; Wed, 21 Aug 2024 12:03:08 +0300 To: Maxim Kokryashkin , Sergey Bronnikov Date: Wed, 21 Aug 2024 11:58:47 +0300 Message-ID: <84ec3e8d5f88f0f040187b798f5efaa77923b777.1724228998.git.skaplun@tarantool.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD93D5A650E6D4F687E9C3FD643FCC13A466318113F8129A21C182A05F53808504060BA0BA2160B877ED27678DDAA8063143A54992610BAF097EFF80BD07D1CDB79BC0FEE398BF55443 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7CE4525FFB91B9BBCEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637D82ED515D6052E03EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38B043BF0FB74779F3673554BE3E2F4698CB871019616B657E78E112CFCF3CB0F8AA471835C12D1D9774AD6D5ED66289B5278DA827A17800CE70F3DDF2BBF19B93A9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C3E97D2AE7161E217F117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637FB177F6A8366F17BEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A5B7C97CB8D363AC615002B1117B3ED696F18A70EE418E42E972305013E4AE841E823CB91A9FED034534781492E4B8EEAD09F854029C6BD0DAC79554A2A72441328621D336A7BC284946AD531847A6065A535571D14F44ED41 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF14305C7E51716A7C92EC9606071146CE6CBE770C7EE087D10C45C376D596CDFF0070534DE2CB11AAD14E51FF79EEE603BC6C4218374E1730B2A94BCD9D7316CE62363A7FB91BFCF5C226CC413062362A913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojegttVMu7AX/ckw/mWGDglw== X-DA7885C5: 9D675A33D9C10799F255D290C0D534F98D34E719BB4BEEF90452CB7ADE292F07F4AAE5BB712A8B2C5B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393C6D0B12EA33CAA9B54E5FEF2BE197CF9DAC77899D9C4377F839B80610349A87DE49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: [Tarantool-patches] [PATCH v2 luajit 44/45] test: enable LuaJIT 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: 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" This patch moves the aforementioned test to the test, with refactoring to restore the JIT engine and GC settings after the test. Part of tarantool/tarantool#9398 --- test/LuaJIT-tests/misc/wbarrier_obar.lua | 22 ------------- test/LuaJIT-tests/trace/wbarrier.lua | 41 ++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 22 deletions(-) delete mode 100644 test/LuaJIT-tests/misc/wbarrier_obar.lua diff --git a/test/LuaJIT-tests/misc/wbarrier_obar.lua b/test/LuaJIT-tests/misc/wbarrier_obar.lua deleted file mode 100644 index 258db215..00000000 --- a/test/LuaJIT-tests/misc/wbarrier_obar.lua +++ /dev/null @@ -1,22 +0,0 @@ --- DSE of USTORE must eliminate OBAR, too. - -if jit and jit.opt then pcall(jit.opt.start, "-sink") end - -local f -do - local x - f = function() - local y = 0 - for i=1,10000 do - x = {1} - if y > 0 then end - x = 1 - end - end -end - -collectgarbage() -collectgarbage("setstepmul", 1) -collectgarbage("restart") -f() - diff --git a/test/LuaJIT-tests/trace/wbarrier.lua b/test/LuaJIT-tests/trace/wbarrier.lua index 625c0ff2..9c9c50af 100644 --- a/test/LuaJIT-tests/trace/wbarrier.lua +++ b/test/LuaJIT-tests/trace/wbarrier.lua @@ -1,3 +1,12 @@ +local function jit_opt_is_on(needed) + for _, opt in ipairs({jit.status()}) do + if opt == needed then + return true + end + end + return false +end + do --- TBAR for HSTORE. local t = {[0]={}} for i = 1, 1e5 do t[i] = {t[i - 1]} end @@ -14,3 +23,35 @@ do --- OBAR for USTORE. end f() end + +do --- DSE of USTORE must eliminate OBAR too. + local need_restore_sink = false + if jit_opt_is_on("sink") then + need_restore_sink = true + jit.opt.start("-sink") + end + + local f + do + local x + f = function() + local y = 0 + for _ = 1, 10000 do + x = {1} + if y > 0 then end + x = 1 + end + end + end + + collectgarbage() + local oldstepmul = collectgarbage("setstepmul", 1) + collectgarbage("restart") + + f() + + collectgarbage("setstepmul", oldstepmul) + if need_restore_sink then + jit.opt.start("+sink") + end +end -- 2.45.2