compiler: compile runtime.getcaller{pc,sp} into builtin functions
The runtime functions runtime.getcallerpc and runtime.getcallersp are
intended to be efficient ways to get the return and frame address of the
caller (that is, the caller of runtime.getcallerpc). In the C code that
is implemented by simply using C macros:
This patch essentially implements those macros in the Go code.
It would be nice if we could just use //extern for this, but it doesn't
work because the runtime code passes the right argument. Of course we
could change the runtime code, but these are common enough that I'd
prefer to avoid the difference from the gc version of the runtime code.
This patch corrects the existing declaration of __builtin_return_address
to use uint32, rather than uint, for the parameter type. The builtin
functions take the C type "unsigned int", which for the targets we use
corresponds to the Go type uint32. Not that it should matter, really.
Reviewed-on: https://go-review.googlesource.com/29653
From-SVN: r240382