bytecode

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteCode

type ByteCode struct {
	Offset    uint32
	Operand   string
	Arguments []byte
	IndexByte bool
}

func LookupSwitch

func LookupSwitch(op string, p *uint32, r io.Reader) (bc *ByteCode, err error)

func Read

func Read(r io.Reader) (codes []*ByteCode, err error)

func Simple

func Simple(op string, c *Context) (*ByteCode, error)

func TableSwitch

func TableSwitch(op string, p *uint32, r io.Reader) (bc *ByteCode, err error)

A tableswitch is a variable-length instruction. Immediately after the tableswitch opcode, between zero and three bytes must act as padding, such that defaultbyte1 begins at an address that is a multiple of four bytes from the start of the current method (the opcode of its first instruction). Immediately after the padding are bytes constituting three signed 32-bit values: default, low, and high. Immediately following are bytes constituting a series of high - low + 1 signed 32-bit offsets. The value low must be less than or equal to high. The high - low + 1 signed 32-bit offsets are treated as a 0-based jump table. Each of these signed 32-bit values is constructed as (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4.

func Wide

func Wide(op string, p *uint32, r io.Reader) (bc *ByteCode, err error)

func WithArgs

func WithArgs(op string, c *Context, index bool, count int) (bc *ByteCode, err error)

func (ByteCode) String

func (bc ByteCode) String() string

func (*ByteCode) StringWithIndex

func (bc *ByteCode) StringWithIndex(pool cpool.ConstantPool) string

type Context

type Context struct {
	io.Reader
	// contains filtered or unexported fields
}

type MatchOffset

type MatchOffset struct {
	Match  int32
	Offset int32
}

type Reader

type Reader func(rc *Context) (*ByteCode, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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