Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ARETURN ¶
type ARETURN struct{ base.NoOperandsInstruction }
ARETURN Return reference from method
type LOOKUP_SWITCH ¶
type LOOKUP_SWITCH struct {
// contains filtered or unexported fields
}
LOOKUP_SWITCH
matchOffsets有点像Map,它的key是case值,value是跳转偏移 量。Execute()方法先从操作数栈中弹出一个int变量,然后用它查找 matchOffsets,看是否能找到匹配的key。如果能,则按照value给出的 偏移量跳转,否则按照defaultOffset跳转。 lookupswitch <0-3 byte pad> defaultbyte1 defaultbyte2 defaultbyte3 defaultbyte4 npairs1 npairs2 npairs3 npairs4 match-offset pairs...
Access jump table by key match and jump
func (*LOOKUP_SWITCH) Execute ¶
func (self *LOOKUP_SWITCH) Execute(frame *rtda.Frame)
func (*LOOKUP_SWITCH) FetchOperands ¶
func (self *LOOKUP_SWITCH) FetchOperands(reader *base.BytecodeReader)
type RETURN ¶
type RETURN struct{ base.NoOperandsInstruction } // Return void from method
type TABLE_SWITCH ¶
type TABLE_SWITCH struct {
// contains filtered or unexported fields
}
TABLE_SWITCH
Java语言中的switch-case语句有两种实现方式:如果case值可以 编码成一个索引表,则实现成tableswitch指令;否则实现成 lookupswitch指令。
defaultOffset对应默认情况下执行跳转所需的字节码偏移量; low和high记录case的取值范围;jumpOffsets是一个索引表,里面存 放high-low+1个int值,对应各种case情况下,执行跳转所需的字节 码偏移量。 tableswitch
<0-3 byte pad> defaultbyte1 defaultbyte2 defaultbyte3 defaultbyte4 lowbyte1 lowbyte2 lowbyte3 lowbyte4 highbyte1 highbyte2 highbyte3 highbyte4 jump offsets...
Access jump table by index and jump
func (*TABLE_SWITCH) Execute ¶
func (self *TABLE_SWITCH) Execute(frame *rtda.Frame)
func (*TABLE_SWITCH) FetchOperands ¶
func (self *TABLE_SWITCH) FetchOperands(reader *base.BytecodeReader)