heap

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// public
	ACC_PUBLIC = 0x0001
	// private
	ACC_PRIVATE = 0x0002
	// protected
	ACC_PROTECTED = 0x0004
	// static
	ACC_STATIC = 0x0008
	// final
	ACC_FINAL = 0x0010
	// synchronized
	ACC_SYNCHRONIZED = 0x0020
	// volatile
	ACC_VOLATILE = 0x0020
	// super
	ACC_SUPER = 0x0020
	// bridge
	ACC_BRIDGE = 0x0040
	// transient
	ACC_TRANSIENT = 0x0040
	// varargs
	ACC_VARARGS = 0x0080
	// native
	ACC_NATIVE = 0x0100
	// interface
	ACC_INTERFACE = 0x0200
	// abstract
	ACC_ABSTRACT = 0x0400
	// strict
	ACC_STRICT = 0x0800
	// synthetic
	ACC_SYNTHETIC = 0x1000
	// annotation
	ACC_ANNOTATION = 0x2000
	// enum
	ACC_ENUM = 0x4000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Class

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

func (*Class) ConstantPool

func (self *Class) ConstantPool() *ConstantPool

func (*Class) GetMainMethod

func (self *Class) GetMainMethod() *Method

func (Class) IsAbstract

func (self Class) IsAbstract() bool

func (*Class) IsInterface

func (self *Class) IsInterface() bool

func (*Class) IsPrivate

func (self *Class) IsPrivate() bool

func (*Class) IsProtected

func (self *Class) IsProtected() bool

func (*Class) IsPublic

func (self *Class) IsPublic() 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
}

类加载器 类加载器依赖ClassPath来搜寻和读取class文件

func NewClassLoader

func NewClassLoader(cp *classpath.Classpath) *ClassLoader

创建一个加载器实例

func (*ClassLoader) LoadClass

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

在classMap中根据name查询类 然后将将类数据加载到方法区中

type ClassMember

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

func (*ClassMember) IsPrivate

func (self *ClassMember) IsPrivate() bool

func (*ClassMember) IsProtected

func (self *ClassMember) IsProtected() bool

func (*ClassMember) IsPublic

func (self *ClassMember) IsPublic() bool

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

根据索引返回常量

func (*ConstantPool) Name

func (self *ConstantPool) Name() string

type Field

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

实例字段

func (Field) Class

func (self Field) Class() *Class

func (Field) ConstValueIndex

func (self Field) ConstValueIndex() uint

func (Field) Descriptor

func (self Field) Descriptor() string

func (Field) IsFinal

func (self Field) IsFinal() bool

func (Field) IsLongOrDouble

func (self Field) IsLongOrDouble() bool

判断描述符是否属于J或者D,J -> long,D -> double 基本类型中,除了long的定义奇特外,其他都是基于首字母

func (Field) IsStatic

func (self Field) IsStatic() bool

func (Field) SlotId

func (self Field) SlotId() uint

type FieldRef

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

func (FieldRef) IsStatic

func (self FieldRef) IsStatic() bool

func (*FieldRef) ResolvedField

func (self *FieldRef) ResolvedField() *Field

* 字段符号引用解析

type InterfaceMethodRef

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

接口方法的符号引用

type MemberRef

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

type Method

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

func (*Method) Class

func (self *Method) Class() *Class

func (*Method) Code

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

func (Method) IsStatic

func (self Method) IsStatic() bool

func (Method) MaxLocals

func (self Method) MaxLocals() uint16

func (Method) MaxStack

func (self Method) MaxStack() uint16

func (Method) Name

func (self Method) Name() string

type MethodRef

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

func (MethodRef) Descriptor

func (self MethodRef) Descriptor() string

func (MethodRef) Name

func (self MethodRef) Name() string

type Object

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

func (*Object) Fields

func (self *Object) Fields() Slots

func (*Object) IsInstanceOf

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

type Slot

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

type Slots

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

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)

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)

func (Slots) SetRef

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

type SymRef

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

符号引用 cp,className,class是所有符号引用通用的字段 利用继承的方式来进行定制

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