runtime: avoid write barriers when calling deferred function
commit6348b51714d83b5d1424e16740bca5a4376136a5
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Jun 2017 14:33:13 +0000 (22 14:33 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Jun 2017 14:33:13 +0000 (22 14:33 +0000)
treecd867e8bbd31844fdb91beae7951b4a13cc9ceb6
parent1163d33351b01a0d98e5aea272fce98c0ee90551
runtime: avoid write barriers when calling deferred function

    Calling a deferred function currently requires changing from a uintptr
    to the function code to a Go function value. That is done by setting
    the value of a func local variable using unsafe.Pointer. The local
    variable will always be on the stack. Adjust the code that sets the
    local variable to avoid generating a write barrier.

    A write barrier is never needed here. Also, for deferreturn, we must
    avoid write barriers entirely when called from a cgo function; that
    requires more than just this, but this is a start.

    The test for this is runtime tests that use the go tool; these are not
    currently run, but they will be in the future.

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249559 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/gofrontend/MERGE
libgo/go/runtime/panic.go