]> Cypherpunks repositories - gostls13.git/commit
[dev.ssa] cmd/compile: use 32-bit load to read writebarrier
authorDavid Chase <drchase@google.com>
Sun, 28 Feb 2016 16:15:22 +0000 (11:15 -0500)
committerDavid Chase <drchase@google.com>
Sun, 28 Feb 2016 22:29:23 +0000 (22:29 +0000)
commit8107b0012f1d5f808e33f812c456e20554c383c8
tree82cd1adee8f2d284f9ab7e964bf51346f4a4b334
parent34f048c9d9cfd839703f96834ec6bd0a500e4b00
[dev.ssa] cmd/compile: use 32-bit load to read writebarrier

Avoid targeting a partial register with load;
ensure source of load (writebarrier) is aligned.

Better yet would be "CMPB $1,writebarrier" but that requires
wrestling with flagalloc (mem operand complicates moving
instruction around).

Didn't see a change in time for
   benchcmd -n 10 Build go build net/http

Verified that we clean the code up properly:
   0x20a8 <main.main+104>: mov    0xc30a2(%rip),%eax
                            # 0xc5150 <runtime.writeBarrier>
   0x20ae <main.main+110>: test   %al,%al

Change-Id: Id5fb8c260eaec27bd727cb0ae1476c60343b0986
Reviewed-on: https://go-review.googlesource.com/19998
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/ssa.go
src/runtime/mgc.go