jit.zone (Profiler Zones) Reference
Module defined in `lua/common/jit/zone.lua`. Implements a simple hierarchical zone stack for the LuaJIT profiler. Zones label code sections for profiling output.
Module defined in lua/common/jit/zone.lua. Implements a simple hierarchical zone stack for the LuaJIT profiler. Zones label code sections for profiling output.
Exports
Returns a callable table (via __call metamethod) - no traditional M exports.
Usage
local zone = require("jit.zone")
zone("AI") -- push zone
zone("A*") -- push nested zone
print(zone:get()) -- "A*"
zone() -- pop "A*"
print(zone:get()) -- "AI"
zone() -- pop "AI"Methods
zone(name)
Push a named zone onto the stack. Call with no arguments to pop.
- Parameters:
name- string|nil - Zone name to push, or nil to pop
- Returns: string - The popped zone name (when popping)
zone:get()
Get the current (topmost) zone name.
- Returns: string|nil - Current zone name
zone:flush()
Clear the entire zone stack.
Internal Notes
- Implemented as a plain table with metatable
__call - Stack is the table itself (integer-indexed)
- Popping an empty stack triggers an assertion error
- Used with
jit.pzflag to show zones in profiler output
jit.vmdef (VM Definitions) Reference
Module defined in `lua/common/jit/vmdef.lua`. Auto-generated file containing LuaJIT VM bytecode names, IR names, IR field definitions, and C function call mappings. **DO NOT EDIT** - generated by LuaJ
binaryheap Reference
Module defined in `lua/common/libs/binaryheap/binaryheap.lua`. Binary heap (priority queue) data structure implementation.