class Ven::Suite::Chunk

Overview

A chunk is an abstraction over a collection of Snippets.

Defined in:

ven/suite/chunk.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(file : String, name : String) #

[View source]

Instance Method Detail

def [](*args, **options) #

These are only used by the Machine, and the Machine does not (and should not) know anything about snippets. So, redirect to seamless.


[View source]
def [](*args, **options, &) #

These are only used by the Machine, and the Machine does not (and should not) know anything about snippets. So, redirect to seamless.


[View source]
def add(opcode : Opcode, argument : Label, line : Int32) #

Appends an instruction given its opcode, argument and line number.


[View source]
def add(opcode, argument, line) #

Appends an instruction given its opcode, argument and line number.


[View source]
def complete! #

Stitches and jumpizes this chunk.


[View source]
def file : String #

[View source]
def label(label : Label) #

Declares that whatever follows should be emitted under the label label.


[View source]
def name : String #

[View source]
def offset(argument : Nil) #

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.


[View source]
def offset(argument : VJump) #

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.


[View source]
def offset(argument : VStatic) #

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.


[View source]
def offset(argument : VSymbol) #

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.


[View source]
def offset(argument : VFunction) #

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.


[View source]
def offset(argument : Static) #

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.


[View source]
def resolve(instruction : Instruction) #

Returns the payload vehicle this instruction references. Raises if it doesn't reference one.


[View source]
def resolve?(instruction : Instruction) #

Returns the payload vehicle this instruction references, or nil if it doesn't reference one.


[View source]
def seamless : Array(Ven::Suite::Instruction) #

[View source]
def size(*args, **options) #

These are only used by the Machine, and the Machine does not (and should not) know anything about snippets. So, redirect to seamless.


[View source]
def size(*args, **options, &) #

These are only used by the Machine, and the Machine does not (and should not) know anything about snippets. So, redirect to seamless.


[View source]
def snippets : Array(Ven::Suite::Snippet) #

[View source]
def 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. If got an index, prints it before the instruction.


[View source]
def to_s(io : IO, deepen = 2) #

Disassembles seamless if available, otherwise snippets.


[View source]
def to_s(instruction : Instruction, index : Int32 | Nil = nil) #

Disassembles an instruction given no IO (see #to_s(io, instruction)).


[View source]
def to_s #

Disassembles this chunk given no IO (see to_s(io))


[View source]