]> Cypherpunks repositories - gostls13.git/commit
runtime: document assumption about wbBufFlush argument slots
authorAustin Clements <austin@google.com>
Fri, 3 Aug 2018 15:34:11 +0000 (11:34 -0400)
committerAustin Clements <austin@google.com>
Fri, 3 Aug 2018 18:35:45 +0000 (18:35 +0000)
commitb800f202dc4d4281edd56ec40ea58f09dac8b730
treeaed762c1263d74dad4293c6a5619264deb24be04
parent1b870077c896379c066b41657d3c9062097a6943
runtime: document assumption about wbBufFlush argument slots

gcWriteBarrier and wbBufFlush assume that not writing to an argument
variable is sufficient to not clobber the corresponding argument slot.
This assumption lets us simplify the write barrier assembly code,
speed up the flush path, and reduce the stack usage of the write
barrier.

But it is an assumption, so this CL documents it to make this clear.

Alternatively, we could separate the register spill slots from the
argument slots in the write barrier, but that loses the advantages
above. On the other hand, it's extremely unlikely that we'll change
the behavior of the compiler to start clobbering argument slots (if
anything, we'd probably change it to *not* clobber argument slots even
if you wrote to the arguments).

Fixes #25512.

Change-Id: Ib2cf29c0d90956ca02b997ef6e7fa56fc8044efe
Reviewed-on: https://go-review.googlesource.com/127815
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/runtime/mwbbuf.go