runtime: don't call funcPC from a function
commitf88ce9d1680ed21dbc075f0d6f499cfe8ee7c6fb
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Feb 2018 22:04:55 +0000 (7 22:04 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Feb 2018 22:04:55 +0000 (7 22:04 +0000)
tree11e6655920a67f8348528f9cd25ca6b1167eb6d1
parent28092f9dd29a3b0b73e3e9c3e63330203a6b2b24
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.

    Reviewed-on: https://go-review.googlesource.com/92735

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257463 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/gofrontend/MERGE
libgo/go/runtime/cpuprof.go
libgo/go/runtime/proc.go
libgo/go/runtime/signal_unix.go