Example #1
0
func newShimFrame(thread *Thread, args []interface{}) *Frame {
	frame := &Frame{}
	frame.thread = thread
	frame.method = heap.ReturnMethod()
	frame.operandStack = &OperandStack{
		size:  uint(len(args)),
		slots: args,
	}
	return frame
}
Example #2
0
func callClinit(thread *Thread, class *heap.Class) {
	clinit := class.GetClinitMethod()
	if clinit == nil {
		clinit = heap.ReturnMethod() // just do nothing
	}

	// exec <clinit>
	newFrame := thread.NewFrame(clinit)
	newFrame.SetOnPopAction(func() {
		// step 10
		initSucceeded(class)
	})
	thread.PushFrame(newFrame)
}