@@ -20,6 +20,23 @@ type jit_attach_texit = function=(
2020 ngpr: number, -- the number of general-purpose and floating point registers that are active at the exit
2121 nfpr: number -- the number of general-purpose and floating point registers that are active at the exit
2222)>(nil)
23+ type jit_util_funcinfo = {
24+ linedefined = number,
25+ lastlinedefined = number,
26+ params = number,
27+ stackslots = number,
28+ upvalues = number,
29+ bytecodes = number,
30+ gcconsts = number,
31+ nconsts = number,
32+ children = boolean,
33+ currentline = number,
34+ isvararg = boolean,
35+ source = string,
36+ loc = string,
37+ ffid = nil | number,
38+ addr = nil | number,
39+ }
2340type Modules["jit.dis_x86"] = {}
2441type Modules["jit.dis_x64"] = {}
2542type Modules["jit.dis_arm"] = {}
@@ -33,9 +50,9 @@ type Modules["jit.opt"] = {
3350 start = function=(...string)>(nil),
3451}
3552type jit = {
53+ attach = (function=(jit_attach_bc, "bc")>(nil) | function=(jit_attach_trace, "trace")>(nil) | function=(jit_attach_record, "record")>(nil) | function=(jit_attach_texit, "texit")>(nil) | function=(Function, nil | "bc" | "trace" | "record" | "texit")>(nil)),
3654 os = "Windows" | "Linux" | "OSX" | "BSD" | "POSIX" | "Other",
3755 arch = "x86" | "x64" | "arm" | "arm64" | "ppc" | "mips" | "mips64" | "mips64el" | "riscv64",
38- attach = (function=(jit_attach_bc, "bc")>(nil) | function=(jit_attach_trace, "trace")>(nil) | function=(jit_attach_record, "record")>(nil) | function=(jit_attach_texit, "texit")>(nil) | function=(Function, nil | "bc" | "trace" | "record" | "texit")>(nil)),
3956 tracebarrier = function=()>(nil),
4057 version_num = number,
4158 version = string,
@@ -63,25 +80,7 @@ type Modules["jit.profile"] = {
6380}
6481type Modules["jit.util"] = {
6582 -- Retrieves LuaJIT information about a given function, similarly to debug.getinfo
66- funcinfo = function=(Function, position: number | nil)>(
67- {
68- linedefined = number,
69- lastlinedefined = number,
70- params = number,
71- stackslots = number,
72- upvalues = number,
73- bytecodes = number,
74- gcconsts = number,
75- nconsts = number,
76- children = boolean,
77- currentline = number,
78- isvararg = boolean,
79- source = string,
80- loc = string,
81- ffid = nil | number,
82- addr = nil | number,
83- }
84- ),
83+ funcinfo = function=(Function, position: number | nil)>(jit_util_funcinfo),
8584 -- Get bytecode instruction at given position
8685 funcbc = function=(func: Function, pc: number)>(number, number), -- returns (ins, m)
8786 -- Get upvalue name for function
@@ -110,4 +109,4 @@ type Modules["jit.util"] = {
110109 ircalladdr = function=(index: number)>(number),
111110 -- Get trace machine code
112111 tracemc = function=(tr: number)>(string, number, number), -- returns (mcode, addr, loop)
113- }
112+ }
0 commit comments