heap

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: 10 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
	ACC_STRICT       = 0x0800 //             method
	ACC_SYNTHETIC    = 0x1000 // class field method
	ACC_ANNOTATION   = 0x2000 // class
	ACC_ENUM         = 0x4000 // class field
)
View Source
const (
	Boolean uint8 = 4
	Char    uint8 = 5
	Float   uint8 = 6
	Double  uint8 = 7
	Byte    uint8 = 8
	Short   uint8 = 9
	Int     uint8 = 10
	Long    uint8 = 11
)

Variables

This section is empty.

Functions

func GoString

func GoString(jStr *NormalObject) string

func UTF16ToString

func UTF16ToString(s []uint16) string

Types

type ArrayObject

type ArrayObject struct {
	BaseObject
	// contains filtered or unexported fields
}

func (*ArrayObject) ArrayLength

func (this *ArrayObject) ArrayLength() int32

func (*ArrayObject) CopyTo

func (this *ArrayObject) CopyTo(dest *ArrayObject, srcPos int32, destPos int32, length int32)

func (*ArrayObject) Get

func (this *ArrayObject) Get(index int32) interface{}

func (*ArrayObject) Set

func (this *ArrayObject) Set(index int32, value interface{})

type BaseObject

type BaseObject struct {
	MarkWord
	// contains filtered or unexported fields
}

func (*BaseObject) Class

func (this *BaseObject) Class() *ClassObject

func (*BaseObject) HashCode

func (this *BaseObject) HashCode() int32

func (*BaseObject) IsInstanceOf

func (this *BaseObject) IsInstanceOf(targetClass *ClassObject) bool

type ClassLoader

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

func NewClassLoader

func NewClassLoader(cp *classpath.Classpath) *ClassLoader

func (*ClassLoader) LoadClass

func (this *ClassLoader) LoadClass(classname string) *ClassObject

func (*ClassLoader) LoadPrimitiveArrayClass

func (this *ClassLoader) LoadPrimitiveArrayClass(aType uint8) *ClassObject

type ClassMember

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

func (*ClassMember) Class

func (this *ClassMember) Class() *ClassObject

func (*ClassMember) Descriptor

func (this *ClassMember) Descriptor() string

func (*ClassMember) IsPrivate

func (this *ClassMember) IsPrivate() bool

func (*ClassMember) IsProtected

func (this *ClassMember) IsProtected() bool

func (*ClassMember) IsPublic

func (this *ClassMember) IsPublic() bool

func (*ClassMember) Name

func (this *ClassMember) Name() string

type ClassMemberSymRef

type ClassMemberSymRef struct {
	SymbolicRef
	// contains filtered or unexported fields
}

func (*ClassMemberSymRef) Descriptor

func (this *ClassMemberSymRef) Descriptor() string

func (*ClassMemberSymRef) Name

func (this *ClassMemberSymRef) Name() string

type ClassObject

type ClassObject struct {
	*NormalObject
	// contains filtered or unexported fields
}

func (*ClassObject) ArrayClass

func (this *ClassObject) ArrayClass() *ClassObject

func (*ClassObject) ClassLoader

func (this *ClassObject) ClassLoader() *ClassLoader

func (*ClassObject) ConstantPool

func (this *ClassObject) ConstantPool() *ConstantPool

func (*ClassObject) ElementClass

func (this *ClassObject) ElementClass() *ClassObject

func (*ClassObject) GetClinitMethod

func (this *ClassObject) GetClinitMethod() *Method

func (*ClassObject) GetField

func (this *ClassObject) GetField(obj *NormalObject, name string, descriptor string) interface{}

func (*ClassObject) GetMainMethod

func (this *ClassObject) GetMainMethod() *Method

func (*ClassObject) GetMethod

func (this *ClassObject) GetMethod(name string, descriptor string) *Method

func (*ClassObject) InitStarted

func (this *ClassObject) InitStarted() bool

func (*ClassObject) IsAbstract

func (this *ClassObject) IsAbstract() bool

func (*ClassObject) IsArray

func (this *ClassObject) IsArray() bool

func (*ClassObject) IsClassClass

func (this *ClassObject) IsClassClass() bool

func (*ClassObject) IsImplClassOf

func (this *ClassObject) IsImplClassOf(interfaceClass *ClassObject) bool

func (*ClassObject) IsInterface

func (this *ClassObject) IsInterface() bool

func (*ClassObject) IsPrimitive

func (this *ClassObject) IsPrimitive() bool

func (*ClassObject) IsPublic

func (this *ClassObject) IsPublic() bool

func (*ClassObject) IsSubClassOf

func (this *ClassObject) IsSubClassOf(class *ClassObject) bool

func (*ClassObject) IsSubInterfaceOf

func (this *ClassObject) IsSubInterfaceOf(target *ClassObject) bool

func (*ClassObject) IsSuper

func (this *ClassObject) IsSuper() bool

func (*ClassObject) JavaName

func (this *ClassObject) JavaName() string

func (*ClassObject) Name

func (this *ClassObject) Name() string

func (*ClassObject) NewArray

func (this *ClassObject) NewArray(count int32) *ArrayObject

func (*ClassObject) NewObject

func (this *ClassObject) NewObject() Object

func (*ClassObject) PackageName

func (this *ClassObject) PackageName() string

func (*ClassObject) SetField

func (this *ClassObject) SetField(obj *NormalObject, name string, descriptor string, value interface{})

func (*ClassObject) SourceFile

func (this *ClassObject) SourceFile() string

func (*ClassObject) StartInit

func (this *ClassObject) StartInit()

func (*ClassObject) StaticSlots

func (this *ClassObject) StaticSlots() Slots

func (*ClassObject) SuperClass

func (this *ClassObject) SuperClass() *ClassObject

type ClassSymRef

type ClassSymRef struct {
	SymbolicRef
}

type Constant

type Constant interface {
}

type ConstantPool

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

func (*ConstantPool) Class

func (this *ConstantPool) Class() *ClassObject

func (*ConstantPool) GetConstant

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

type ExceptionHandler

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

ExceptionTableEntry

func (*ExceptionHandler) EndPc

func (this *ExceptionHandler) EndPc() uint16

func (*ExceptionHandler) HandlerPc

func (this *ExceptionHandler) HandlerPc() uint16

func (*ExceptionHandler) StartPc

func (this *ExceptionHandler) StartPc() uint16

type ExceptionTable

type ExceptionTable []*ExceptionHandler

type Field

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

func (*Field) ConstValueIndex

func (this *Field) ConstValueIndex() uint

func (*Field) IsDoubleOrLong

func (this *Field) IsDoubleOrLong() bool

func (*Field) IsFinal

func (this *Field) IsFinal() bool

func (*Field) IsStatic

func (this *Field) IsStatic() bool

func (*Field) SlotId

func (this *Field) SlotId() uint

type FieldSymRef

type FieldSymRef struct {
	ClassMemberSymRef
	// contains filtered or unexported fields
}

func (*FieldSymRef) ResolvedField

func (this *FieldSymRef) ResolvedField() *Field

type IMethodSymRef

type IMethodSymRef interface {
	ResolvedMethod() *Method
}

type InterfaceMethodSymRef

type InterfaceMethodSymRef struct {
	MethodSymRef
}

func (*InterfaceMethodSymRef) ResolvedInterfaceMethod

func (this *InterfaceMethodSymRef) ResolvedInterfaceMethod() *Method

func (*InterfaceMethodSymRef) ResolvedMethod

func (this *InterfaceMethodSymRef) ResolvedMethod() *Method

type MarkWord

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

type Method

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

func LookupMethodInClass

func LookupMethodInClass(kls *ClassObject, name string, descriptor string) *Method

func LookupMethodInInterface

func LookupMethodInInterface(inf *ClassObject, name string, descriptor string) *Method

func VoidVirtualMethod

func VoidVirtualMethod(maxStack, maxLocals uint) *Method

func (*Method) ArgSlotCount

func (this *Method) ArgSlotCount() uint

func (*Method) Class

func (this *Method) Class() *ClassObject

func (*Method) Code

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

func (*Method) GetLineNumber

func (this *Method) GetLineNumber(pc int) int

func (*Method) InjectNativeCodeAttr

func (this *Method) InjectNativeCodeAttr(returnType string)

func (*Method) IsAbstract

func (this *Method) IsAbstract() bool

func (*Method) IsCLInit

func (this *Method) IsCLInit() bool

func (*Method) IsInit

func (this *Method) IsInit() bool

func (*Method) IsNative

func (this *Method) IsNative() bool

func (*Method) IsStatic

func (this *Method) IsStatic() bool

func (*Method) LookupExceptionTable

func (this *Method) LookupExceptionTable(class *ClassObject, pc uint16) *ExceptionHandler

func (*Method) MaxLocals

func (this *Method) MaxLocals() uint

func (*Method) MaxStack

func (this *Method) MaxStack() uint

type MethodDescriptor

type MethodDescriptor struct {
	ParameterTypes []TypeDescriptor
	ReturnType     TypeDescriptor
}

type MethodDescriptorParser

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

type MethodSymRef

type MethodSymRef struct {
	ClassMemberSymRef
	// contains filtered or unexported fields
}

func (*MethodSymRef) ResolvedMethod

func (this *MethodSymRef) ResolvedMethod() *Method

type NormalObject

type NormalObject struct {
	BaseObject
	// contains filtered or unexported fields
}

func JString

func JString(loader *ClassLoader, goStr string) *NormalObject

func (*NormalObject) FieldSlots

func (this *NormalObject) FieldSlots() Slots

func (*NormalObject) GetExtend

func (this *NormalObject) GetExtend() interface{}

func (*NormalObject) SetExtend

func (this *NormalObject) SetExtend(extend interface{})

type Object

type Object interface {
	Class() *ClassObject

	IsInstanceOf(targetClass *ClassObject) bool

	HashCode() int32
}

func Intern0

func Intern0(jStr *NormalObject) Object

type Slot

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

type Slots

type Slots []Slot

func (Slots) GetDouble

func (this Slots) GetDouble(index uint) float64

func (Slots) GetFloat

func (this Slots) GetFloat(index uint) float32

func (Slots) GetInt

func (this Slots) GetInt(index uint) int32

func (Slots) GetLong

func (this Slots) GetLong(index uint) int64

func (Slots) GetRef

func (this Slots) GetRef(index uint) Object

func (Slots) SetDouble

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

func (Slots) SetFloat

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

func (Slots) SetInt

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

func (Slots) SetLong

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

func (Slots) SetRef

func (this Slots) SetRef(index uint, ref Object)

type SymbolicRef

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

符号引用

func (*SymbolicRef) ResolveClassRef

func (this *SymbolicRef) ResolveClassRef() *ClassObject

func (*SymbolicRef) ResolvedClass

func (this *SymbolicRef) ResolvedClass() *ClassObject

type TypeDescriptor

type TypeDescriptor string

https://github.com/zxh0/jvm.go/blob/129b147ebc/rtda/heap/descriptor.go https://github.com/zxh0/jvm.go/blob/129b147ebc/rtda/heap/descriptor.go https://github.com/zxh0/jvm.go/blob/129b147ebc/rtda/heap/descriptor.go

func (TypeDescriptor) IsArrayType

func (td TypeDescriptor) IsArrayType() bool

func (TypeDescriptor) IsBaseType

func (td TypeDescriptor) IsBaseType() bool

func (TypeDescriptor) IsLongOrDouble

func (td TypeDescriptor) IsLongOrDouble() bool

func (TypeDescriptor) IsObjectType

func (td TypeDescriptor) IsObjectType() bool

func (TypeDescriptor) IsVoidType

func (td TypeDescriptor) IsVoidType() bool

Jump to

Keyboard shortcuts

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