<!DOCTYPE html>
<html data-lt-installed="true">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body style="padding-bottom: 1px;">
<p>Sergey,<br>
</p>
<div class="moz-cite-prefix">On 21.08.2024 11:58, Sergey Kaplun
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:e861c4713b473dd5ef9e507b5cc541ddc1388a95.1724228998.git.skaplun@tarantool.org">
<pre class="moz-quote-pre" wrap="">This patch moves the aforementioned test from the <misc> to the <trace/>
directory, includes it in <index>, and names subtests.
The first test is adjusted to be runable in the test suite.
Part of tarantool/tarantool#9398
---</pre>
</blockquote>
thanks for the patch! LGTM<br>
<blockquote type="cite"
cite="mid:e861c4713b473dd5ef9e507b5cc541ddc1388a95.1724228998.git.skaplun@tarantool.org">
<pre class="moz-quote-pre" wrap="">
.../{misc/gc_trace.lua => trace/gc.lua} | 30 +++++++++++--------
test/LuaJIT-tests/trace/index | 1 +
2 files changed, 18 insertions(+), 13 deletions(-)
rename test/LuaJIT-tests/{misc/gc_trace.lua => trace/gc.lua} (56%)
diff --git a/test/LuaJIT-tests/misc/gc_trace.lua b/test/LuaJIT-tests/trace/gc.lua
similarity index 56%
rename from test/LuaJIT-tests/misc/gc_trace.lua
rename to test/LuaJIT-tests/trace/gc.lua
index bc38ce0c..43d7ae55 100644
--- a/test/LuaJIT-tests/misc/gc_trace.lua
+++ b/test/LuaJIT-tests/trace/gc.lua
@@ -1,18 +1,23 @@
+local jutil = require("jit.util")
-if not jit or not jit.status or not jit.status() then return end
-
-collectgarbage()
-for j=1,100 do
- loadstring("for i=1,100 do end")()
+do --- Collect dead traces.
+ jit.flush()
+ collectgarbage()
+ -- Prevent the creation of side traces.
+ jit.off()
+ for j=1,100 do
+ jit.on()
+ loadstring("for i=1,100 do end")()
+ jit.off()
+ end
+ jit.on()
+ collectgarbage()
+ assert(jutil.traceinfo(1) == nil)
+ assert(jutil.traceinfo(2) == nil)
+ assert(jutil.traceinfo(3) == nil)
end
-local jutil = require("jit.util")
-assert(jutil.traceinfo(90) == nil)
-collectgarbage()
-assert(jutil.traceinfo(1) == nil)
-assert(jutil.traceinfo(2) == nil)
-assert(jutil.traceinfo(3) == nil)
-do
+do --- Check KGC marking.
local f
local function reccb(tr)
if f == nil then
@@ -34,4 +39,3 @@ do
end
jit.attach(reccb)
end
-
diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
index ea7a22e0..46c8f5d2 100644
--- a/test/LuaJIT-tests/trace/index
+++ b/test/LuaJIT-tests/trace/index
@@ -1,6 +1,7 @@
exit_frame.lua
exit_growstack.lua
exit_jfuncf.lua
+gc.lua
gc64_slot_revival.lua
phi
snap.lua
</pre>
</blockquote>
</body>
<lt-container></lt-container>
</html>