]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: remove unneeded noinline directives
authorKeith Randall <khr@google.com>
Mon, 16 Sep 2019 23:53:23 +0000 (16:53 -0700)
committerKeith Randall <khr@golang.org>
Tue, 17 Sep 2019 17:17:11 +0000 (17:17 +0000)
Now that mid-stack inlining reports backtraces correctly, we no
longer need to protect against inlining in a few critical areas.

Update #19348
Update #28640
Update #34276

Change-Id: Ie68487e6482c3a9509ecf7ecbbd40fe43cee8381
Reviewed-on: https://go-review.googlesource.com/c/go/+/195818
Reviewed-by: David Chase <drchase@google.com>
src/runtime/extern.go
src/runtime/stack_test.go

index 2917efefa61ad057baedc52222a6fcc26c79c8d3..4ddf3549e6934de6034fb1fe6263b9c8e7d22ce8 100644 (file)
@@ -200,7 +200,6 @@ func Caller(skip int) (pc uintptr, file string, line int, ok bool) {
 // directly is discouraged, as is using FuncForPC on any of the
 // returned PCs, since these cannot account for inlining or return
 // program counter adjustment.
-//go:noinline
 func Callers(skip int, pc []uintptr) int {
        // runtime.callers uses pc.array==nil as a signal
        // to print a stack trace. Pick off 0-length pc here
index 143d3a99a0eba63d8b27ff5d7083bc13e5c65e1c..adfc65384abfe8074a839afa35de56c81536de60 100644 (file)
@@ -599,9 +599,6 @@ func (s structWithMethod) callers() []uintptr {
        return pc[:Callers(0, pc)]
 }
 
-// The noinline prevents this function from being inlined
-// into a wrapper. TODO: remove this when issue 28640 is fixed.
-//go:noinline
 func (s structWithMethod) stack() string {
        buf := make([]byte, 4<<10)
        return string(buf[:Stack(buf, false)])