<!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>Hi, Sergey</p>
<p>thanks for the patch!<br>
</p>
<div class="moz-cite-prefix">On 14.08.2024 16:55, Sergey Kaplun
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:f16ab72612cbf3cb7c7c1b66e9f9a591d074a817.1723638851.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.</pre>
</blockquote>
Please describe a reason.<br>
<blockquote type="cite"
cite="mid:f16ab72612cbf3cb7c7c1b66e9f9a591d074a817.1723638851.git.skaplun@tarantool.org">
<pre class="moz-quote-pre" wrap="">
The first test is adjusted to be runable in the test suite.
Part of tarantool/tarantool#9398
---
.../{misc/gc_trace.lua => trace/gc.lua} | 27 +++++++++----------
test/LuaJIT-tests/trace/index | 1 +
2 files changed, 14 insertions(+), 14 deletions(-)
rename test/LuaJIT-tests/{misc/gc_trace.lua => trace/gc.lua} (60%)
diff --git a/test/LuaJIT-tests/misc/gc_trace.lua b/test/LuaJIT-tests/trace/gc.lua
similarity index 60%
rename from test/LuaJIT-tests/misc/gc_trace.lua
rename to test/LuaJIT-tests/trace/gc.lua
index bc38ce0c..4d984ed6 100644
--- a/test/LuaJIT-tests/misc/gc_trace.lua
+++ b/test/LuaJIT-tests/trace/gc.lua
@@ -1,18 +1,18 @@
+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()
+ for _ = 1, 100 do
+ loadstring("for _ = 1, 100 do end")()
+ end
+ 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
@@ -24,7 +24,7 @@ do
end
end
jit.attach(reccb, "record")
- for i=1,200 do
+ for i = 1, 200 do
if i % 5 == 0 then
f = function() end
elseif f then
@@ -34,4 +34,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>