Documentation ¶
Index ¶
- Constants
- func InitEnv(env *Env)
- func InitEvalEnv(env *Env, ee *EvalEnv, stackSize int)
- type DebugInfo
- type Env
- type EvalEnv
- type Func
- type FuncDebugInfo
- type FuncKey
- type NativeCallContext
- func (ncc NativeCallContext) BoolArg(index int) bool
- func (ncc NativeCallContext) ByteArg(index int) byte
- func (ncc NativeCallContext) ByteSliceArg(index int) []byte
- func (ncc NativeCallContext) FloatArg(index int) float64
- func (ncc NativeCallContext) IntArg(index int) int
- func (ncc NativeCallContext) InterfaceArg(index int) interface{}
- func (ncc NativeCallContext) SetBoolResult(v bool)
- func (ncc NativeCallContext) SetBoolResult2(v bool)
- func (ncc NativeCallContext) SetByteSliceResult(v []byte)
- func (ncc NativeCallContext) SetByteSliceResult2(v []byte)
- func (ncc NativeCallContext) SetFloatResult(v float64)
- func (ncc NativeCallContext) SetFloatResult2(v float64)
- func (ncc NativeCallContext) SetIntResult(v int)
- func (ncc NativeCallContext) SetIntResult2(v int)
- func (ncc NativeCallContext) SetInterfaceResult(v interface{})
- func (ncc NativeCallContext) SetInterfaceResult2(v interface{})
- func (ncc NativeCallContext) SetStringResult(v string)
- func (ncc NativeCallContext) SetStringResult2(v string)
- func (ncc NativeCallContext) StringArg(index int) string
- func (ncc NativeCallContext) VariadicArg() []interface{}
- type NativeFunc
- type Slot
- func (slot Slot) Bool() bool
- func (slot Slot) Byte() byte
- func (slot Slot) ByteSlice() []byte
- func (slot Slot) Float() float64
- func (slot Slot) Int() int
- func (slot Slot) Interface() interface{}
- func (slot Slot) IsNil() bool
- func (slot Slot) IsNilInterface() bool
- func (slot *Slot) MoveInterface(src *Slot)
- func (slot *Slot) SetBool(v bool)
- func (slot *Slot) SetByte(v byte)
- func (slot *Slot) SetByteSlice(v []byte)
- func (slot *Slot) SetFloat(v float64)
- func (slot *Slot) SetInt(v int)
- func (slot *Slot) SetInterface(v interface{})
- func (slot *Slot) SetString(v string)
- func (slot Slot) String() string
Constants ¶
View Source
const MaxNativeFuncArgs = 6
View Source
const SizeofSlot = unsafe.Sizeof(Slot{})
Variables ¶
This section is empty.
Functions ¶
func InitEvalEnv ¶
Types ¶
type DebugInfo ¶
type DebugInfo struct {
Funcs map[*Func]FuncDebugInfo
}
func NewDebugInfo ¶
func NewDebugInfo() *DebugInfo
type Env ¶
type Env struct { NativeFuncs []NativeFunc NameToNativeFuncID map[FuncKey]uint16 UserFuncs []*Func NameToFuncID map[FuncKey]uint16 // debug contains all information that is only needed // for better debugging and compiled code introspection. // Right now it's always enabled, but we may allow stripping it later. Debug *DebugInfo }
Env is used to hold both compilation and evaluation data.
func (*Env) AddNativeFunc ¶
func (env *Env) AddNativeFunc(pkgPath, funcName string, f func(NativeCallContext))
func (*Env) AddNativeMethod ¶
func (env *Env) AddNativeMethod(typeName, methodName string, f func(NativeCallContext))
type EvalEnv ¶
type EvalEnv struct {
// contains filtered or unexported fields
}
EvalEnv is a goroutine-local handle for Env. To get one, use Env.GetEvalEnv() method.
type FuncDebugInfo ¶
type FuncDebugInfo struct {
SlotNames []string
}
type NativeCallContext ¶
type NativeCallContext struct {
// contains filtered or unexported fields
}
func (NativeCallContext) BoolArg ¶
func (ncc NativeCallContext) BoolArg(index int) bool
func (NativeCallContext) ByteArg ¶
func (ncc NativeCallContext) ByteArg(index int) byte
func (NativeCallContext) ByteSliceArg ¶
func (ncc NativeCallContext) ByteSliceArg(index int) []byte
func (NativeCallContext) FloatArg ¶
func (ncc NativeCallContext) FloatArg(index int) float64
func (NativeCallContext) IntArg ¶
func (ncc NativeCallContext) IntArg(index int) int
func (NativeCallContext) InterfaceArg ¶
func (ncc NativeCallContext) InterfaceArg(index int) interface{}
func (NativeCallContext) SetBoolResult ¶
func (ncc NativeCallContext) SetBoolResult(v bool)
func (NativeCallContext) SetBoolResult2 ¶
func (ncc NativeCallContext) SetBoolResult2(v bool)
func (NativeCallContext) SetByteSliceResult ¶
func (ncc NativeCallContext) SetByteSliceResult(v []byte)
func (NativeCallContext) SetByteSliceResult2 ¶
func (ncc NativeCallContext) SetByteSliceResult2(v []byte)
func (NativeCallContext) SetFloatResult ¶
func (ncc NativeCallContext) SetFloatResult(v float64)
func (NativeCallContext) SetFloatResult2 ¶
func (ncc NativeCallContext) SetFloatResult2(v float64)
func (NativeCallContext) SetIntResult ¶
func (ncc NativeCallContext) SetIntResult(v int)
func (NativeCallContext) SetIntResult2 ¶
func (ncc NativeCallContext) SetIntResult2(v int)
func (NativeCallContext) SetInterfaceResult ¶
func (ncc NativeCallContext) SetInterfaceResult(v interface{})
func (NativeCallContext) SetInterfaceResult2 ¶
func (ncc NativeCallContext) SetInterfaceResult2(v interface{})
func (NativeCallContext) SetStringResult ¶
func (ncc NativeCallContext) SetStringResult(v string)
func (NativeCallContext) SetStringResult2 ¶
func (ncc NativeCallContext) SetStringResult2(v string)
func (NativeCallContext) StringArg ¶
func (ncc NativeCallContext) StringArg(index int) string
func (NativeCallContext) VariadicArg ¶
func (ncc NativeCallContext) VariadicArg() []interface{}
type NativeFunc ¶
type NativeFunc struct { Name string // Needed for the readable disasm // contains filtered or unexported fields }
type Slot ¶
type Slot struct { // TODO: make fields unexported, adjust the user code as needed. Ptr unsafe.Pointer Scalar uint64 Scalar2 uint64 }
func (Slot) IsNilInterface ¶
func (*Slot) MoveInterface ¶
func (*Slot) SetByteSlice ¶
func (*Slot) SetInterface ¶
func (slot *Slot) SetInterface(v interface{})
Click to show internal directories.
Click to hide internal directories.