runtime: make internal CallersFrames-equivalent that doesn't escape PC slice
runtime: make internal CallersFrames-equivalent that doesn't escape PC slice

The Frames API forces the PC slice to escape to the heap because it
stores it in the Frames object. However, we'd like to use this API for
call stack expansion internally in the runtime in places where it
would be very good to avoid heap allocation.

This commit makes this possible by pulling the bulk of the Frames
implementation into an internal frameExpander API. The key difference
between these APIs is that the frameExpander does not hold the PC
slice; instead, the caller is responsible for threading the PC slice
through the frameExpander API calls. This makes it possible to keep
the PC slice on the stack. The Frames API then becomes a thin shim
around the frameExpander that keeps the PC slice in the Frames object.

Change-Id: If6b2d0b9132a2a905a0cf5deced9feddce76fc0e
Reviewed-on: https://go-review.googlesource.com/40610
Run-TryBot: Austin Clements <7ea35d812706d9213868749011af1ed4fa2f6aa0@google.com>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: David Lazar <859c8a6d485c34c743019c2e216e6c66f2ebb470@golang.org>

CAFxX/go,codestation/go,CAFxX/go,golang/go,josharian/go,cloudflare/go,vsekhar/elastic-go,josharian/go,ImJasonH/go,josharian/go,cloudflare/go,derekmarcotte/go,derekmarcotte/go,cloudflare/go,golang/go,akutz/go,vsekhar/elastic-go,akutz/go,derekmarcotte/go,polyverse-security/go,ImJasonH/go,derekmarcotte/go,ImJasonH/go,polyverse-security/go,nawawi/go,derekmarcotte/go,ImJasonH/go,Cofyc/go,vsekhar/elastic-go,nawawi/go,codestation/go,codestation/go,polyverse-security/go,polyverse-security/go,vsekhar/elastic-go,Cofyc/go,polyverse-security/go,Cofyc/go,CAFxX/go,akutz/go,josharian/go,derekmarcotte/go,cloudflare/go,CAFxX/go,golang/go,golang/go,Cofyc/go,codestation/go,codestation/go,josharian/go,josharian/go,golang/go,polyverse-security/go,cloudflare/go,CAFxX/go,nawawi/go,Cofyc/go,vsekhar/elastic-go,vsekhar/elastic-go,Cofyc/go,polyverse-security/go,nawawi/go,codestation/go,akutz/go,cloudflare/go,akutz/go,Cofyc/go,akutz/go,nawawi/go,golang/go,CAFxX/go,christopher-henderson/Go,nawawi/go,josharian/go,ImJasonH/go,CAFxX/go,vsekhar/elastic-go,golang/go,nawawi/go,ImJasonH/go,codestation/go,cloudflare/go,Cofyc/go,akutz/go,josharian/go,cloudflare/go,derekmarcotte/go,golang/go,polyverse-security/go,derekmarcotte/go,vsekhar/elastic-go,CAFxX/go,ImJasonH/go,ImJasonH/go,nawawi/go,codestation/go,akutz/go