base

package
v0.0.0-...-26bd4cb Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BranchJump

func BranchJump(frame *rtda.Frame, offset int)

func InitClass

func InitClass(thread *rtda.Thread, class *heap.ClassObject)

Types

type BranchInstruction

type BranchInstruction struct {
	Offset int
}

func (*BranchInstruction) FetchOperands

func (this *BranchInstruction) FetchOperands(reader *ByteCodeReader)

type ByteCodeReader

type ByteCodeReader struct {
	// contains filtered or unexported fields
}

func (*ByteCodeReader) PC

func (this *ByteCodeReader) PC() int

func (*ByteCodeReader) ReadInt16

func (this *ByteCodeReader) ReadInt16() int16

func (*ByteCodeReader) ReadInt32

func (this *ByteCodeReader) ReadInt32() int32

字节码字节流大段法存储,先读到的数据在高位

func (*ByteCodeReader) ReadUint16

func (this *ByteCodeReader) ReadUint16() uint16

字节码字节流大段法存储,先读到的数据在高位

func (*ByteCodeReader) ReadUint8

func (this *ByteCodeReader) ReadUint8() uint8

从当前PC指向的的位置读取一个字节

func (*ByteCodeReader) Reset

func (this *ByteCodeReader) Reset(code []byte, pc int)

func (*ByteCodeReader) SkipPadding

func (this *ByteCodeReader) SkipPadding()

type Index16Instruction

type Index16Instruction struct {
	Index uint
}

操作数是两个字节的下标,通常是运行时常量表的下标

func (*Index16Instruction) FetchOperands

func (this *Index16Instruction) FetchOperands(reader *ByteCodeReader)

type Index8Instruction

type Index8Instruction struct {
	Index uint
}

操作数是单字节下标,通常是从本地变量表的下标

func (*Index8Instruction) FetchOperands

func (this *Index8Instruction) FetchOperands(reader *ByteCodeReader)

type Instruction

type Instruction interface {
	// 从 reader 里读取操作数,不同的指令操作数个数、类型不同
	FetchOperands(reader *ByteCodeReader)

	// 执行指令
	Execute(frame *rtda.Frame)
}

type NoOperandsInstruction

type NoOperandsInstruction struct {
}

无操作数的指令

func (*NoOperandsInstruction) FetchOperands

func (this *NoOperandsInstruction) FetchOperands(reader *ByteCodeReader)

Jump to

Keyboard shortcuts

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