** If there is a trimmable frame followed by some locals, pop them all. */
()
| 130 | |
| 131 | /** If there is a trimmable frame followed by some locals, pop them all. */ |
| 132 | func (s *callStack) tailCallTrimStack() { |
| 133 | for i := len(s.stack) - 1; i >= 0; i-- { |
| 134 | if s.stack[i].cleanEnv { |
| 135 | if !s.stack[i].trimmable { |
| 136 | return |
| 137 | } |
| 138 | // Remove this stack frame and everything above it |
| 139 | s.stack = s.stack[:i] |
| 140 | s.calls-- |
| 141 | return |
| 142 | } |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | func (s *callStack) setCurrentTrace(trace traceElement) { |
| 147 | if s.currentTrace != (traceElement{}) { |