Change-Id: I9ed62e8a6d8b9204c18748efd7845adabf3460b9
Reviewed-on: https://go-review.googlesource.com/28775
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
// getargp returns the location where the caller
// writes outgoing function call arguments.
//go:nosplit
+//go:noinline
func getargp(x int) uintptr {
// x is an argument mainly so that we can return its address.
- // However, we need to make the function complex enough
- // that it won't be inlined. We always pass x = 0, so this code
- // does nothing other than keep the compiler from thinking
- // the function is simple enough to inline.
- if x > 0 {
- return getcallersp(unsafe.Pointer(&x)) * 0
- }
return uintptr(noescape(unsafe.Pointer(&x)))
}