Documentation ¶
Index ¶
- func Branch(frame *rtda.Frame, offset int)
- func InitClass(thread *rtda.Thread, class *heap.Class)
- func InvokeMethod(invokerFrame *rtda.Frame, method *heap.Method)
- type BranchInstruction
- type BytecodeReader
- func (self *BytecodeReader) PC() int
- func (self *BytecodeReader) ReadInt16() int16
- func (self *BytecodeReader) ReadInt32() int32
- func (self *BytecodeReader) ReadInt32s(n int32) []int32
- func (self *BytecodeReader) ReadInt8() int8
- func (self *BytecodeReader) ReadUint16() uint16
- func (self *BytecodeReader) ReadUint8() uint8
- func (self *BytecodeReader) Reset(code []byte, pc int)
- func (self *BytecodeReader) SkipPadding()
- type Index16Instruction
- type Index8Instruction
- type Instruction
- type NoOperandsInstruction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BranchInstruction ¶
type BranchInstruction struct {
Offset int
}
分支指令结构体 一般用于if else,for等条件语句中
func (*BranchInstruction) FetchOperands ¶
func (self *BranchInstruction) FetchOperands(reader *BytecodeReader)
type BytecodeReader ¶
type BytecodeReader struct {
// contains filtered or unexported fields
}
字节码阅读器
func (*BytecodeReader) PC ¶
func (self *BytecodeReader) PC() int
func (*BytecodeReader) ReadInt16 ¶
func (self *BytecodeReader) ReadInt16() int16
func (*BytecodeReader) ReadInt32 ¶
func (self *BytecodeReader) ReadInt32() int32
func (*BytecodeReader) ReadInt32s ¶
func (self *BytecodeReader) ReadInt32s(n int32) []int32
func (*BytecodeReader) ReadInt8 ¶
func (self *BytecodeReader) ReadInt8() int8
int8 signed 8-bit integers,range:-128 through 127
func (*BytecodeReader) ReadUint16 ¶
func (self *BytecodeReader) ReadUint16() uint16
func (*BytecodeReader) ReadUint8 ¶
func (self *BytecodeReader) ReadUint8() uint8
uint unsigned 8-bit integers,range:0 through 255
func (*BytecodeReader) SkipPadding ¶
func (self *BytecodeReader) SkipPadding()
type Index16Instruction ¶
type Index16Instruction struct {
Index uint
}
16位长度的指令
func (*Index16Instruction) FetchOperands ¶
func (self *Index16Instruction) FetchOperands(reader *BytecodeReader)
type Index8Instruction ¶
type Index8Instruction struct {
Index uint
}
func (*Index8Instruction) FetchOperands ¶
func (self *Index8Instruction) FetchOperands(reader *BytecodeReader)
根据索引获取局部变量表
type Instruction ¶
type Instruction interface { // 从字节码中提取操作数 FetchOperands(reader *BytecodeReader) // 操作指令 Execute(frame *rtda.Frame) }
指令接口,指令主要两个功能: 1 从字节码中获取操作数 2 执行操作指令
type NoOperandsInstruction ¶
type NoOperandsInstruction struct{}
无操作指令 结构体 提供给其他相同没有操作的指令结构体调用
func (*NoOperandsInstruction) FetchOperands ¶
func (self *NoOperandsInstruction) FetchOperands(reader *BytecodeReader)
Click to show internal directories.
Click to hide internal directories.