]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: add ZeroWB case in writebarrier
authorCherry Zhang <cherryyz@google.com>
Fri, 13 Jan 2017 20:42:50 +0000 (15:42 -0500)
committerCherry Zhang <cherryyz@google.com>
Mon, 16 Jan 2017 18:27:48 +0000 (18:27 +0000)
It looks like it should be there, although I couldn't find a test
case that fails without it. ZeroWB is probably never generated now:
zeroing an initialized heap object is done by making an autotmp on
stack, zeroing it, and copying (typedmemmove) to heap.

Passes "toolstash -cmp" on std.

Change-Id: I702a59759e33fb8cc2a34a3b3029e7540aca080a
Reviewed-on: https://go-review.googlesource.com/35250
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/compile/internal/ssa/writebarrier.go

index 1eb4d7bb1af5a929b411d756b08d7a7dd6a9a3a3..054ba1f85c6d155b3ecbbc79b64387678f038f63 100644 (file)
@@ -35,7 +35,7 @@ func writebarrier(f *Func) {
        valueLoop:
                for i, v := range b.Values {
                        switch v.Op {
-                       case OpStoreWB, OpMoveWB, OpMoveWBVolatile:
+                       case OpStoreWB, OpMoveWB, OpMoveWBVolatile, OpZeroWB:
                                if IsStackAddr(v.Args[0]) {
                                        switch v.Op {
                                        case OpStoreWB: