heap

package
v0.0.0-...-6774e02 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACC_PUBLIC       = 0x0001 // class field method
	ACC_PRIVATE      = 0x0002 //       field method
	ACC_PROTECTED    = 0x0004 //       field method
	ACC_STATIC       = 0x0008 //       field method
	ACC_FINAL        = 0x0010 // class field method
	ACC_SUPER        = 0x0020 // class
	ACC_SYNCHRONIZED = 0x0020 //             method
	ACC_VOLATILE     = 0x0040 //       field
	ACC_BRIDGE       = 0x0040 //             method
	ACC_TRANSIENT    = 0x0080 //       field
	ACC_VARARGS      = 0x0080 //             method
	ACC_NATIVE       = 0x0100 //             method
	ACC_INTERFACE    = 0x0200 // class
	ACC_ABSTRACT     = 0x0400 // class       method
	ACC_STRICT       = 0x0800 //             method
	ACC_SYNTHETIC    = 0x1000 // class field method
	ACC_ANNOTATION   = 0x2000 // class
	ACC_ENUM         = 0x4000 // class field
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Class

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

name, superClassName and interfaceNames are all binary names(jvms8-4.2.1)

func (*Class) ConstantPool

func (self *Class) ConstantPool() *ConstantPool

getters

func (*Class) GetMainMethod

func (self *Class) GetMainMethod() *Method

func (*Class) IsAbstract

func (self *Class) IsAbstract() bool

func (*Class) IsAnnotation

func (self *Class) IsAnnotation() bool

func (*Class) IsEnum

func (self *Class) IsEnum() bool

func (*Class) IsFinal

func (self *Class) IsFinal() bool

func (*Class) IsInterface

func (self *Class) IsInterface() bool

func (*Class) IsPublic

func (self *Class) IsPublic() bool

func (*Class) IsSuper

func (self *Class) IsSuper() bool

func (*Class) IsSynthetic

func (self *Class) IsSynthetic() bool

func (*Class) NewObject

func (self *Class) NewObject() *Object

func (*Class) StaticVars

func (self *Class) StaticVars() Slots

type ClassLoader

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

class names:

  • primitive types: boolean, byte, int ...
  • primitive arrays: [Z, [B, [I ...
  • non-array classes: java/lang/Object ...
  • array classes: [Ljava/lang/Object; ...

func NewClassLoader

func NewClassLoader(cp *classpath.Classpath) *ClassLoader

func (*ClassLoader) LoadClass

func (self *ClassLoader) LoadClass(name string) *Class

type ClassMember

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

func (*ClassMember) Class

func (self *ClassMember) Class() *Class

func (*ClassMember) Descriptor

func (self *ClassMember) Descriptor() string

func (*ClassMember) IsFinal

func (self *ClassMember) IsFinal() bool

func (*ClassMember) IsPrivate

func (self *ClassMember) IsPrivate() bool

func (*ClassMember) IsProtected

func (self *ClassMember) IsProtected() bool

func (*ClassMember) IsPublic

func (self *ClassMember) IsPublic() bool

func (*ClassMember) IsStatic

func (self *ClassMember) IsStatic() bool

func (*ClassMember) IsSynthetic

func (self *ClassMember) IsSynthetic() bool

func (*ClassMember) Name

func (self *ClassMember) Name() string

getters

type ClassRef

type ClassRef struct {
	SymRef
}

type Constant

type Constant interface{}

type ConstantPool

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

func (*ConstantPool) GetConstant

func (self *ConstantPool) GetConstant(index uint) Constant

type Field

type Field struct {
	ClassMember
	// contains filtered or unexported fields
}

func (*Field) ConstValueIndex

func (self *Field) ConstValueIndex() uint

func (*Field) IsEnum

func (self *Field) IsEnum() bool

func (*Field) IsTransient

func (self *Field) IsTransient() bool

func (*Field) IsVolatile

func (self *Field) IsVolatile() bool

func (*Field) SlotId

func (self *Field) SlotId() uint

type FieldRef

type FieldRef struct {
	MemberRef
	// contains filtered or unexported fields
}

func (*FieldRef) ResolvedField

func (self *FieldRef) ResolvedField() *Field

type InterfaceMethodRef

type InterfaceMethodRef struct {
	MemberRef
	// contains filtered or unexported fields
}

func (*InterfaceMethodRef) ResolvedInterfaceMethod

func (self *InterfaceMethodRef) ResolvedInterfaceMethod() *Method

type MemberRef

type MemberRef struct {
	SymRef
	// contains filtered or unexported fields
}

func (*MemberRef) Descriptor

func (self *MemberRef) Descriptor() string

func (*MemberRef) Name

func (self *MemberRef) Name() string

type Method

type Method struct {
	ClassMember
	// contains filtered or unexported fields
}

func (*Method) Code

func (self *Method) Code() []byte

func (*Method) IsAbstract

func (self *Method) IsAbstract() bool

func (*Method) IsBridge

func (self *Method) IsBridge() bool

func (*Method) IsNative

func (self *Method) IsNative() bool

func (*Method) IsStrict

func (self *Method) IsStrict() bool

func (*Method) IsSynchronized

func (self *Method) IsSynchronized() bool

func (*Method) IsVarargs

func (self *Method) IsVarargs() bool

func (*Method) MaxLocals

func (self *Method) MaxLocals() uint

func (*Method) MaxStack

func (self *Method) MaxStack() uint

getters

type MethodRef

type MethodRef struct {
	MemberRef
	// contains filtered or unexported fields
}

func (*MethodRef) ResolvedMethod

func (self *MethodRef) ResolvedMethod() *Method

type Object

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

func (*Object) Class

func (self *Object) Class() *Class

getters

func (*Object) Fields

func (self *Object) Fields() Slots

func (*Object) IsInstanceOf

func (self *Object) IsInstanceOf(class *Class) bool

type SlotCopy

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

本项目中rtda包已经依赖了heap包,而go语言的包又不能互相依赖,所以本heap包无法导入rtda包,否则编辑器会报错。 FIXME 临时解决go的互相依赖/引用问题 拷贝自rtda的slot和localVars的相关代码。

type Slots

type Slots []SlotCopy

func (Slots) GetDouble

func (self Slots) GetDouble(index uint) float64

func (Slots) GetFloat

func (self Slots) GetFloat(index uint) float32

func (Slots) GetInt

func (self Slots) GetInt(index uint) int32

func (Slots) GetLong

func (self Slots) GetLong(index uint) int64

func (Slots) GetRef

func (self Slots) GetRef(index uint) *Object

func (Slots) SetDouble

func (self Slots) SetDouble(index uint, val float64)

double consumes two slots

func (Slots) SetFloat

func (self Slots) SetFloat(index uint, val float32)

func (Slots) SetInt

func (self Slots) SetInt(index uint, val int32)

func (Slots) SetLong

func (self Slots) SetLong(index uint, val int64)

long consumes two slots

func (Slots) SetRef

func (self Slots) SetRef(index uint, ref *Object)

type SymRef

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

symbolic reference

func (*SymRef) ResolvedClass

func (self *SymRef) ResolvedClass() *Class

Jump to

Keyboard shortcuts

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