rtda

package
v0.0.0-...-129b147 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ShimBootstrapMethod = &heap.Method{
		ClassMember: newShimMember("<bootstrap>"),
		MethodData: heap.MethodData{
			Code:      []byte{0xff, 0xb1},
			MaxStack:  8,
			MaxLocals: 8,
		},
		ParamSlotCount: 2,
	}
)

Functions

This section is empty.

Types

type Frame

type Frame struct {
	LocalVars
	OperandStack

	Thread *Thread
	Method *heap.Method

	NextPC int // the next instruction after the call
	// contains filtered or unexported fields
}

stack frame

func NewFrame

func NewFrame(maxLocals, maxStack int) *Frame

TODO

func NewShimFrame

func NewShimFrame(thread *Thread, args []heap.Slot) *Frame

TODO

func (*Frame) AppendOnPopAction

func (frame *Frame) AppendOnPopAction(action OnPopAction)

func (*Frame) GetBootLoader

func (frame *Frame) GetBootLoader() *heap.ClassLoader

func (*Frame) GetClass

func (frame *Frame) GetClass() *heap.Class

func (*Frame) GetClassLoader

func (frame *Frame) GetClassLoader() *heap.ClassLoader

todo

func (*Frame) GetConstantPool

func (frame *Frame) GetConstantPool() heap.ConstantPool

func (*Frame) GetRuntime

func (frame *Frame) GetRuntime() *heap.Runtime

shortcuts

func (*Frame) Load

func (frame *Frame) Load(idx uint, isLongOrDouble bool)

func (*Frame) RevertNextPC

func (frame *Frame) RevertNextPC()

func (*Frame) Store

func (frame *Frame) Store(idx uint, isLongOrDouble bool)

type FrameCache

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

type LocalVars

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

func (*LocalVars) DebugGetSlots

func (lv *LocalVars) DebugGetSlots() []heap.Slot

func (*LocalVars) GetBooleanVar

func (lv *LocalVars) GetBooleanVar(index uint) bool

func (*LocalVars) GetDoubleVar

func (lv *LocalVars) GetDoubleVar(index uint) float64

func (*LocalVars) GetFloatVar

func (lv *LocalVars) GetFloatVar(index uint) float32

func (*LocalVars) GetIntVar

func (lv *LocalVars) GetIntVar(index uint) int32

func (*LocalVars) GetLocalVar

func (lv *LocalVars) GetLocalVar(index uint) heap.Slot

func (*LocalVars) GetLongVar

func (lv *LocalVars) GetLongVar(index uint) int64

func (*LocalVars) GetRefVar

func (lv *LocalVars) GetRefVar(index uint) *heap.Object

func (*LocalVars) GetThis

func (lv *LocalVars) GetThis() *heap.Object

func (*LocalVars) SetDoubleVar

func (lv *LocalVars) SetDoubleVar(index uint, val float64)

func (*LocalVars) SetFloatVar

func (lv *LocalVars) SetFloatVar(index uint, val float32)

func (*LocalVars) SetIntVar

func (lv *LocalVars) SetIntVar(index uint, val int32)

func (*LocalVars) SetLocalVar

func (lv *LocalVars) SetLocalVar(index uint, slot heap.Slot)

func (*LocalVars) SetLongVar

func (lv *LocalVars) SetLongVar(index uint, val int64)

func (*LocalVars) SetRefVar

func (lv *LocalVars) SetRefVar(index uint, ref *heap.Object)

type OnPopAction

type OnPopAction func(popped *Frame)

type OperandStack

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

func (*OperandStack) ClearStack

func (stack *OperandStack) ClearStack()

func (*OperandStack) DebugGetSlots

func (stack *OperandStack) DebugGetSlots() []heap.Slot

func (*OperandStack) HackSetSlots

func (stack *OperandStack) HackSetSlots(slots []heap.Slot)

only used by native methods

func (*OperandStack) IsStackEmpty

func (stack *OperandStack) IsStackEmpty() bool

func (*OperandStack) Pop

func (stack *OperandStack) Pop() heap.Slot

func (*OperandStack) PopBoolean

func (stack *OperandStack) PopBoolean() bool

func (*OperandStack) PopDouble

func (stack *OperandStack) PopDouble() float64

func (*OperandStack) PopFloat

func (stack *OperandStack) PopFloat() float32

func (*OperandStack) PopInt

func (stack *OperandStack) PopInt() int32

func (*OperandStack) PopL

func (stack *OperandStack) PopL(isLongOrDouble bool) heap.Slot

func (*OperandStack) PopLong

func (stack *OperandStack) PopLong() int64

func (*OperandStack) PopRef

func (stack *OperandStack) PopRef() *heap.Object

func (*OperandStack) PopTops

func (stack *OperandStack) PopTops(n uint) []heap.Slot

func (*OperandStack) Push

func (stack *OperandStack) Push(slot heap.Slot)

func (*OperandStack) PushBoolean

func (stack *OperandStack) PushBoolean(val bool)

func (*OperandStack) PushDouble

func (stack *OperandStack) PushDouble(val float64)

double consumes two slots

func (*OperandStack) PushFloat

func (stack *OperandStack) PushFloat(val float32)

func (*OperandStack) PushInt

func (stack *OperandStack) PushInt(val int32)

func (*OperandStack) PushL

func (stack *OperandStack) PushL(slot heap.Slot, isLongOrDouble bool)

func (*OperandStack) PushLong

func (stack *OperandStack) PushLong(val int64)

long consumes two slots

func (*OperandStack) PushNull

func (stack *OperandStack) PushNull()

func (*OperandStack) PushRef

func (stack *OperandStack) PushRef(ref *heap.Object)

func (*OperandStack) TopRef

func (stack *OperandStack) TopRef(n uint) *heap.Object

type Stack

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

jvm stack

type Thread

type Thread struct {
	PC int // the address of the instruction currently being executed

	VMOptions *vm.Options
	JNIEnv    interface{}
	Runtime   *heap.Runtime
	// contains filtered or unexported fields
}

JVM

Thread
  pc
  Stack
    Frame
      LocalVars
      OperandStack

func NewThread

func NewThread(jThread *heap.Object, opts *vm.Options, rt *heap.Runtime) *Thread

func (*Thread) CurrentFrame

func (thread *Thread) CurrentFrame() *Frame

func (*Thread) HackSetJThread

func (thread *Thread) HackSetJThread(jThread *heap.Object)

hack

func (*Thread) HandleUncaughtException

func (thread *Thread) HandleUncaughtException(ex *heap.Object)

func (*Thread) InitClass

func (thread *Thread) InitClass(class *heap.Class)

func (*Thread) Interrupt

func (thread *Thread) Interrupt()

func (*Thread) InvokeMethod

func (thread *Thread) InvokeMethod(method *heap.Method)

func (*Thread) InvokeMethodWithShim

func (thread *Thread) InvokeMethodWithShim(method *heap.Method, args []heap.Slot)

func (*Thread) IsInterrupted

func (thread *Thread) IsInterrupted(clearInterrupted bool) bool

func (*Thread) IsStackEmpty

func (thread *Thread) IsStackEmpty() bool

func (*Thread) JThread

func (thread *Thread) JThread() *heap.Object

getters & setters

func (*Thread) NewFrame

func (thread *Thread) NewFrame(method *heap.Method) *Frame

func (*Thread) Park

func (thread *Thread) Park(d time.Duration)

func (*Thread) PopFrame

func (thread *Thread) PopFrame() *Frame

func (*Thread) PushFrame

func (thread *Thread) PushFrame(frame *Frame)

func (*Thread) Sleep

func (thread *Thread) Sleep(d time.Duration) (interrupted bool)

func (*Thread) StackDepth

func (thread *Thread) StackDepth() uint

func (*Thread) ThrowArrayIndexOutOfBoundsException

func (thread *Thread) ThrowArrayIndexOutOfBoundsException(index int32)

func (*Thread) ThrowArrayIndexOutOfBoundsExceptionNoMsg

func (thread *Thread) ThrowArrayIndexOutOfBoundsExceptionNoMsg()

func (*Thread) ThrowClassCastException

func (thread *Thread) ThrowClassCastException(from, to *heap.Class)

func (*Thread) ThrowClassNotFoundException

func (thread *Thread) ThrowClassNotFoundException(name string)

func (*Thread) ThrowDivByZero

func (thread *Thread) ThrowDivByZero()

func (*Thread) ThrowFileNotFoundException

func (thread *Thread) ThrowFileNotFoundException(name string)

func (*Thread) ThrowIOException

func (thread *Thread) ThrowIOException(name string)

func (*Thread) ThrowIllegalArgumentException

func (thread *Thread) ThrowIllegalArgumentException(msg string)

func (*Thread) ThrowInterruptedException

func (thread *Thread) ThrowInterruptedException(msg string)

func (*Thread) ThrowNPE

func (thread *Thread) ThrowNPE()

func (*Thread) ThrowNegativeArraySizeException

func (thread *Thread) ThrowNegativeArraySizeException()

func (*Thread) TopFrame

func (thread *Thread) TopFrame() *Frame

func (*Thread) TopFrameN

func (thread *Thread) TopFrameN(n uint) *Frame

func (*Thread) Unpark

func (thread *Thread) Unpark()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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