]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.typeparams] internal/buildcfg: enable defer/go wrapping everywhere
authorCherry Mui <cherryyz@google.com>
Thu, 20 May 2021 22:03:49 +0000 (18:03 -0400)
committerCherry Mui <cherryyz@google.com>
Mon, 24 May 2021 22:07:39 +0000 (22:07 +0000)
For register ABI, we wrap deferred/go'd function with arguments
or results in an argumentless closure, so the runtime can call the
function without knowing how to marshal the arguments, or
reserving frame for arguments and results.

The wrapping mechanism works everywhere, regardless of whether the
register ABI is used. And wrapping will simplify the compiler and
runtime's implementation for defer and go calls. For example, the
compiler will not need to marshal arguments for defer/go calls,
the opendefer metadata will not need to contain argument
information, and _defer record will be fixed-sized.

Enable wrapping everywhere.

Change-Id: I2032ba87249ceb686310dc640fb00696669ae912
Reviewed-on: https://go-review.googlesource.com/c/go/+/321958
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

src/internal/buildcfg/exp.go

index 417d87cf4af7f1421246837c46c76dc7ef1940a5..11cd05f2ed00db9146da7e3d0fcddfe3d226aeac 100644 (file)
@@ -29,7 +29,7 @@ var experimentBaseline = goexperiment.Flags{
        RegabiWrappers: regabiSupported,
        RegabiG:        regabiSupported,
        RegabiReflect:  regabiSupported,
-       RegabiDefer:    regabiSupported,
+       RegabiDefer:    true,
        RegabiArgs:     regabiSupported,
 }
 
@@ -103,7 +103,6 @@ func parseExperiments() goexperiment.Flags {
                flags.RegabiWrappers = false
                flags.RegabiG = false
                flags.RegabiReflect = false
-               flags.RegabiDefer = false
                flags.RegabiArgs = false
        }
        // Check regabi dependencies.