]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile,cmd/link: initial support for ABI wrappers
authorThan McIntosh <thanm@google.com>
Thu, 24 Sep 2020 17:14:46 +0000 (13:14 -0400)
committerThan McIntosh <thanm@google.com>
Tue, 22 Dec 2020 18:13:48 +0000 (18:13 +0000)
commitcb28c96be8b8010dd979e0723bf5a94b11962a93
treedab9d1dc34e87cbee006ce3236b82fa364b3d5de
parentc8610e4700bee51898197987de5335b8527079e8
[dev.regabi] cmd/compile,cmd/link: initial support for ABI wrappers

Add compiler support for emitting ABI wrappers by creating real IR as
opposed to introducing ABI aliases. At the moment these are "no-op"
wrappers in the sense that they make a simple call (using the existing
ABI) to their target. The assumption here is that once late call
expansion can handle both ABI0 and the "new" ABIInternal (register
version), it can expand the call to do the right thing.

Note that the runtime contains functions that do not strictly follow
the rules of the current Go ABI0; this has been handled in most cases
by treating these as ABIInternal instead (these changes have been made
in previous patches).

Generation of ABI wrappers (as opposed to ABI aliases) is currently
gated by GOEXPERIMENT=regabi -- wrapper generation is on by default if
GOEXPERIMENT=regabi is set and off otherwise (but can be turned on
using "-gcflags=all=-abiwrap -ldflags=-abiwrap"). Wrapper generation
currently only workd on AMD64; explicitly enabling wrapper for other
architectures (via the command line) is not supported.

Also in this patch are a few other command line options for debugging
(tracing and/or limiting wrapper creation). These will presumably go
away at some point.

Updates #27539, #40724.

Change-Id: I1ee3226fc15a3c32ca2087b8ef8e41dbe6df4a75
Reviewed-on: https://go-review.googlesource.com/c/go/+/270863
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Trust: Than McIntosh <thanm@google.com>
16 files changed:
src/cmd/compile/internal/base/debug.go
src/cmd/compile/internal/base/flag.go
src/cmd/compile/internal/gc/gsubr.go
src/cmd/compile/internal/gc/main.go
src/cmd/compile/internal/gc/pgen.go
src/cmd/compile/internal/gc/racewalk.go
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/types/sym.go
src/cmd/internal/obj/link.go
src/cmd/internal/obj/plist.go
src/cmd/internal/obj/textflag.go
src/cmd/internal/obj/x86/obj6.go
src/cmd/link/internal/ld/main.go
src/cmd/link/internal/ld/symtab.go
src/runtime/textflag.h
test/nosplit.go