control

package
v0.0.0-...-0de04ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

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

func (*ARETURN) Execute

func (self *ARETURN) Execute(frame *rtda.Frame)

type DRETURN

type DRETURN struct{ base.NoOperandsInstruction }

DRETURN Return double from method

func (*DRETURN) Execute

func (self *DRETURN) Execute(frame *rtda.Frame)

type FRETURN

type FRETURN struct{ base.NoOperandsInstruction }

FRETURN Return float from method

func (*FRETURN) Execute

func (self *FRETURN) Execute(frame *rtda.Frame)

type GOTO

type GOTO struct{ base.BranchInstruction }

GOTO Branch always goto指令进行无条件跳转

func (*GOTO) Execute

func (self *GOTO) Execute(frame *rtda.Frame)

type IRETURN

type IRETURN struct{ base.NoOperandsInstruction }

IRETURN Return int from method

func (*IRETURN) Execute

func (self *IRETURN) Execute(frame *rtda.Frame)

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 LRETURN

type LRETURN struct{ base.NoOperandsInstruction }

LRETURN Return double from method

func (*LRETURN) Execute

func (self *LRETURN) Execute(frame *rtda.Frame)

type RETURN

type RETURN struct{ base.NoOperandsInstruction } // Return void from method

func (*RETURN) Execute

func (self *RETURN) Execute(frame *rtda.Frame)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL