Documentation
¶
Index ¶
- Variables
- func GetNextThreadId() int64
- func GetNextThreadIdAddress() int64
- type Class
- func (c *Class) ArrayDim() int
- func (c *Class) Desc() *desc.Desc
- func (c *Class) Elem() ir.Class
- func (c *Class) GetAndPushConst(i uint16, s ir.Stack) error
- func (c *Class) GetField(i uint16) ir.Field
- func (c *Class) GetFieldByName(name string) ir.Field
- func (c *Class) GetMethod(i uint16) ir.Method
- func (c *Class) GetMethodByDesc(name string, dc *desc.MethodDesc) ir.Method
- func (c *Class) GetMethodByName(location string) ir.Method
- func (c *Class) GetMethodByNameAndType(name, typ string) ir.Method
- func (c *Class) InitBeforeUse(vm *VM)
- func (c *Class) Interfaces() []ir.Class
- func (c *Class) IsAssignableFrom(k ir.Class) bool
- func (c *Class) IsInstance(r ir.Ref) bool
- func (c *Class) IsInterface() bool
- func (c *Class) Modifiers() int32
- func (c *Class) Name() string
- func (c *Class) NewArrayClass(dim int) *Class
- func (c *Class) Reflect() reflect.Type
- func (c *Class) ShouldInit() bool
- func (c *Class) Super() ir.Class
- type Field
- type Method
- type NativeMethodCallback
- type Options
- type Ref
- func (r *Ref) Class() ir.Class
- func (r *Ref) Data() unsafe.Pointer
- func (r *Ref) Desc() *desc.Desc
- func (r *Ref) GetArrInt16() []int16
- func (r *Ref) GetArrInt32() []int32
- func (r *Ref) GetArrInt64() []int64
- func (r *Ref) GetArrInt8() []int8
- func (r *Ref) GetArrRef() []unsafe.Pointer
- func (r *Ref) GoString() string
- func (r *Ref) Id() int32
- func (r *Ref) IsLocked(vm ir.VM) int
- func (r *Ref) Len() int32
- func (r *Ref) Lock(vm ir.VM) int
- func (r *Ref) Lock0(vm *VM) int
- func (r *Ref) Notify(vm ir.VM) error
- func (r *Ref) NotifyAll(vm ir.VM) error
- func (r *Ref) Unlock(vm ir.VM) (int, error)
- func (r *Ref) Unlock0(vm *VM) (int, error)
- func (r *Ref) UserData() *any
- func (r *Ref) Wait(vm ir.VM, millis int64) error
- func (r *Ref) Wait0(vm *VM, dur time.Duration) error
- type Stack
- func (s *Stack) GetVar(i uint16) uint32
- func (s *Stack) GetVar64(i uint16) uint64
- func (s *Stack) GetVarFloat32(i uint16) float32
- func (s *Stack) GetVarFloat64(i uint16) float64
- func (s *Stack) GetVarInt16(i uint16) int16
- func (s *Stack) GetVarInt32(i uint16) int32
- func (s *Stack) GetVarInt64(i uint16) int64
- func (s *Stack) GetVarInt8(i uint16) int8
- func (s *Stack) GetVarPointer(i uint16) unsafe.Pointer
- func (s *Stack) GetVarRef(i uint16) ir.Ref
- func (s *Stack) GoString() string
- func (s *Stack) IsRef() bool
- func (s *Stack) Method() ir.Method
- func (s *Stack) PC() *ir.ICNode
- func (s *Stack) Peek() uint32
- func (s *Stack) Peek64() uint64
- func (s *Stack) PeekFloat32() float32
- func (s *Stack) PeekFloat64() float64
- func (s *Stack) PeekInt16() int16
- func (s *Stack) PeekInt32() int32
- func (s *Stack) PeekInt64() int64
- func (s *Stack) PeekInt8() int8
- func (s *Stack) PeekPointer() unsafe.Pointer
- func (s *Stack) PeekRef() ir.Ref
- func (s *Stack) Pop() uint32
- func (s *Stack) Pop64() uint64
- func (s *Stack) PopFloat32() float32
- func (s *Stack) PopFloat64() float64
- func (s *Stack) PopInt16() int16
- func (s *Stack) PopInt32() int32
- func (s *Stack) PopInt64() int64
- func (s *Stack) PopInt8() int8
- func (s *Stack) PopPointer() unsafe.Pointer
- func (s *Stack) PopRef() ir.Ref
- func (s *Stack) Prev() ir.Stack
- func (s *Stack) Push(v uint32)
- func (s *Stack) Push64(v uint64)
- func (s *Stack) PushFloat32(v float32)
- func (s *Stack) PushFloat64(v float64)
- func (s *Stack) PushInt16(v int16)
- func (s *Stack) PushInt32(v int32)
- func (s *Stack) PushInt64(v int64)
- func (s *Stack) PushInt8(v int8)
- func (s *Stack) PushPointer(v unsafe.Pointer)
- func (s *Stack) PushRef(v ir.Ref)
- func (s *Stack) SetVar(i uint16, v uint32)
- func (s *Stack) SetVar64(i uint16, v uint64)
- func (s *Stack) SetVarFloat32(i uint16, v float32)
- func (s *Stack) SetVarFloat64(i uint16, v float64)
- func (s *Stack) SetVarInt16(i uint16, v int16)
- func (s *Stack) SetVarInt32(i uint16, v int32)
- func (s *Stack) SetVarInt64(i uint16, v int64)
- func (s *Stack) SetVarInt8(i uint16, v int8)
- func (s *Stack) SetVarPointer(i uint16, v unsafe.Pointer)
- func (s *Stack) SetVarRef(i uint16, v ir.Ref)
- type StackFrameInfo
- type StackInfo
- type ThreadUserData
- type VM
- func (vm *VM) ClearInterrupt()
- func (vm *VM) FillThrowableStackTrace(throwable ir.Ref)
- func (vm *VM) GetAndClearInterrupt() bool
- func (vm *VM) GetCarrierThread() ir.Ref
- func (vm *VM) GetClass(r ir.Ref) ir.Class
- func (vm *VM) GetClassByIndex(i uint16) (ir.Class, error)
- func (vm *VM) GetClassFromDesc(dc *desc.Desc) (*Class, error)
- func (vm *VM) GetClassLoader() ir.ClassLoader
- func (vm *VM) GetClassRef(cls ir.Class) ir.Ref
- func (vm *VM) GetCurrentClass() ir.Class
- func (vm *VM) GetCurrentMethod() ir.Method
- func (vm *VM) GetCurrentThread() ir.Ref
- func (vm *VM) GetDesc(i uint16) *desc.Desc
- func (vm *VM) GetMethodDesc(i uint16) *desc.MethodDesc
- func (vm *VM) GetObjectClass() ir.Class
- func (vm *VM) GetStack() ir.Stack
- func (vm *VM) GetString(ref ir.Ref) string
- func (vm *VM) GetStringClass() ir.Class
- func (vm *VM) GetStringIntern(ref ir.Ref) ir.Ref
- func (vm *VM) GetStringInternOrNew(str string) ir.Ref
- func (vm *VM) GetThrowableClass() ir.Class
- func (vm *VM) Goto(n *ir.ICNode)
- func (vm *VM) Interrupt(thread ir.Ref)
- func (vm *VM) Invoke(method ir.Method)
- func (vm *VM) InvokeDynamic(ind uint16) error
- func (vm *VM) InvokeStatic(method ir.Method)
- func (vm *VM) InvokeVirtual(method ir.Method)
- func (vm *VM) LoadNativeMethod(method ir.Method, native NativeMethodCallback)
- func (vm *VM) MarkInterrupt()
- func (vm *VM) New(cls ir.Class) ir.Ref
- func (vm *VM) NewArray(dc *desc.Desc, length int32) ir.Ref
- func (vm *VM) NewArrayByClass(cls ir.Class, length int32) ir.Ref
- func (vm *VM) NewArrayMultiDim(dc *desc.Desc, lengths []int32) ir.Ref
- func (vm *VM) NewLookup() ir.Ref
- func (vm *VM) NewMethodHandle(method *jcls.ConstantMethodHandle) ir.Ref
- func (vm *VM) NewMethodType(dc string) ir.Ref
- func (vm *VM) NewString(str string) ir.Ref
- func (vm *VM) PtrToRef(ptr unsafe.Pointer) ir.Ref
- func (vm *VM) RefToPtr(ref ir.Ref) unsafe.Pointer
- func (vm *VM) Return()
- func (vm *VM) Root() *VM
- func (vm *VM) RunStack() error
- func (vm *VM) Running() bool
- func (vm *VM) SetCurrentThread(thread ir.Ref)
- func (vm *VM) SetupEntryMethod()
- func (vm *VM) Step() error
- func (vm *VM) Throw(r ir.Ref)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( VoidClass = &Class{ Class: &jcls.Class{ ThisDesc: desc.DescVoid, }, arrayDim: -1, } BooleanClass = &Class{ Class: &jcls.Class{ ThisDesc: desc.DescBool, }, arrayDim: -1, } ByteClass = &Class{ Class: &jcls.Class{ ThisDesc: desc.DescInt8, }, arrayDim: -1, } CharClass = &Class{ Class: &jcls.Class{ ThisDesc: desc.DescChar, }, arrayDim: -1, } ShortClass = &Class{ Class: &jcls.Class{ ThisDesc: desc.DescInt16, }, arrayDim: -1, } IntClass = &Class{ Class: &jcls.Class{ ThisDesc: desc.DescInt32, }, arrayDim: -1, } FloatClass = &Class{ Class: &jcls.Class{ ThisDesc: desc.DescFloat32, }, arrayDim: -1, } LongClass = &Class{ Class: &jcls.Class{ ThisDesc: desc.DescInt64, }, arrayDim: -1, } DoubleClass = &Class{ Class: &jcls.Class{ ThisDesc: desc.DescFloat64, }, arrayDim: -1, } ByteArrayClass = ByteClass.NewArrayClass(1) )
Functions ¶
func GetNextThreadId ¶
func GetNextThreadId() int64
func GetNextThreadIdAddress ¶
func GetNextThreadIdAddress() int64
Types ¶
type Class ¶
type Class struct { *jcls.Class Fields []Field Methods []Method // contains filtered or unexported fields }
vm.Class represents a loaded class
func (*Class) GetMethodByDesc ¶
func (*Class) GetMethodByNameAndType ¶
func (*Class) InitBeforeUse ¶
func (*Class) Interfaces ¶
func (*Class) IsInterface ¶
func (*Class) NewArrayClass ¶
func (*Class) ShouldInit ¶
type Field ¶
func (*Field) GetDeclaringClass ¶
type Method ¶
func (*Method) GetDeclaringClass ¶
type NativeMethodCallback ¶
type Options ¶
type Options struct { Loader ir.ClassLoader EntryClass string EntryMethod string EntryArgs []string }
VM Options
type Ref ¶
type Ref struct {
// contains filtered or unexported fields
}
func (*Ref) GetArrInt16 ¶
func (*Ref) GetArrInt32 ¶
func (*Ref) GetArrInt64 ¶
func (*Ref) GetArrInt8 ¶
type Stack ¶
type Stack struct {
// contains filtered or unexported fields
}
func (*Stack) GetVarFloat32 ¶
func (*Stack) GetVarFloat64 ¶
func (*Stack) GetVarInt16 ¶
func (*Stack) GetVarInt32 ¶
func (*Stack) GetVarInt64 ¶
func (*Stack) GetVarInt8 ¶
func (*Stack) PeekFloat32 ¶
func (*Stack) PeekFloat64 ¶
func (*Stack) PeekPointer ¶
func (*Stack) PopFloat32 ¶
func (*Stack) PopFloat64 ¶
func (*Stack) PopPointer ¶
func (*Stack) PushFloat32 ¶
func (*Stack) PushFloat64 ¶
func (*Stack) PushPointer ¶
func (*Stack) SetVarFloat32 ¶
func (*Stack) SetVarFloat64 ¶
func (*Stack) SetVarInt16 ¶
func (*Stack) SetVarInt32 ¶
func (*Stack) SetVarInt64 ¶
func (*Stack) SetVarInt8 ¶
type StackFrameInfo ¶
func (*StackFrameInfo) String ¶
func (fi *StackFrameInfo) String() string
type StackInfo ¶
type StackInfo struct { Frames []StackFrameInfo TotalDepth int }
type ThreadUserData ¶
type VM ¶
type VM struct {
// contains filtered or unexported fields
}
func (*VM) ClearInterrupt ¶
func (vm *VM) ClearInterrupt()
func (*VM) FillThrowableStackTrace ¶
func (*VM) GetAndClearInterrupt ¶
func (*VM) GetCarrierThread ¶
func (*VM) GetClassLoader ¶
func (vm *VM) GetClassLoader() ir.ClassLoader
func (*VM) GetCurrentClass ¶
func (*VM) GetCurrentMethod ¶
func (*VM) GetCurrentThread ¶
func (*VM) GetMethodDesc ¶
func (vm *VM) GetMethodDesc(i uint16) *desc.MethodDesc
func (*VM) GetObjectClass ¶
func (*VM) GetStringClass ¶
func (*VM) GetThrowableClass ¶
func (*VM) InvokeDynamic ¶
func (*VM) InvokeStatic ¶
func (*VM) InvokeVirtual ¶
func (*VM) LoadNativeMethod ¶
func (vm *VM) LoadNativeMethod(method ir.Method, native NativeMethodCallback)
func (*VM) MarkInterrupt ¶
func (vm *VM) MarkInterrupt()
func (*VM) NewMethodHandle ¶
func (vm *VM) NewMethodHandle(method *jcls.ConstantMethodHandle) ir.Ref
func (*VM) SetCurrentThread ¶
func (*VM) SetupEntryMethod ¶
func (vm *VM) SetupEntryMethod()
Click to show internal directories.
Click to hide internal directories.