go/src/cmd
Michael Pratt 204be97d24 cmd/compile/internal/pgo: remove most global state
Since pgo is a new package, it is reasonably straightforward to
encapsulate its state into a non-global object that we pass around,
which will help keep it isolated.

There are no functional changes in this CL, just packaging up the
globals into a new object.

There are two major pieces of cleanup remaining:

1. reflectdata and noder have separate InlineCalls calls for method
   wrappers. The Profile is not plumbed there yet, but this is not a
   regression as the globals were previously set only right around the
   main inlining pass in gc.Main.

2. pgo.ListOfHotCallSites is still global, as it will require more work
   to clean up. It is effectively a local variable in InlinePackage,
   except that it assumes that InlineCalls is immediately preceded by a
   CanInline call for the same function. This is not necessarily true
   due to the recursive nature of CanInline. This also means that some
   InlineCalls calls may be missing the list of hot callsites right now.

For #55022.

Change-Id: Ic1fe41f73df96861c65f8bfeecff89862b367290
Reviewed-on: https://go-review.googlesource.com/c/go/+/446303
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
2022-10-31 21:18:33 +00:00
..
addr2line
api cmd/api: skip tests when 'os/exec' is supported but 'go build' is not 2022-10-31 19:20:21 +00:00
asm cmd/internal/obj/ppc64: generate big uint32 values in register 2022-10-26 19:47:19 +00:00
buildid
cgo cmd/go, cmd/cgo: support older versions of gccgo that lack cgo.Incomplete 2022-10-29 00:40:18 +00:00
compile cmd/compile/internal/pgo: remove most global state 2022-10-31 21:18:33 +00:00
covdata cmd/{cover,covdata}: minor code cleanups 2022-10-12 12:50:46 +00:00
cover cmd/cover: fix buglets in counter insertion 2022-10-21 19:42:51 +00:00
dist cmd/go: don't install most GOROOT .a files in pkg 2022-10-28 23:35:08 +00:00
doc cmd/doc: use strings.Builder 2022-09-06 17:12:04 +00:00
fix cmd/fix: use strings.Cut 2022-09-29 22:58:43 +00:00
go cmd/go, cmd/cgo: support older versions of gccgo that lack cgo.Incomplete 2022-10-29 00:40:18 +00:00
gofmt
internal cmd/internal/obj: cleanup linkgetlineFromPos 2022-10-31 20:45:15 +00:00
link cmd/go: don't install most GOROOT .a files in pkg 2022-10-28 23:35:08 +00:00
nm cmd/nm: use print-style not printf-style 2022-09-29 09:05:07 +00:00
objdump go,cmd,internal: update to anticipate missing targets and .a files 2022-10-18 20:41:45 +00:00
pack go,cmd,internal: update to anticipate missing targets and .a files 2022-10-18 20:41:45 +00:00
pprof cmd/pprof: fix addr calculation for Windows 2022-08-20 00:56:30 +00:00
test2json testing: fix many test2json inaccuracies 2022-10-26 19:50:36 +00:00
trace all: use fmt.Appendf 2022-10-04 22:43:12 +00:00
vendor all: update golang.org/x/tools to 8166dca1ce 2022-10-26 00:11:50 +00:00
vet all: replace [0-9] with \d in regexps 2022-09-27 14:14:42 +00:00
README.vendor
go.mod all: update golang.org/x/tools to 8166dca1ce 2022-10-26 00:11:50 +00:00
go.sum all: update golang.org/x/tools to 8166dca1ce 2022-10-26 00:11:50 +00:00

README.vendor

See src/README.vendor for information on loading vendored packages
and updating the vendor directory.