func newFrame(thread *Thread, method *heap.Method) *Frame { return &Frame{ thread: thread, method: method, maxLocals: method.MaxLocals(), maxStack: method.MaxStack(), localVars: newLocalVars(method.MaxLocals()), operandStack: newOperandStack(method.MaxStack()), } }
func (self *FrameCache) borrowFrame(method *heap.Method) *Frame { if self.frameCount > 0 { for i, frame := range self.cachedFrames { if frame != nil && frame.maxLocals >= method.MaxLocals() && frame.maxStack >= method.MaxStack() { self.frameCount-- self.cachedFrames[i] = nil frame.reset(method) return frame } } } return newFrame(self.thread, method) }