]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: []T where T is go:notinheap does not need write barriers
authorAustin Clements <austin@google.com>
Thu, 2 Nov 2017 16:37:25 +0000 (12:37 -0400)
committerAustin Clements <austin@google.com>
Mon, 6 Nov 2017 21:07:57 +0000 (21:07 +0000)
commit3a446d865226f2141208deb21ea2d829609c3cf6
tree2f5924da5e7b77efa62b189ae0f23190098da09a
parent0838c0f2f9fd45f527c4be8e27589eed22e0e559
cmd/compile: []T where T is go:notinheap does not need write barriers

Currently, assigning a []T where T is a go:notinheap type generates an
unnecessary write barrier for storing the slice pointer.

This fixes this by teaching HasHeapPointer that this type does not
have a heap pointer, and tweaking the lowering of slice assignments so
the pointer store retains the correct type rather than simply lowering
it to a *uint8 store.

Change-Id: I8bf7c66e64a7fefdd14f2bd0de8a5a3596340bab
Reviewed-on: https://go-review.googlesource.com/76027
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/types/type.go
test/notinheap3.go