]> Cypherpunks repositories - gostls13.git/commit
runtime: add deletion barriers on gobuf.ctxt
authorAustin Clements <austin@google.com>
Wed, 19 Oct 2016 19:49:31 +0000 (15:49 -0400)
committerAustin Clements <austin@google.com>
Fri, 28 Oct 2016 20:48:02 +0000 (20:48 +0000)
commit70c107c68dca7d57a24b35dd81420fb889aa1031
tree3f913f89ecd72a10cda5ccd22fefdb6ab6808a93
parent8f81dfe8b47e975b90bb4a2f8dd314d32c633176
runtime: add deletion barriers on gobuf.ctxt

gobuf.ctxt is set to nil from many places in assembly code and these
assignments require write barriers with the hybrid barrier.

Conveniently, in most of these places ctxt should already be nil, in
which case we don't need the barrier. This commit changes these places
to assert that ctxt is already nil.

gogo is more complicated, since ctxt may not already be nil. For gogo,
we manually perform the write barrier if ctxt is not nil.

Updates #17503.

Change-Id: I9d75e27c75a1b7f8b715ad112fc5d45ffa856d30
Reviewed-on: https://go-review.googlesource.com/31764
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/runtime/asm_386.s
src/runtime/asm_amd64.s
src/runtime/asm_amd64p32.s
src/runtime/asm_arm.s
src/runtime/asm_arm64.s
src/runtime/asm_mips64x.s
src/runtime/asm_ppc64x.s
src/runtime/asm_s390x.s
src/runtime/runtime2.go