From dcaf785add683fdda9bd0e53395c17c55779a8ac Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Thu, 20 May 2021 18:03:49 -0400 Subject: [PATCH] [dev.typeparams] internal/buildcfg: enable defer/go wrapping everywhere 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 Run-TryBot: Cherry Mui Reviewed-by: Michael Knyszek TryBot-Result: Go Bot --- src/internal/buildcfg/exp.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/internal/buildcfg/exp.go b/src/internal/buildcfg/exp.go index 417d87cf4a..11cd05f2ed 100644 --- a/src/internal/buildcfg/exp.go +++ b/src/internal/buildcfg/exp.go @@ -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. -- 2.50.0