mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: simplify needwritebarrier
Currently, whether we need a write barrier is simply a property of the pointer slot being written to. The only optimization we currently apply using the value being written is that pointers to stack variables can omit write barriers because they're only written to stack slots... but we already omit write barriers for all writes to the stack anyway. Passes toolstash -cmp. Change-Id: I7f16b71ff473899ed96706232d371d5b2b7ae789 Reviewed-on: https://go-review.googlesource.com/37109 Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
211102c85f
commit
794f1ebff7
3 changed files with 9 additions and 35 deletions
|
|
@ -1170,7 +1170,7 @@ func ullmancalc(n *Node) {
|
|||
goto out
|
||||
|
||||
case OAS:
|
||||
if !needwritebarrier(n.Left, n.Right) {
|
||||
if !needwritebarrier(n.Left) {
|
||||
break
|
||||
}
|
||||
fallthrough
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue