compiler: add go:notinheap magic comment
commit22deed0d6aa6688424346ecf1339687a1a54f10c
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 23 Jun 2017 16:03:49 +0000 (23 16:03 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 23 Jun 2017 16:03:49 +0000 (23 16:03 +0000)
tree3f8b464d9ac9de6affa319ea9639ee19ef983302
parent2e376e459d7dde2c0481460c580c4ec9470e7827
compiler: add go:notinheap magic comment

    Implement go:notinheap as the gc compiler does. A type marked as
    go:notinheap may not live in the heap, and does not require a write
    barrier. Struct and array types that incorporate notinheap types are
    themselves notinheap. Allocating a value of a notinheap type on the
    heap is an error.

    This is not just an optimization. There is code where a write barrier
    may not occur that was getting a write barrier with gccgo but not gc,
    because the types in question were notinheap. The case I found was
    setting the mcache field in exitsyscallfast.

    Reviewed-on: https://go-review.googlesource.com/46490

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249594 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/expressions.h
gcc/go/gofrontend/lex.cc
gcc/go/gofrontend/lex.h
gcc/go/gofrontend/parse.cc
gcc/go/gofrontend/parse.h
gcc/go/gofrontend/types.cc
gcc/go/gofrontend/types.h
gcc/go/gofrontend/wb.cc