Documentation ¶
Index ¶
- Constants
- func GetParamCount(desc string) int
- func Load(raw []byte) *entity.ByteCode
- type Frame
- type Thread
- type ThreadPool
- type VM
- func (v *VM) AppendClass(class *entity.Class)
- func (v *VM) Boot()
- func (v *VM) CreateThreadPool() *ThreadPool
- func (v *VM) Exec(f *Frame) []interface{}
- func (v *VM) InvokeMethod(method *entity.Method, args ...interface{}) *Frame
- func (v *VM) InvokeRuntimeMethod(method *entity.Method, args ...interface{}) *Frame
- func (v *VM) InvokeVirtualMethod(method *entity.Method, args ...interface{}) *Frame
- func (v *VM) LocateClass(className string) *entity.Class
- func (v *VM) LocateMethod(className string, methodName string, desc string) *entity.Method
Constants ¶
View Source
const ( FrameReady = 0 FrameExit = 1 FramePush = 2 )
View Source
const ( OpNop = 0x0 OpIConstM1 = 0x2 OpIConst0 = 0x3 OpIConst1 = 0x4 OpIConst2 = 0x5 OpIConst3 = 0x6 OpIConst4 = 0x7 OpIConst5 = 0x8 OpLDC = 0x12 OpILoad = 0x15 OpILoad0 = 0x1a OpILoad1 = 0x1b OpILoad2 = 0x1c OpILoad3 = 0x1d OpALoad = 0x25 OpALoad0 = 0x2a OpALoad1 = 0x2b OpALoad2 = 0x2c OpALoad3 = 0x2d OpIStore = 0x36 OpIStore0 = 0x3b OpIStore1 = 0x3c OpIStore2 = 0x3d OpIStore3 = 0x3e OpAStore = 0x3A OpAStore0 = 0x4b OpAStore1 = 0x4c OpAStore2 = 0x4d OpAStore3 = 0x4e OpDup = 0x59 OpIAdd = 0x60 OpIMul = 0x68 OpIReturn = 0xAC OpAReturn = 0xB0 OpReturn = 0xB1 OpGetStatic = 0xB2 OpGetField = 0xB4 OpPutField = 0xB5 OpInvokeVirtual = 0xB6 OpInvokeSpecial = 0xB7 OpInvokeStatic = 0xB8 OpInvokeDynamic = 0xBA OpNew = 0xBB OpBiPush = 0x10 OpSiPush = 0x11 OpIfICmpEq = 0x9f OpIfICmpNe = 0xa0 OpIfICmpLt = 0xa1 OpIfICmpGe = 0xa2 OpIfICmpGt = 0xa3 OpIfICmpLe = 0xa4 OpIfACmpEq = 0xa5 OpIfACmpNe = 0xa6 OpGoto = 0xa7 OpIInc = 0x84 OpPatch = 0xff )
View Source
const ( ThreadReady = 0 ThreadBlocked = 1 ThreadExit = 2 )
Variables ¶
This section is empty.
Functions ¶
func GetParamCount ¶
Types ¶
type ThreadPool ¶
type ThreadPool struct {
// contains filtered or unexported fields
}
func (*ThreadPool) CreateThread ¶
func (p *ThreadPool) CreateThread(frame *Frame) *Thread
func (*ThreadPool) DeleteThread ¶
func (p *ThreadPool) DeleteThread(idx int)
DeleteThread delete a thread permanently
func (*ThreadPool) GetThread ¶
func (p *ThreadPool) GetThread(idx int) *Thread
func (*ThreadPool) Schedule ¶
func (p *ThreadPool) Schedule()
Schedule to schedule the threads in the pool
type VM ¶
type VM struct {
// contains filtered or unexported fields
}
func (*VM) AppendClass ¶
func (*VM) CreateThreadPool ¶
func (v *VM) CreateThreadPool() *ThreadPool
func (*VM) InvokeMethod ¶
func (*VM) InvokeRuntimeMethod ¶
func (*VM) InvokeVirtualMethod ¶
Click to show internal directories.
Click to hide internal directories.