typ

package
v0.0.0-...-c7f8db1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

View Source
const (
	OpSet
	OpStore
	OpLoad
	OpExt
	OpAdd
	OpSub
	OpMul
	OpDiv
	OpIDiv
	OpInc
	OpMod
	OpLen
	OpNext
	OpNot
	OpEq
	OpNeq
	OpLess
	OpLessEq
	OpJmpFalse
	OpJmp
	OpFunction
	OpPush
	OpPushUnpack
	OpCreateArray
	OpCreateObject
	OpCall
	OpTailCall
	OpIsProto
	OpSlice
	OpRet
	OpLoadTop

	OpExtAdd16
	OpExtRSub16
	OpExtLess16
	OpExtGreat16
	OpExtEq16
	OpExtNeq16
	OpExtInc16
	OpExtLoad16
	OpExtStore16
	OpExtBitAnd
	OpExtBitOr
	OpExtBitXor
	OpExtBitLsh
	OpExtBitRsh
	OpExtBitURsh
	OpExtBitAnd16
	OpExtBitOr16
	OpExtBitXor16
	OpExtBitLsh16
	OpExtBitRsh16
	OpExtBitURsh16
)
View Source
const (
	RegA          = 0x8000
	RegPhantom    = 0xffff
	RegLocalMask  = 0x7fff
	RegNil        = 0x8001
	RegMaxAddress = 0x7ff0
)
View Source
const InstSize = unsafe.Sizeof(Inst{})

Variables

View Source
var BinaryOpcode = map[byte]string{
	OpAdd:        "add",
	OpSub:        "sub",
	OpMul:        "mul",
	OpDiv:        "div",
	OpIDiv:       "idiv",
	OpMod:        "mod",
	OpEq:         "eq",
	OpNeq:        "neq",
	OpLess:       "less",
	OpLessEq:     "lesseq",
	OpLoad:       "load",
	OpNext:       "next",
	OpIsProto:    "isproto",
	OpInc:        "inc",
	OpExtBitAnd:  "and",
	OpExtBitOr:   "or",
	OpExtBitXor:  "xor",
	OpExtBitLsh:  "lsh",
	OpExtBitRsh:  "rsh",
	OpExtBitURsh: "ursh",
}
View Source
var TenaryOpcode = map[byte]string{
	OpLoad:  "load",
	OpStore: "store",
	OpSlice: "slice",
}
View Source
var UnaryOpcode = map[byte]string{
	OpNot:        "not",
	OpRet:        "return",
	OpLen:        "len",
	OpPush:       "push",
	OpPushUnpack: "pushvarg",
}

Functions

This section is empty.

Types

type Inst

type Inst struct {
	Opcode    byte
	OpcodeExt byte
	A         uint16
	B         uint16
	C         uint16
}

func JmpInst

func JmpInst(op byte, distance int) Inst

func (Inst) D

func (i Inst) D() int32

func (Inst) SetD

func (i Inst) SetD(d int32) Inst

type MarshalType

type MarshalType int
const (
	MarshalToString MarshalType = iota
	MarshalToStringNonRec
	MarshalToJSON
)

func (MarshalType) NoRec

func (m MarshalType) NoRec() MarshalType

func (MarshalType) String

func (m MarshalType) String() string

type ValueType

type ValueType byte
const (
	Nil    ValueType = 0
	Bool   ValueType = 1
	Number ValueType = 3
	String ValueType = 7
	Object ValueType = 15
	Native ValueType = 31
)

func (ValueType) String

func (t ValueType) String() string

Jump to

Keyboard shortcuts

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