]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: simplify getargp
authorJosh Bleecher Snyder <josharian@gmail.com>
Thu, 8 Sep 2016 16:49:31 +0000 (09:49 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Thu, 8 Sep 2016 17:10:22 +0000 (17:10 +0000)
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>

src/runtime/panic.go

index 60b277d52cd8198ffc431fe7c7325bcd550686a8..016e29013a9aa55e7aa86a19e4df5d1abfaaf044 100644 (file)
@@ -504,15 +504,9 @@ func gopanic(e interface{}) {
 // 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)))
 }