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 50075C99149; Thu, 15 Aug 2024 16:09:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 50075C99149 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1723727398; bh=HrmzFkPq92kNyuzbqMBrcJBe5G/3V69hT7p8lXb2lVY=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Rrm2LUuOnKxS2bwo6WHnbhVJIiFmOmQ6HpQkZU5qinyuY3s9i12FRFgxb+2uCIXbv XK1ZkdmhvSQE6my5FoJ0nqLva3K0dS6iMf2S+QkLGzGu2kR/5QO9PgBJFjTW2kiNws HVBryPiMfMwXqcTOmk54D7QekFIFzmE0rAD6Ho6Y= Received: from smtp43.i.mail.ru (smtp43.i.mail.ru [95.163.41.66]) (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 25C50C99142 for ; Thu, 15 Aug 2024 16:09:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 25C50C99142 Received: by smtp43.i.mail.ru with esmtpa (envelope-from ) id 1seaEm-00000003J4t-1w0T; Thu, 15 Aug 2024 16:09:56 +0300 Content-Type: multipart/alternative; boundary="------------ZPbvap60SsX2Rt5zjWeapwW5" Message-ID: Date: Thu, 15 Aug 2024 16:09:55 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun , Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org References: <5913e9693652ea13ca55be9de17697144df81749.1723638851.git.skaplun@tarantool.org> In-Reply-To: <5913e9693652ea13ca55be9de17697144df81749.1723638851.git.skaplun@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD9F97E3C14763C38E2F8667C40DD8CE92DDCF89D65A2CC9925182A05F538085040BEE498CD0BC401C8A6D5EE0DB6E1EC8D6F945007959C70FC0D0D019245ED27CD03E6B8BB9284AB6F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7F09446BC3D835A58EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637B12C6B1582157D838638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8187C0D6D37EBF9E88BECFED0A8EE9ECBB97498BB38AC94E4CC7F00164DA146DAFE8445B8C89999728AA50765F7900637F6B57BC7E64490618DEB871D839B7333395957E7521B51C2DFABB839C843B9C08941B15DA834481F8AA50765F7900637D0FEED2715E18529389733CBF5DBD5E9B5C8C57E37DE458BD9DD9810294C998ED8FC6C240DEA76428AA50765F790063790495A4AD0498982D81D268191BDAD3DBD4B6F7A4D31EC0BE2F48590F00D11D6D81D268191BDAD3D78DA827A17800CE72B056A9979167638EC76A7562686271ED91E3A1F190DE8FD2E808ACE2090B5E14AD6D5ED66289B5259CC434672EE63711DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C30E7A8B1B1FD51AB935872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A5AF9BDFF7F8033AA65002B1117B3ED6960784C8BA39561D24484B8D70797403F6823CB91A9FED034534781492E4B8EEAD2B25D9E4C92BC8ACBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFA5FE7C27C813C34B1A9F5147BFDBE51B79719E7B5B5BA21404EB53EDEB0265582DC0EA915DEF7D0C470327EB0AC8E69374A5A65E271909EA57F4A8A49FDA77D86DD3D53F9A4D929F5F4332CA8FE04980913E6812662D5F2AB9AF64DB4688768036DF5FE9C0001AF333F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojD5rM0r3KxnExWJ3ud4o4jQ== X-Mailru-Sender: 520A125C2F17F0B1E52FEF5D219D6140DF5450590868D690C75395E4863EAA7FAA83E4C2427E375E0152A3D17938EB451EB5A0BCEC6A560B3DDE9B364B0DF289BE2DA36745F2EEB5CEBA01FB949A1F1EEAB4BC95F72C04283CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 05/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 Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This is a multi-part message in MIME format. --------------ZPbvap60SsX2Rt5zjWeapwW5 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Sergey! thanks for the patch! On 14.08.2024 16:55, Sergey Kaplun wrote: > This patch moves the aforementioned test from the to the It is not clear why do you move it to another suite/dir. > directory (with slightly renaming to be consistent with other names), > includes it in , and names the subtest. > > Also, it changes the number of iterations to trigger the GC since the > number of objects is different when running the test as a part of the > LuaJIT test suite. the patch contains minor changes related to formatting. please describe it in commit message. > Part of tarantool/tarantool#9398 > --- > .../{misc/debug_gc.lua => lang/gc_debug.lua} | 31 ++++++++++++------- > test/LuaJIT-tests/lang/index | 1 + > 2 files changed, 20 insertions(+), 12 deletions(-) > rename test/LuaJIT-tests/{misc/debug_gc.lua => lang/gc_debug.lua} (63%) > > diff --git a/test/LuaJIT-tests/misc/debug_gc.lua b/test/LuaJIT-tests/lang/gc_debug.lua > similarity index 63% > rename from test/LuaJIT-tests/misc/debug_gc.lua > rename to test/LuaJIT-tests/lang/gc_debug.lua > index 30fb2b99..bb30adc1 100644 > --- a/test/LuaJIT-tests/misc/debug_gc.lua > +++ b/test/LuaJIT-tests/lang/gc_debug.lua > @@ -1,12 +1,7 @@ > - > --- Do not run this test unless the JIT compiler is turned off. > -if jit and jit.status and jit.status() then return end > - > local caught, caught_line, caught_mm > > local function gcmeta() > if caught ~= "end" then > --- print(debug.traceback()) > -- This may point to the wrong instruction if in a JIT trace. > -- But there's no guarantee if, when or where any GC steps occur. > local dbg = debug.getinfo(2) > @@ -22,7 +17,7 @@ local function testgc(mm, f) > local u = newproxy(true) > getmetatable(u).__gc = gcmeta > u = nil > - for i=1,100000 do > + for i = 1, 1e7 do > f(i) > -- This check may be hoisted. __gc is not supposed to have side-effects. > if caught then break end > @@ -38,10 +33,22 @@ local function testgc(mm, f) > end > end > > -local x > -testgc("__gc", function(i) x = {} end) > -testgc("__gc", function(i) x = {1} end) > -testgc("__gc", function(i) x = function() end end) > -testgc("__concat", function(i) x = i.."" end) > +do --- Test __gc metamethod info > + -- Do not run this test unless the JIT compiler is turned off. > + local jit_need_restore = false > + if jit and jit.status and jit.status() then > + jit_need_restore = true > + jit.off() > + end > + > + local x > + testgc("__gc", function(i) x = {} end) > + testgc("__gc", function(i) x = {1} end) > + testgc("__gc", function(i) x = function() end end) > + testgc("__concat", function(i) x = i.."" end) > > -caught = "end" > + caught = "end" > + if jit_need_restore then > + jit.on() > + end > +end > diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index > index 803f32d8..4d9feafd 100644 > --- a/test/LuaJIT-tests/lang/index > +++ b/test/LuaJIT-tests/lang/index > @@ -17,5 +17,6 @@ upvalue > tail_recursion.lua > vararg_jit.lua > gc.lua > +gc_debug.lua > goto.lua +goto > meta --------------ZPbvap60SsX2Rt5zjWeapwW5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi, Sergey!

thanks for the patch!

On 14.08.2024 16:55, Sergey Kaplun wrote:
This patch moves the aforementioned test from the <misc> to the <lang/>
It is not clear why do you move it to another suite/dir.
directory (with slightly renaming to be consistent with other names),
includes it in <index>, and names the subtest.

Also, it changes the number of iterations to trigger the GC since the
number of objects is different when running the test as a part of the
LuaJIT test suite.

the patch contains minor changes related to formatting.

please describe it in commit message.


Part of tarantool/tarantool#9398
---
 .../{misc/debug_gc.lua => lang/gc_debug.lua}  | 31 ++++++++++++-------
 test/LuaJIT-tests/lang/index                  |  1 +
 2 files changed, 20 insertions(+), 12 deletions(-)
 rename test/LuaJIT-tests/{misc/debug_gc.lua => lang/gc_debug.lua} (63%)

diff --git a/test/LuaJIT-tests/misc/debug_gc.lua b/test/LuaJIT-tests/lang/gc_debug.lua
similarity index 63%
rename from test/LuaJIT-tests/misc/debug_gc.lua
rename to test/LuaJIT-tests/lang/gc_debug.lua
index 30fb2b99..bb30adc1 100644
--- a/test/LuaJIT-tests/misc/debug_gc.lua
+++ b/test/LuaJIT-tests/lang/gc_debug.lua
@@ -1,12 +1,7 @@
-
--- Do not run this test unless the JIT compiler is turned off.
-if jit and jit.status and jit.status() then return end
-
 local caught, caught_line, caught_mm
 
 local function gcmeta()
   if caught ~= "end" then
---    print(debug.traceback())
     -- This may point to the wrong instruction if in a JIT trace.
     -- But there's no guarantee if, when or where any GC steps occur.
     local dbg = debug.getinfo(2)
@@ -22,7 +17,7 @@ local function testgc(mm, f)
   local u = newproxy(true)
   getmetatable(u).__gc = gcmeta
   u = nil
-  for i=1,100000 do
+  for i = 1, 1e7 do
     f(i)
     -- This check may be hoisted. __gc is not supposed to have side-effects.
     if caught then break end
@@ -38,10 +33,22 @@ local function testgc(mm, f)
   end
 end
 
-local x
-testgc("__gc", function(i) x = {} end)
-testgc("__gc", function(i) x = {1} end)
-testgc("__gc", function(i) x = function() end end)
-testgc("__concat", function(i) x = i.."" end)
+do --- Test __gc metamethod info
+  -- Do not run this test unless the JIT compiler is turned off.
+  local jit_need_restore = false
+  if jit and jit.status and jit.status() then
+    jit_need_restore = true
+    jit.off()
+  end
+
+  local x
+  testgc("__gc", function(i) x = {} end)
+  testgc("__gc", function(i) x = {1} end)
+  testgc("__gc", function(i) x = function() end end)
+  testgc("__concat", function(i) x = i.."" end)
 
-caught = "end"
+  caught = "end"
+  if jit_need_restore then
+     jit.on()
+  end
+end
diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
index 803f32d8..4d9feafd 100644
--- a/test/LuaJIT-tests/lang/index
+++ b/test/LuaJIT-tests/lang/index
@@ -17,5 +17,6 @@ upvalue
 tail_recursion.lua
 vararg_jit.lua
 gc.lua
+gc_debug.lua
 goto.lua +goto
 meta
--------------ZPbvap60SsX2Rt5zjWeapwW5--