mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: disable tail call for method wrappers when RegabiArgs is enabled
Currently, the IR of tailcall does not connect the arguments with the OTAILCALL node, so the arguments are not marshaled correctly. Disable tail call for now. Updates #40724. Change-Id: I39de3ea8e19a23eb63768ab7282d2f870e9c266e Reviewed-on: https://go-review.googlesource.com/c/go/+/307234 Trust: Cherry Zhang <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
parent
411860251e
commit
45e87cd3ec
1 changed files with 5 additions and 1 deletions
|
|
@ -1770,7 +1770,11 @@ func methodWrapper(rcvr *types.Type, method *types.Field) *obj.LSym {
|
||||||
// the TOC to the appropriate value for that module. But if it returns
|
// the TOC to the appropriate value for that module. But if it returns
|
||||||
// directly to the wrapper's caller, nothing will reset it to the correct
|
// directly to the wrapper's caller, nothing will reset it to the correct
|
||||||
// value for that function.
|
// value for that function.
|
||||||
if !base.Flag.Cfg.Instrumenting && rcvr.IsPtr() && methodrcvr.IsPtr() && method.Embedded != 0 && !types.IsInterfaceMethod(method.Type) && !(base.Ctxt.Arch.Name == "ppc64le" && base.Ctxt.Flag_dynlink) {
|
//
|
||||||
|
// Disable tailcall for RegabiArgs for now. The IR does not connect the
|
||||||
|
// arguments with the OTAILCALL node, and the arguments are not marshaled
|
||||||
|
// correctly.
|
||||||
|
if !base.Flag.Cfg.Instrumenting && rcvr.IsPtr() && methodrcvr.IsPtr() && method.Embedded != 0 && !types.IsInterfaceMethod(method.Type) && !(base.Ctxt.Arch.Name == "ppc64le" && base.Ctxt.Flag_dynlink) && !objabi.Experiment.RegabiArgs {
|
||||||
// generate tail call: adjust pointer receiver and jump to embedded method.
|
// generate tail call: adjust pointer receiver and jump to embedded method.
|
||||||
left := dot.X // skip final .M
|
left := dot.X // skip final .M
|
||||||
if !left.Type().IsPtr() {
|
if !left.Type().IsPtr() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue