]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: generate frame pointers for otherwise frameless functions
authorKeith Randall <khr@golang.org>
Thu, 1 Dec 2016 00:15:32 +0000 (16:15 -0800)
committerKeith Randall <khr@golang.org>
Thu, 1 Dec 2016 19:25:17 +0000 (19:25 +0000)
commitc96e94e69d5b29787589385d93eb4452af05c6f3
tree7a83dab676c6bc948740b42239c96b27f8f1da24
parent7e5b2e0ec144d5f5b2923a7d5db0b9143f79a35a
cmd/compile: generate frame pointers for otherwise frameless functions

func f() {
    g()
}

We mistakenly don't add a frame pointer for f.  This means f
isn't seen when walking the frame pointer linked list.  That
matters for kernel-gathered profiles, and is an impediment for
issues like #16638.

To fix, allocate a stack frame even for otherwise frameless functions
like f.  It is a bit tricky because we need to avoid some runtime
internals that really, really don't want one.

No test at the moment, as only kernel CPU profiles would catch it.
Tests will come with the implementation of #16638.

Fixes #18103

Change-Id: I411206cc9de4c8fdd265bee2e4fa61d161ad1847
Reviewed-on: https://go-review.googlesource.com/33754
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/cmd/compile/internal/gc/pgen.go
src/cmd/compile/internal/gc/subr.go
src/cmd/compile/internal/gc/syntax.go
src/cmd/internal/obj/x86/obj6.go