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 68689C1824B; Wed, 14 Aug 2024 17:15:03 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 68689C1824B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1723644903; 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=iBrbyQEbD1zAUuXp6q+0j7TSJ9/vX3YiJLL4QjZQ5tB9SlDaNRk2gvK3sZM81RFhJ p9URtJDeW59alHs2WaiihANw0rwrTe1zRFkrFiVbjymJHvx4IJVExzV/dHX0LsLFoC ft1wc0Lwr9zlxy43ymgUJx+haltWKlcrQgdgsHjE= Received: from smtp45.i.mail.ru (smtp45.i.mail.ru [95.163.41.83]) (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 8503BC13ACD for ; Wed, 14 Aug 2024 16:58:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8503BC13ACD Received: by smtp45.i.mail.ru with esmtpa (envelope-from ) id 1seEWW-00000003nAF-2HJa; Wed, 14 Aug 2024 16:58:48 +0300 To: Maxim Kokryashkin , Sergey Bronnikov Date: Wed, 14 Aug 2024 16:56:18 +0300 Message-ID: <9e5b28f87b0b51c9c001ec38dba3d5f0b2b47109.1723638851.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: 4F1203BC0FB41BD9D7B6E71A78C20FB9969443CE02F730EADE0A60473FBA4966182A05F538085040240A6E4CB490C0E2A6D5EE0DB6E1EC8D94526C7CACB1AB05129B12038A8E527C3DBFFC9DE3409321 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7AD2F2D6F6013FF7FC2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE7374BF80023594226EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38B043BF0FB74779F360FC6E0247434AEB0748B3677A9AF800628E3DF56EC02C626A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE77E7E81EEA8A9722B8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6D6FBC3EC642A93BBCC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C22499F5E362153655AB1D81D268191BDAD3DBD4B6F7A4D31EC0BE2F48590F00D11D6D81D268191BDAD3D78DA827A17800CE786A01F665E7D37C5B3661434B16C20ACC84D3B47A649675FE827F84554CEF5019E625A9149C048EE33AC447995A7AD182BEBFE083D3B9BA73A03B725D353964B2FFDA4F57982C5F435872C767BF85DA227C277FBC8AE2E8B851EDB9C5A93305EEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A5B4ACFB08502B5D085002B1117B3ED696A3A3E126761CC409250A03108B67251B823CB91A9FED034534781492E4B8EEAD6804EF05EF4ADF2AF36E2E0160E5C55395B8A2A0B6518DF68C46860778A80D548E8926FB43031F38 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFDE9604CC1A5F25434086EFE18FAD156567BC218CE5F56DE47737504A599905058D4FFD5EE5365399470327EB0AC8E69380246E41A86106D7E98BAB6BFF30A47807E56E1AA7728791C226CC413062362A913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojnMg09N3zL/hGgtHXFZytrQ== X-Mailru-Sender: 520A125C2F17F0B1A9638AD358559B59DE513AF210127027A6D5EE0DB6E1EC8D94526C7CACB1AB05B7CBEF92542CD7C88B0A2698F12F5C9EC77752E0C033A69E86920BD37369036789A8C6A0E60D2BB63A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 36/36] 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