Push prepares the stack for an impending function call. The stack's frame pointer is incremented, and the stack is resized to make room for a new frame if the caller is on the topmost frame. If the caller is not on the topmost frame it means that a coroutine is being resumed and the next frame is
(s *Stack)
| 67 | // intending to serialize the stack should call Store(fp, frame) for each |
| 68 | // frame during stack unwinding. |
| 69 | func Push[Frame any](s *Stack) *Frame { |
| 70 | if s.isTop() { |
| 71 | s.Frames = append(s.Frames, new(Frame)) |
| 72 | } |
| 73 | s.FP++ |
| 74 | return s.Frames[s.FP].(*Frame) |
| 75 | } |
| 76 | |
| 77 | // Pop pops the topmost stack frame after a function call. |
| 78 | func Pop(s *Stack) { |