]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: use getcallersp for gorecover "fp" arg
authorCherry Zhang <cherryyz@google.com>
Tue, 2 Mar 2021 15:27:18 +0000 (10:27 -0500)
committerCherry Zhang <cherryyz@google.com>
Fri, 5 Mar 2021 23:13:20 +0000 (23:13 +0000)
commitfb03be9d5577a3d22834a25b3b62916aee30db2a
tree2405dd64192e0196ceb9d3417aeed35000149b49
parenta22bd3dc73bfcc9bf37cbd651933c54c82799c2a
cmd/compile: use getcallersp for gorecover "fp" arg

Currently, the compiler synthesize a special ".fp" node, which
points to the FP of the current frame, be to used to call
gorecover. Later that node turns to an Arg in SSA that is not
really an arg, causing problems for the new ABI work which changes
the handling of Args, so we have to special-case that node.

This CL changes the compiler to get the FP by using getcallersp,
which is an intrinsic in SSA and works on all platforms. As we
need the FP, not the caller SP, one drawback is that we have to
add FixedFrameSize for LR machines. But it does allow us to remove
that special node.

Change-Id: Ie721d51efca8116c9d23cc4f79738fffcf847df8
Reviewed-on: https://go-review.googlesource.com/c/go/+/297930
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ir/name.go
src/cmd/compile/internal/ssagen/pgen.go
src/cmd/compile/internal/ssagen/ssa.go
src/cmd/compile/internal/typecheck/builtin.go
src/cmd/compile/internal/typecheck/builtin/runtime.go
src/cmd/compile/internal/typecheck/universe.go
src/cmd/compile/internal/walk/expr.go