Documentation ¶
Overview ¶
Package opcode holds all the opcodes that are to be interpreted by the replay virtual machine.
Index ¶
- func PackAPIIndexFunctionID(index uint8, id uint16) uint32
- type Add
- type Call
- type Clone
- type Copy
- type Extend
- type InlineResource
- type InlineResourcePointerPatchUp
- type InlineResourceValuePatchUp
- type JumpLabel
- type JumpNZ
- type JumpZ
- type Label
- type Load
- type LoadC
- type LoadV
- type Notification
- type Opcode
- type Pop
- type Post
- type PushI
- type Resource
- type Store
- type StoreV
- type Strcpy
- type SwitchThread
- type TrivialPointer
- type TrivialPointerResolver
- type TrivialValue
- type Wait
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PackAPIIndexFunctionID ¶
PackAPIIndexFunctionID packs the API index and the function ID together.
Types ¶
type Add ¶
type Add struct {
Count uint32 // Number of top value stack elements to pop and sum.
}
Add represents the ADD virtual machine opcode.
type Call ¶
type Call struct { PushReturn bool // Should the return value be pushed onto the stack? ApiIndex uint8 // The index of the API this call belongs to. FunctionID uint16 // The function identifier to call. }
Call represents the CALL virtual machine opcode.
type Clone ¶
type Clone struct {
Index uint32 // Index of element from top of stack to clone.
}
Clone represents the CLONE virtual machine opcode.
type Copy ¶
type Copy struct {
Count uint32 // Number of bytes to copy.
}
Copy represents the COPY virtual machine opcode.
type Extend ¶
type Extend struct {
Value uint32 // 26 bit value to extend the top of the stack by.
}
Extend represents the EXTEND virtual machine opcode.
type InlineResource ¶
type InlineResource struct { Data []uint32 DataSize uint32 ValuePatchUps []InlineResourceValuePatchUp PointerPatchUps []InlineResourcePointerPatchUp Resolver value.PointerResolver Ctx context.Context }
Resource represents the RESOURCE virtual machine opcode.
func DecodeInlineResource ¶
func DecodeInlineResource(opcode uint32, reader binary.Reader) InlineResource
func (InlineResource) String ¶
func (c InlineResource) String() string
type JumpLabel ¶
type JumpLabel struct {
Label uint32 // 26 bit jump label.
}
JumpLabel represents the JumpLabel virtual machine opcode.
type JumpNZ ¶
type JumpNZ struct {
Label uint32 // 26 bit jump label.
}
JumpNZ represents the JumpNZ virtual machine opcode.
type JumpZ ¶
type JumpZ struct {
Label uint32 // 26 bit jump label.
}
JumpZ represents the JumpZ virtual machine opcode.
type Label ¶
type Label struct {
Value uint32 // 26 bit label name.
}
Label represents the LABEL virtual machine opcode.
type LoadC ¶
type LoadC struct { DataType protocol.Type // The value type to load. Address uint32 // The pointer to the value in constant address-space. }
LoadC represents the LOAD_C virtual machine opcode.
type LoadV ¶
type LoadV struct { DataType protocol.Type // The value type to load. Address uint32 // The pointer to the value in volatile address-space. }
LoadV represents the LOAD_V virtual machine opcode.
type Notification ¶
type Notification struct{}
Notification represents the NOTIFICATION virtual machine opcode.
func (Notification) String ¶
func (c Notification) String() string
type Opcode ¶
type Opcode interface {
// contains filtered or unexported methods
}
Opcode represents a single opcode used by GAPIR.
type Pop ¶
type Pop struct {
Count uint32 // Number of elements to pop from the top of the stack.
}
Pop represents the POP virtual machine opcode.
type PushI ¶
type PushI struct { DataType protocol.Type // The value type to push. Value uint32 // The value to push packed into the low 20 bits. }
PushI represents the PUSH_I virtual machine opcode.
type Resource ¶
type Resource struct {
ID uint32 // The index of the resource identifier.
}
Resource represents the RESOURCE virtual machine opcode.
type StoreV ¶
type StoreV struct {
Address uint32 // Pointer in volatile address-space.
}
StoreV represents the STORE_V virtual machine opcode.
type Strcpy ¶
type Strcpy struct {
MaxSize uint32 // Maximum size in bytes to copy.
}
Strcpy represents the STRCPY virtual machine opcode.
type SwitchThread ¶
type SwitchThread struct {
Index uint32 // 26 bit thread index.
}
SwitchThread represents the SwitchThread virtual machine opcode.
func (SwitchThread) String ¶
func (c SwitchThread) String() string
type TrivialPointer ¶
type TrivialPointer struct {
Value uint32
}
func (TrivialPointer) Get ¶
func (t TrivialPointer) Get(value.PointerResolver) (ty protocol.Type, val uint64, onStack bool)
func (TrivialPointer) IsValid ¶
func (t TrivialPointer) IsValid() bool
type TrivialPointerResolver ¶
type TrivialPointerResolver struct{}
func (TrivialPointerResolver) ResolveObservedPointer ¶
func (r TrivialPointerResolver) ResolveObservedPointer(value.ObservedPointer) (protocol.Type, uint64)
func (TrivialPointerResolver) ResolvePointerIndex ¶
func (r TrivialPointerResolver) ResolvePointerIndex(value.PointerIndex) (protocol.Type, uint64)
func (TrivialPointerResolver) ResolveTemporaryPointer ¶
func (r TrivialPointerResolver) ResolveTemporaryPointer(value.TemporaryPointer) value.VolatilePointer
type TrivialValue ¶
type TrivialValue struct {
Value uint32
}
func (TrivialValue) Get ¶
func (t TrivialValue) Get(value.PointerResolver) (ty protocol.Type, val uint64, onStack bool)