TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/pw4k/ironbrew-2/llms.txt
Use this file to discover all available pages before exploring further.
Chunk class represents a compiled Lua function, containing all the bytecode instructions, constants, nested functions, and metadata needed to execute the function.
Namespace
Properties
The name of the chunk (function name or source file)
Starting line number in the source code
Ending line number in the source code
Number of upvalues referenced by this chunk
Number of parameters the function accepts
Flag indicating if the function uses varargs (…)
Maximum stack size required for execution
Current register offset for stack rebasing
Current parameter offset for stack rebasing
List of bytecode instructions in this chunk
Maps instructions to their index positions for quick lookup
List of constant values used by the chunk (strings, numbers, booleans, nil)
Maps constants to their index positions for quick lookup
List of nested function chunks (prototypes)
Maps nested chunks to their index positions for quick lookup
List of upvalue names
Methods
UpdateMappings
This method clears and rebuilds all three mapping dictionaries, so call it after batch modifications rather than after each individual change.
Rebase
The offset to add to register indices
The offset to add to parameter indices
The ParameterCount of the chunk
The method intelligently distinguishes between parameters and regular stack values when applying offsets, handling each Lua opcode’s specific register requirements.
Usage Example
Chunk Structure
A Lua chunk follows a hierarchical structure:See Also
- Instruction - Individual bytecode instructions
- Deserializer - Decode chunks from bytecode files
- Serializer - Encode chunks back to bytecode