Versions in this module Expand all Collapse all v0 v0.1.0 Dec 15, 2024 Changes in this version + func EmitConstant(c *CodeBuilder, k Constant, reg Register, line int) + func EmitMove(c *CodeBuilder, dst Register, src Register, line int) + func EmitMoveNoLine(c *CodeBuilder, dst Register, src Register) + func FoldMoveReg(i1, i2 Instruction, regs []RegData) (Instruction, Instruction) + func FoldTakeRelease(i1, i2 Instruction, regs []RegData) (Instruction, Instruction) + type AdvForLoop struct + Start Register + Step Register + Stop Register + func (i AdvForLoop) ProcessInstr(p InstrProcessor) + func (i AdvForLoop) String() string + type Bool bool + func (b Bool) ProcessConstant(p ConstantProcessor) + type Call struct + Cont Register + Tail bool + func (c Call) ProcessInstr(p InstrProcessor) + func (c Call) String() string + type ClearReg struct + Dst Register + func (i ClearReg) ProcessInstr(p InstrProcessor) + func (i ClearReg) String() string + type Code struct + Constants []Constant + Instructions []Instruction + Lines []int + Name string + Registers []RegData + UpNames []string + UpvalueDests []Register + func FoldCode(c Code, f FoldFunc) Code + func (c Code) ProcessConstant(p ConstantProcessor) + type CodeBuilder struct + func NewCodeBuilder(chunkName string, constantPool *ConstantPool) *CodeBuilder + func (c *CodeBuilder) Close() (uint, []Register) + func (c *CodeBuilder) DeclareGotoLabel(name Name, line int) Label + func (c *CodeBuilder) DeclareGotoLabelNoLine(name Name) Label + func (c *CodeBuilder) DeclareLocal(name Name, reg Register) + func (c *CodeBuilder) DeclareUniqueGotoLabel(name Name, line int) (Label, error) + func (c *CodeBuilder) Dump() + func (c *CodeBuilder) Emit(instr Instruction, line int) + func (c *CodeBuilder) EmitGotoLabel(name Name) error + func (c *CodeBuilder) EmitJump(lblName Name, line int) bool + func (c *CodeBuilder) EmitLabel(lbl Label, line int) error + func (c *CodeBuilder) EmitLabelNoLine(lbl Label) error + func (c *CodeBuilder) EmitNoLine(instr Instruction) + func (c *CodeBuilder) GetFreeRegister() Register + func (c *CodeBuilder) GetNewLabel() Label + func (c *CodeBuilder) GetRegister(name Name) (Register, bool) + func (c *CodeBuilder) HasPendingCloseActions() bool + func (c *CodeBuilder) IsConstantReg(reg Register) bool + func (c *CodeBuilder) MarkConstantReg(reg Register) + func (c *CodeBuilder) NewChild(chunkName string) *CodeBuilder + func (c *CodeBuilder) PopContext() + func (c *CodeBuilder) PushCloseAction(reg Register) + func (c *CodeBuilder) PushContext() + func (c *CodeBuilder) ReleaseRegister(reg Register) + func (c *CodeBuilder) TakeRegister(reg Register) + type Combine struct + Dst Register + Lsrc Register + Op ops.Op + Rsrc Register + func (c Combine) DestReg() Register + func (c Combine) ProcessInstr(p InstrProcessor) + func (c Combine) String() string + func (c Combine) WithDestReg(r Register) Instruction + type Constant interface + ProcessConstant func(p ConstantProcessor) + func FoldConstants(consts []Constant, f FoldFunc) []Constant + type ConstantPool struct + func NewConstantPool() *ConstantPool + func (c *ConstantPool) Constants() []Constant + func (c *ConstantPool) GetConstantIndex(k Constant) uint + type ConstantProcessor interface + ProcessBool func(Bool) + ProcessCode func(Code) + ProcessFloat func(Float) + ProcessInt func(Int) + ProcessNil func(NilType) + ProcessString func(String) + type DeclareLabel struct + Label Label + func (l DeclareLabel) ProcessInstr(p InstrProcessor) + func (l DeclareLabel) String() string + type EtcLookup struct + Dst Register + Etc Register + Idx int + func (l EtcLookup) DestReg() Register + func (l EtcLookup) ProcessInstr(p InstrProcessor) + func (l EtcLookup) String() string + func (l EtcLookup) WithDestReg(r Register) Instruction + type FillTable struct + Dst Register + Etc Register + Idx int + func (f FillTable) ProcessInstr(p InstrProcessor) + func (f FillTable) String() string + type Float float64 + func (f Float) ProcessConstant(p ConstantProcessor) + type FoldFunc func(i1, i2 Instruction, regs []RegData) (Instruction, Instruction) + var DefaultFold FoldFunc = nil + func ComposeFolds(fs ...FoldFunc) FoldFunc + type InstrProcessor interface + ProcessAdvForLoopInstr func(AdvForLoop) + ProcessCallInstr func(Call) + ProcessClearRegInstr func(ClearReg) + ProcessCombineInstr func(Combine) + ProcessDeclareLabelInstr func(DeclareLabel) + ProcessEtcLookupInstr func(EtcLookup) + ProcessFillTableInstr func(FillTable) + ProcessJumpIfInstr func(JumpIf) + ProcessJumpInstr func(Jump) + ProcessLoadConstInstr func(LoadConst) + ProcessLookupInstr func(Lookup) + ProcessMkClosureInstr func(MkClosure) + ProcessMkContInstr func(MkCont) + ProcessMkTableInstr func(MkTable) + ProcessPrepForLoopInstr func(PrepForLoop) + ProcessPushCloseStackInstr func(PushCloseStack) + ProcessPushInstr func(Push) + ProcessReceiveEtcInstr func(ReceiveEtc) + ProcessReceiveInstr func(Receive) + ProcessReleaseRegisterInstr func(ReleaseRegister) + ProcessSetIndexInstr func(SetIndex) + ProcessTakeRegisterInstr func(TakeRegister) + ProcessTransformInstr func(Transform) + ProcessTruncateCloseStackInstr func(TruncateCloseStack) + type Instruction interface + ProcessInstr func(InstrProcessor) + type Int int64 + func (n Int) ProcessConstant(p ConstantProcessor) + type Jump struct + Label Label + func (j Jump) ProcessInstr(p InstrProcessor) + func (j Jump) String() string + type JumpIf struct + Cond Register + Label Label + Not bool + func (j JumpIf) ProcessInstr(p InstrProcessor) + func (j JumpIf) String() string + type Label uint + func (l Label) String() string + type LoadConst struct + Dst Register + Kidx uint + func (l LoadConst) DestReg() Register + func (l LoadConst) ProcessInstr(p InstrProcessor) + func (l LoadConst) String() string + func (l LoadConst) WithDestReg(r Register) Instruction + type Lookup struct + Dst Register + Index Register + Table Register + func (s Lookup) DestReg() Register + func (s Lookup) ProcessInstr(p InstrProcessor) + func (s Lookup) String() string + func (s Lookup) WithDestReg(r Register) Instruction + type MkClosure struct + Code uint + Dst Register + Upvalues []Register + func (m MkClosure) DestReg() Register + func (m MkClosure) ProcessInstr(p InstrProcessor) + func (m MkClosure) String() string + func (m MkClosure) WithDestReg(r Register) Instruction + type MkCont struct + Closure Register + Dst Register + Tail bool + func (m MkCont) DestReg() Register + func (m MkCont) ProcessInstr(p InstrProcessor) + func (m MkCont) String() string + func (m MkCont) WithDestReg(r Register) Instruction + type MkTable struct + Dst Register + func (m MkTable) ProcessInstr(p InstrProcessor) + func (m MkTable) String() string + type Name string + type NilType struct + func (n NilType) ProcessConstant(p ConstantProcessor) + type PrepForLoop struct + Start Register + Step Register + Stop Register + func (i PrepForLoop) ProcessInstr(p InstrProcessor) + func (i PrepForLoop) String() string + type Push struct + Cont Register + Etc bool + Item Register + func (p Push) ProcessInstr(ip InstrProcessor) + func (p Push) String() string + type PushCloseStack struct + Src Register + func (i PushCloseStack) ProcessInstr(p InstrProcessor) + func (i PushCloseStack) String() string + type Receive struct + Dst []Register + func (r Receive) ProcessInstr(p InstrProcessor) + func (r Receive) String() string + type ReceiveEtc struct + Dst []Register + Etc Register + func (r ReceiveEtc) ProcessInstr(p InstrProcessor) + func (r ReceiveEtc) String() string + type RegData struct + IsCell bool + IsConstant bool + type Register uint + func (r Register) String() string + type ReleaseRegister struct + Reg Register + func (r ReleaseRegister) ProcessInstr(p InstrProcessor) + func (r ReleaseRegister) String() string + type SetIndex struct + Index Register + Src Register + Table Register + func (s SetIndex) ProcessInstr(p InstrProcessor) + func (s SetIndex) String() string + type SetRegInstruction interface + DestReg func() Register + WithDestReg func(Register) Instruction + type String string + func (s String) ProcessConstant(p ConstantProcessor) + type TakeRegister struct + Reg Register + func (t TakeRegister) ProcessInstr(p InstrProcessor) + func (t TakeRegister) String() string + type Transform struct + Dst Register + Op ops.Op + Src Register + func (t Transform) DestReg() Register + func (t Transform) ProcessInstr(p InstrProcessor) + func (t Transform) String() string + func (t Transform) WithDestReg(r Register) Instruction + type TruncateCloseStack struct + Height int + func (t TruncateCloseStack) ProcessInstr(p InstrProcessor) + func (t TruncateCloseStack) String() string