27 lines
374 B
Go
27 lines
374 B
Go
package vm
|
|
|
|
type OperandType uint8
|
|
|
|
const (
|
|
Literal OperandType = 0
|
|
FunctionMemoryIndex = 1
|
|
GlobalMemoryIndex = 2
|
|
)
|
|
|
|
type Operand struct {
|
|
Type OperandType
|
|
Reserved [3]byte
|
|
Value uint64
|
|
}
|
|
|
|
func (opr *Operand) Copy() *Operand {
|
|
if opr == nil {
|
|
return nil
|
|
}
|
|
|
|
return &Operand{
|
|
Type: opr.Type,
|
|
Value: opr.Value,
|
|
}
|
|
}
|