runtime: don't call funcPC from a function

The escape analysis support is not yet good enough to avoid escaping
the argument to funcPC.  This causes unnecessary and often harmful
memory allocation.  E.g., (*cpuProfile).addExtra can be called from a
signal handler, and it must not allocate memory.

Move the calls to funcPC to use variables instead.  This was done in
the original migration to using funcPC, but was not done for newer code.

In one case, in signal handling code, use getSigtramp.

Change-Id: I5ad5db0a6750250b2c453d3a5a0a9dafdf53c82c
Reviewed-on: https://go-review.googlesource.com/92735
Reviewed-by: Cherry Zhang <cherryyz@google.com>
3 files changed