]> Cypherpunks repositories - gostls13.git/commit
runtime: replace func-based write barrier skipping with type-based
authorRuss Cox <rsc@golang.org>
Fri, 17 Apr 2015 04:21:30 +0000 (00:21 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 20 Apr 2015 20:20:09 +0000 (20:20 +0000)
commit181e26b9fa3c85ca5a512a51278b3f22f6e64dc9
tree441826cbaff52d78373d650977d3c0cfd619054a
parentc776592a4ff17b2153492bf5b17ae3151a42abf0
runtime: replace func-based write barrier skipping with type-based

This CL revises CL 7504 to use explicitly uintptr types for the
struct fields that are going to be updated sometimes without
write barriers. The result is that the fields are now updated *always*
without write barriers.

This approach has two important properties:

1) Now the GC never looks at the field, so if the missing reference
could cause a problem, it will do so all the time, not just when the
write barrier is missed at just the right moment.

2) Now a write barrier never happens for the field, avoiding the
(correct) detection of inconsistent write barriers when GODEBUG=wbshadow=1.

Change-Id: Iebd3962c727c0046495cc08914a8dc0808460e0e
Reviewed-on: https://go-review.googlesource.com/9019
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
21 files changed:
src/runtime/malloc.go
src/runtime/mbarrier.go
src/runtime/netpoll.go
src/runtime/netpoll_epoll.go
src/runtime/netpoll_kqueue.go
src/runtime/netpoll_solaris.go
src/runtime/netpoll_windows.go
src/runtime/os1_windows.go
src/runtime/os3_plan9.go
src/runtime/panic.go
src/runtime/proc.go
src/runtime/proc1.go
src/runtime/runtime2.go
src/runtime/signal_386.go
src/runtime/signal_amd64x.go
src/runtime/signal_arm.go
src/runtime/signal_arm64.go
src/runtime/signal_ppc64x.go
src/runtime/stack1.go
src/runtime/trace.go
src/runtime/traceback.go