class Ven::Suite::Chunk
- Ven::Suite::Chunk
- Reference
- Object
Overview
A chunk is an abstraction over a collection of Snippet
s.
Defined in:
ven/suite/chunk.crConstructors
Instance Method Summary
-
#[](*args, **options)
These are only used by the Machine, and the Machine does not (and should not) know anything about snippets.
-
#[](*args, **options, &)
These are only used by the Machine, and the Machine does not (and should not) know anything about snippets.
-
#add(opcode : Opcode, argument : Label, line : Int32)
Appends an instruction given its opcode, argument and line number.
-
#add(opcode, argument, line)
Appends an instruction given its opcode, argument and line number.
-
#complete!
Stitches and jumpizes this chunk.
- #file : String
-
#label(label : Label)
Declares that whatever follows should be emitted under the label label.
- #name : String
-
#offset(argument : Nil)
Returns the offset of argument in the appropriate payload storage, if it is there already.
-
#offset(argument : VJump)
Returns the offset of argument in the appropriate payload storage, if it is there already.
-
#offset(argument : VStatic)
Returns the offset of argument in the appropriate payload storage, if it is there already.
-
#offset(argument : VSymbol)
Returns the offset of argument in the appropriate payload storage, if it is there already.
-
#offset(argument : VFunction)
Returns the offset of argument in the appropriate payload storage, if it is there already.
-
#offset(argument : Static)
Returns the offset of argument in the appropriate payload storage, if it is there already.
-
#resolve(instruction : Instruction)
Returns the payload vehicle this instruction references.
-
#resolve?(instruction : Instruction)
Returns the payload vehicle this instruction references, or nil if it doesn't reference one.
- #seamless : Array(Ven::Suite::Instruction)
-
#size(*args, **options)
These are only used by the Machine, and the Machine does not (and should not) know anything about snippets.
-
#size(*args, **options, &)
These are only used by the Machine, and the Machine does not (and should not) know anything about snippets.
- #snippets : Array(Ven::Suite::Snippet)
-
#to_s(io : IO, instruction : Instruction, index : Int32 | Nil = nil)
Disassembles an instruction, trying to resolve its argument with the payload storage of this chunk.
-
#to_s(io : IO, deepen = 2)
Disassembles seamless if available, otherwise snippets.
-
#to_s(instruction : Instruction, index : Int32 | Nil = nil)
Disassembles an instruction given no IO (see
#to_s(io, instruction)
). -
#to_s
Disassembles this chunk given no IO (see
to_s(io)
)
Constructor Detail
Instance Method Detail
These are only used by the Machine, and the Machine does not (and should not) know anything about snippets. So, redirect to seamless.
These are only used by the Machine, and the Machine does not (and should not) know anything about snippets. So, redirect to seamless.
Appends an instruction given its opcode, argument and line number.
Appends an instruction given its opcode, argument and line number.
Declares that whatever follows should be emitted under the label label.
Returns the offset of argument in the appropriate payload storage, if it is there already. Otherwise, adds argument to the appropriate payload storage first, and then returns the resulting offset.
Returns the offset of argument in the appropriate payload storage, if it is there already. Otherwise, adds argument to the appropriate payload storage first, and then returns the resulting offset.
Returns the offset of argument in the appropriate payload storage, if it is there already. Otherwise, adds argument to the appropriate payload storage first, and then returns the resulting offset.
Returns the offset of argument in the appropriate payload storage, if it is there already. Otherwise, adds argument to the appropriate payload storage first, and then returns the resulting offset.
Returns the offset of argument in the appropriate payload storage, if it is there already. Otherwise, adds argument to the appropriate payload storage first, and then returns the resulting offset.
Returns the offset of argument in the appropriate payload storage, if it is there already. Otherwise, adds argument to the appropriate payload storage first, and then returns the resulting offset.
Returns the payload vehicle this instruction references. Raises if it doesn't reference one.
Returns the payload vehicle this instruction references, or nil if it doesn't reference one.
These are only used by the Machine, and the Machine does not (and should not) know anything about snippets. So, redirect to seamless.
These are only used by the Machine, and the Machine does not (and should not) know anything about snippets. So, redirect to seamless.
Disassembles an instruction, trying to resolve its argument with the payload storage of this chunk. If got an index, prints it before the instruction.
Disassembles an instruction given no IO (see #to_s(io, instruction)
).