]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: don't emit write barriers for offsets of global addresses
authorzikaeroh <zikaeroh@gmail.com>
Fri, 30 Jul 2021 04:15:52 +0000 (21:15 -0700)
committerMartin Möhrmann <martin@golang.org>
Mon, 23 Aug 2021 19:46:36 +0000 (19:46 +0000)
commit6b9e3f883e6820a1e94448ca81eba62341cd4836
treea75e8f51cc7f107e2b5328a8ea6c2a510e6993df
parent3081f817da8c194982596ddddf5d3ec321c859af
cmd/compile: don't emit write barriers for offsets of global addresses

Currently, write barriers aren't emitted for global addresses, but they
are emitted for addresses offset of global addresses.

This CL changes IsGlobalAddr to recognize offsets of global addresses
as globals too, removing write barriers for staticuint64s based
addresses. The logic added is the same as used in IsStackAddr.

Updates #37612

Change-Id: I537579f85b9ad02987d94f3ee0b4508b90097959
Reviewed-on: https://go-review.googlesource.com/c/go/+/342129
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/cmd/compile/internal/ssa/writebarrier.go
test/writebarrier.go