vm

package
v1.6.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StackSize  = 2048
	GlobalSize = 65536
	MaxFrames  = 1024
)

Variables

View Source
var (
	True  = obj.True
	False = obj.False
	Null  = obj.NullObj
)

Functions

This section is empty.

Types

type Frame

type Frame struct {
	// contains filtered or unexported fields
}

func NewFrame

func NewFrame(cl *obj.Closure, basePointer int) Frame

func (*Frame) Instructions

func (f *Frame) Instructions() code.Instructions

type State added in v1.2.0

type State struct {
	NumDefs int
	Consts  []obj.Object
	Globals []obj.Object
}

func NewState added in v1.2.0

func NewState() *State

type VM

type VM struct {
	*State
	// contains filtered or unexported fields
}

func New

func New(file string, bytecode *compiler.Bytecode) *VM

func NewWithState added in v1.2.0

func NewWithState(file string, bytecode *compiler.Bytecode, state *State) *VM

func (*VM) LastPoppedStackObj added in v1.6.0

func (vm *VM) LastPoppedStackObj() obj.Object

func (*VM) Run

func (vm *VM) Run() (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL