Skip to content

Commit

Permalink
runtime: remove unneeded noinline directives
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
randall77 committed Sep 17, 2019
1 parent 38543c2 commit 07ad840
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/runtime/extern.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions src/runtime/stack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)])
Expand Down

0 comments on commit 07ad840

Please sign in to comment.