func newFrame(thread *Thread, maxLocals, maxStack uint) *Frame { return &Frame{ thread: thread, lower: nil, // previous frame localVars: newLocalVars(maxLocals), operandStack: newOperandStack(maxStack), } }
func (self *OperandStack) PushInt(val int32) { self.slots[self.size].num = val self.size++ } func (self *OperandStack) PopInt() int32 { self.size-- return self.slots[self.size].num }
func (self *Frame) GetLocalVars() LocalVars { return self.localVars } func (self *LocalVars) SetInt(index uint, val int32) { self[index].num = val } func (self *LocalVars) GetInt(index uint) int32 { return self[index].num }Overall, the Frame type and its associated methods provide a way to manage the state of a single method invocation in the Java Virtual Machine.