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

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