aboutsummaryrefslogtreecommitdiff
path: root/src/jit/p.lua
diff options
context:
space:
mode:
authorMike Pall <mike>2026-08-03 10:44:17 +0200
committerMike Pall <mike>2026-08-03 10:44:17 +0200
commitf30aabe82f61dbd6901f6a75dadde0a64dc626d2 (patch)
tree80eda65bf087e10b2a78d9b94bcec3a04ed4d2de /src/jit/p.lua
parent28084004ee68d576f3f0c9ea61ea448fe3e10f07 (diff)
downloadluajit-f30aabe82f61dbd6901f6a75dadde0a64dc626d2.tar.gz
luajit-f30aabe82f61dbd6901f6a75dadde0a64dc626d2.tar.bz2
luajit-f30aabe82f61dbd6901f6a75dadde0a64dc626d2.zip
Modernize jit.* Lua modules.
Diffstat (limited to 'src/jit/p.lua')
-rw-r--r--src/jit/p.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/jit/p.lua b/src/jit/p.lua
index 9d938ce56..bb04fbd21 100644
--- a/src/jit/p.lua
+++ b/src/jit/p.lua
@@ -120,7 +120,7 @@ end
120local function prof_top(count1, count2, samples, indent) 120local function prof_top(count1, count2, samples, indent)
121 local t, n = {}, 0 121 local t, n = {}, 0
122 for k in pairs(count1) do 122 for k in pairs(count1) do
123 n = n + 1 123 n += 1
124 t[n] = k 124 t[n] = k
125 end 125 end
126 sort(t, function(a, b) return count1[a] > count1[b] end) 126 sort(t, function(a, b) return count1[a] > count1[b] end)
@@ -184,7 +184,7 @@ local function prof_annotate(count1, samples)
184 out:write(format("\n====== %s ======\n", file)) 184 out:write(format("\n====== %s ======\n", file))
185 local fl = files[file] 185 local fl = files[file]
186 local n, show = 1, false 186 local n, show = 1, false
187 if ann ~= 0 then 187 if ann != 0 then
188 for i=1,ann do 188 for i=1,ann do
189 if fl[i] then show = true; out:write("@@ 1 @@\n"); break end 189 if fl[i] then show = true; out:write("@@ 1 @@\n"); break end
190 end 190 end
@@ -195,7 +195,7 @@ local function prof_annotate(count1, samples)
195 break 195 break
196 end 196 end
197 local v = fl[n] 197 local v = fl[n]
198 if ann ~= 0 then 198 if ann != 0 then
199 local v2 = fl[n+ann] 199 local v2 = fl[n+ann]
200 if show then 200 if show then
201 if v2 then show = n+ann elseif v then show = n 201 if v2 then show = n+ann elseif v then show = n
@@ -212,7 +212,7 @@ local function prof_annotate(count1, samples)
212 out:write(format(fmtn, line)) 212 out:write(format(fmtn, line))
213 end 213 end
214 ::next:: 214 ::next::
215 n = n + 1 215 n += 1
216 end 216 end
217 fp:close() 217 fp:close()
218 end 218 end
@@ -226,7 +226,7 @@ local function prof_finish()
226 profile.stop() 226 profile.stop()
227 local samples = prof_samples 227 local samples = prof_samples
228 if samples == 0 then 228 if samples == 0 then
229 if prof_raw ~= true then out:write("[No samples collected]\n") end 229 if prof_raw != true then out:write("[No samples collected]\n") end
230 elseif prof_ann then 230 elseif prof_ann then
231 prof_annotate(prof_count1, samples) 231 prof_annotate(prof_count1, samples)
232 else 232 else
@@ -235,7 +235,7 @@ local function prof_finish()
235 prof_count1 = nil 235 prof_count1 = nil
236 prof_count2 = nil 236 prof_count2 = nil
237 prof_ud = nil 237 prof_ud = nil
238 if out ~= stdout then out:close() end 238 if out != stdout then out:close() end
239 end 239 end
240end 240end
241 241
@@ -270,7 +270,7 @@ local function prof_start(mode)
270 prof_fmt = "pl" 270 prof_fmt = "pl"
271 prof_split = 0 271 prof_split = 0
272 prof_depth = 1 272 prof_depth = 1
273 elseif m.G and scope ~= "" then 273 elseif m.G and scope != "" then
274 prof_fmt = flags..scope.."Z;" 274 prof_fmt = flags..scope.."Z;"
275 prof_depth = -100 275 prof_depth = -100
276 prof_raw = true 276 prof_raw = true