2019-01-09 10:17:42 +03:00
|
|
|
package compiler
|
|
|
|
|
|
|
|
type Opcode byte
|
|
|
|
|
|
|
|
const (
|
|
|
|
OpConstant Opcode = iota
|
|
|
|
OpAdd
|
|
|
|
OpSub
|
|
|
|
OpMul
|
|
|
|
OpDiv
|
|
|
|
OpRem
|
|
|
|
OpBAnd
|
|
|
|
OpBOr
|
|
|
|
OpBXor
|
|
|
|
OpBShiftLeft
|
|
|
|
OpBShiftRight
|
|
|
|
OpBAndNot
|
|
|
|
OpBComplement
|
|
|
|
OpPop
|
|
|
|
OpTrue
|
|
|
|
OpFalse
|
|
|
|
OpEqual
|
|
|
|
OpNotEqual
|
|
|
|
OpGreaterThan
|
|
|
|
OpGreaterThanEqual
|
|
|
|
OpMinus
|
|
|
|
OpLNot
|
|
|
|
OpJumpFalsy
|
|
|
|
OpAndJump
|
|
|
|
OpOrJump
|
|
|
|
OpJump
|
|
|
|
OpNull
|
|
|
|
OpArray
|
|
|
|
OpMap
|
|
|
|
OpIndex
|
|
|
|
OpSliceIndex
|
|
|
|
OpCall
|
|
|
|
OpReturn
|
|
|
|
OpReturnValue
|
2019-01-11 09:34:28 +03:00
|
|
|
OpGetGlobal
|
|
|
|
OpSetGlobal
|
|
|
|
OpSetSelGlobal
|
2019-01-09 10:17:42 +03:00
|
|
|
OpGetLocal
|
|
|
|
OpSetLocal
|
2019-01-11 09:34:28 +03:00
|
|
|
OpDefineLocal
|
2019-01-09 10:17:42 +03:00
|
|
|
OpSetSelLocal
|
|
|
|
OpGetFree
|
|
|
|
OpSetFree
|
|
|
|
OpSetSelFree
|
2019-01-11 09:34:28 +03:00
|
|
|
OpGetBuiltin
|
|
|
|
OpClosure
|
2019-01-09 10:17:42 +03:00
|
|
|
OpIteratorInit
|
|
|
|
OpIteratorNext
|
|
|
|
OpIteratorKey
|
|
|
|
OpIteratorValue
|
|
|
|
)
|