diff options
author | fesily <fesil@foxmail.com> | 2023-05-15 15:52:23 +0800 |
---|---|---|
committer | fesily <fesil@foxmail.com> | 2023-05-15 15:52:23 +0800 |
commit | 2372d6ee9cdf34cb0feb78a32f5b82f8b9074d9f (patch) | |
tree | b0e38f0de7a77e440a72748b4c51942a3adf90f3 | |
parent | bc2dfd01e1b740c0924196dc5064abde1d067aae (diff) | |
download | lua-language-server-2372d6ee9cdf34cb0feb78a32f5b82f8b9074d9f.zip |
move other file
-rw-r--r-- | doc/en-us/config.md | 2 | ||||
-rw-r--r-- | doc/pt-br/config.md | 2 | ||||
-rw-r--r-- | doc/zh-cn/config.md | 2 | ||||
-rw-r--r-- | doc/zh-tw/config.md | 2 | ||||
-rw-r--r-- | meta/template/jit.lua | 133 | ||||
-rw-r--r-- | meta/template/jit.profile.lua | 20 | ||||
-rw-r--r-- | meta/template/jit.util.lua | 120 | ||||
-rw-r--r-- | script/proto/define.lua | 38 |
8 files changed, 168 insertions, 151 deletions
diff --git a/doc/en-us/config.md b/doc/en-us/config.md index 76ae7124..f153dd99 100644 --- a/doc/en-us/config.md +++ b/doc/en-us/config.md @@ -1665,6 +1665,8 @@ object<string, string> "ffi": "default", "io": "default", "jit": "default", + "jit.profile": "default", + "jit.util": "default", "math": "default", "os": "default", "package": "default", diff --git a/doc/pt-br/config.md b/doc/pt-br/config.md index 0d912b0f..73eb6658 100644 --- a/doc/pt-br/config.md +++ b/doc/pt-br/config.md @@ -1664,6 +1664,8 @@ object<string, string> "ffi": "default", "io": "default", "jit": "default", + "jit.profile": "default", + "jit.util": "default", "math": "default", "os": "default", "package": "default", diff --git a/doc/zh-cn/config.md b/doc/zh-cn/config.md index 9ddffb9e..3563b62f 100644 --- a/doc/zh-cn/config.md +++ b/doc/zh-cn/config.md @@ -1664,6 +1664,8 @@ object<string, string> "ffi": "default", "io": "default", "jit": "default", + "jit.profile": "default", + "jit.util": "default", "math": "default", "os": "default", "package": "default", diff --git a/doc/zh-tw/config.md b/doc/zh-tw/config.md index bb7169d4..8332d721 100644 --- a/doc/zh-tw/config.md +++ b/doc/zh-tw/config.md @@ -1664,6 +1664,8 @@ object<string, string> "ffi": "default", "io": "default", "jit": "default", + "jit.profile": "default", + "jit.util": "default", "math": "default", "os": "default", "package": "default", diff --git a/meta/template/jit.lua b/meta/template/jit.lua index 72749814..b047ba4e 100644 --- a/meta/template/jit.lua +++ b/meta/template/jit.lua @@ -34,143 +34,10 @@ end function jit.status() end -jit.profile = {} - ----@param mode string ----@param func fun(L:thread,samples:integer,vmst:string) -function jit.profile.start(mode, func) -end - -function jit.profile.stop() -end - ----@overload fun(th:thread,fmt:string,depth:integer) ----@param fmt string ----@param depth integer -function jit.profile.dumpstack(fmt, depth) -end - ----@class Trace ----@class Proto - -jit.util = {} - ----@class jit.funcinfo.lua -local funcinfo = { - linedefined = 0, - lastlinedefined = 0, - stackslots = 0, - params = 0, - bytecodes = 0, - gcconsts = 0, - nconsts = 0, - upvalues = 0, - currentline = 0, - isvararg = false, - children = false, - source = "", - loc = "", - ---@type Proto[] - proto = {} -} - ----@class jit.funcinfo.c ----@field ffid integer|nil -local funcinfo2 = { - addr = 0, - upvalues = 0, -} - - ----@param func function ----@param pc? integer ----@return jit.funcinfo.c|jit.funcinfo.lua info -function jit.util.funcinfo(func, pc) -end - ----@param func function ----@param pc integer ----@return integer? ins ----@return integer? m -function jit.util.funcbc(func, pc) -end - ----@param func function ----@param idx integer ----@return any? k -function jit.util.funck(func, idx) -end - ----@param func function ----@param idx integer ----@return string? name -function jit.util.funcuvname(func, idx) -end - ----@class jit.traceinfo -local traceinfo = { - nins = 0, - nk=0, - link=0, - nexit=0, - linktype = "" -} - ----@param tr Trace ----@return jit.traceinfo? info -function jit.util.traceinfo(tr) -end - ----@param tr Trace ----@param ref integer ----@return integer? m ----@return integer? ot ----@return integer? op1 ----@return integer? op2 ----@return integer? prev -function jit.util.traceir(tr, ref) -end - ----@param tr Trace ----@param idx integer ----@return any? k ----@return integer? t ----@return integer? slot -function jit.util.tracek(tr, idx) -end - ----@class jit.snap : integer[] - ----@param tr Trace ----@param sn integer ----@return jit.snap? snap -function jit.util.tracesnap(tr, sn) -end - ----@param tr Trace ----@return string? mcode ----@return integer? addr ----@return integer? loop -function jit.util.tracemc(tr) -end - ----@overload fun(exitno:integer):integer ----@param tr Trace ----@param exitno integer ----@return integer? addr -function jit.util.traceexitstub(tr, exitno) -end - ----@param idx integer ----@return integer? addr -function jit.util.ircalladdr(idx) -end - jit.opt = {} ---@param ... any flags function jit.opt.start(...) - end return jit diff --git a/meta/template/jit.profile.lua b/meta/template/jit.profile.lua new file mode 100644 index 00000000..d0e788ce --- /dev/null +++ b/meta/template/jit.profile.lua @@ -0,0 +1,20 @@ +---#if not JIT then DISABLE() end +---@meta jit.profile + +local profile = {} + +---@param mode string +---@param func fun(L:thread,samples:integer,vmst:string) +function profile.start(mode, func) +end + +function profile.stop() +end + +---@overload fun(th:thread,fmt:string,depth:integer) +---@param fmt string +---@param depth integer +function profile.dumpstack(fmt, depth) +end + +return profile
\ No newline at end of file diff --git a/meta/template/jit.util.lua b/meta/template/jit.util.lua new file mode 100644 index 00000000..08694286 --- /dev/null +++ b/meta/template/jit.util.lua @@ -0,0 +1,120 @@ +---#if not JIT then DISABLE() end +---@meta jit.util + +---@class Trace +---@class Proto + +local util = {} + +---@class jit.funcinfo.lua +local funcinfo = { + linedefined = 0, + lastlinedefined = 0, + stackslots = 0, + params = 0, + bytecodes = 0, + gcconsts = 0, + nconsts = 0, + upvalues = 0, + currentline = 0, + isvararg = false, + children = false, + source = "", + loc = "", + ---@type Proto[] + proto = {} +} + +---@class jit.funcinfo.c +---@field ffid integer|nil +local funcinfo2 = { + addr = 0, + upvalues = 0, +} + + +---@param func function +---@param pc? integer +---@return jit.funcinfo.c|jit.funcinfo.lua info +function util.funcinfo(func, pc) +end + +---@param func function +---@param pc integer +---@return integer? ins +---@return integer? m +function util.funcbc(func, pc) +end + +---@param func function +---@param idx integer +---@return any? k +function util.funck(func, idx) +end + +---@param func function +---@param idx integer +---@return string? name +function util.funcuvname(func, idx) +end + +---@class jit.traceinfo +local traceinfo = { + nins = 0, + nk = 0, + link = 0, + nexit = 0, + linktype = "" +} + +---@param tr Trace +---@return jit.traceinfo? info +function util.traceinfo(tr) +end + +---@param tr Trace +---@param ref integer +---@return integer? m +---@return integer? ot +---@return integer? op1 +---@return integer? op2 +---@return integer? prev +function util.traceir(tr, ref) +end + +---@param tr Trace +---@param idx integer +---@return any? k +---@return integer? t +---@return integer? slot +function util.tracek(tr, idx) +end + +---@class jit.snap : integer[] + +---@param tr Trace +---@param sn integer +---@return jit.snap? snap +function util.tracesnap(tr, sn) +end + +---@param tr Trace +---@return string? mcode +---@return integer? addr +---@return integer? loop +function util.tracemc(tr) +end + +---@overload fun(exitno:integer):integer +---@param tr Trace +---@param exitno integer +---@return integer? addr +function util.traceexitstub(tr, exitno) +end + +---@param idx integer +---@return integer? addr +function util.ircalladdr(idx) +end + +return util diff --git a/script/proto/define.lua b/script/proto/define.lua index 1bc1000d..77e7a77d 100644 --- a/script/proto/define.lua +++ b/script/proto/define.lua @@ -166,24 +166,26 @@ m.TokenTypes = { } m.BuiltIn = { - ['basic'] = 'default', - ['bit'] = 'default', - ['bit32'] = 'default', - ['builtin'] = 'default', - ['coroutine'] = 'default', - ['debug'] = 'default', - ['ffi'] = 'default', - ['io'] = 'default', - ['jit'] = 'default', - ['math'] = 'default', - ['os'] = 'default', - ['package'] = 'default', - ['string'] = 'default', - ['table'] = 'default', - ['table.new'] = 'default', - ['table.clear'] = 'default', - ['utf8'] = 'default', - ['string.buffer']='default', + ['basic'] = 'default', + ['bit'] = 'default', + ['bit32'] = 'default', + ['builtin'] = 'default', + ['coroutine'] = 'default', + ['debug'] = 'default', + ['ffi'] = 'default', + ['io'] = 'default', + ['jit'] = 'default', + ['jit.profile'] = 'default', + ['jit.util'] = 'default', + ['math'] = 'default', + ['os'] = 'default', + ['package'] = 'default', + ['string'] = 'default', + ['table'] = 'default', + ['table.new'] = 'default', + ['table.clear'] = 'default', + ['utf8'] = 'default', + ['string.buffer'] = 'default', } m.InlayHintKind = { |