]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: look for newobject in register ABI for write barrier elision
authorCherry Zhang <cherryyz@google.com>
Thu, 8 Apr 2021 21:46:21 +0000 (17:46 -0400)
committerCherry Zhang <cherryyz@google.com>
Mon, 12 Apr 2021 17:30:21 +0000 (17:30 +0000)
commit2fa7163b06a1b483598eb0ee827c78ef0d32ba33
treeef642d7d6315310ec93fc171348ef78e9a4e4526
parent5d80f8a82b1fc3261bb4279f1426a9767b654e92
cmd/compile: look for newobject in register ABI for write barrier elision

If we are assigning a global address to an object that is
immediately returned from runtime.newobject, we omit the write
barrier because we know that both the source (static address) and
the destination (zeroed memory) do not need to be tracked by the
GC. Currently, the code that matches runtime.newobject's result
is specific to ABI0 layout. Update the code to work with register
ABI as well.

Change-Id: I7ab0833c6f745329271881ee4169956928a3a948
Reviewed-on: https://go-review.googlesource.com/c/go/+/308709
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/writebarrier.go