compiler, runtime: copy slice code from Go 1.7 runtime
commit321e5ad244762bd4dc3f923e043731b2149e575a
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Oct 2016 22:34:47 +0000 (28 22:34 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Oct 2016 22:34:47 +0000 (28 22:34 +0000)
treef5eaac76bc47cc2637e5e30b9ff6c27499fac2d9
parentaf89ba4142a238c633557f5659d339b635d2702d
compiler, runtime: copy slice code from Go 1.7 runtime

    Change the compiler handle append as the gc compiler does: call a
    function to grow the slice, but otherwise assign the new elements
    directly to the final slice.

    For the current gccgo memory allocator the slice code has to call
    runtime_newarray, not mallocgc directly, so that the allocator sets the
    TypeInfo_Array bit in the type pointer.

    Rename the static function cnew to runtime_docnew, so that the stack
    trace ignores it when ignoring runtime functions.  This was needed to
    fix the runtime/pprof tests on 386.

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241667 138bc75d-0d04-0410-961f-82ee72b054a4
14 files changed:
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/escape.cc
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/runtime.cc
gcc/go/gofrontend/runtime.def
libgo/Makefile.am
libgo/Makefile.in
libgo/go/runtime/slice.go [new file with mode: 0644]
libgo/go/runtime/stubs.go
libgo/runtime/go-append.c [deleted file]
libgo/runtime/go-copy.c [deleted file]
libgo/runtime/go-make-slice.c [deleted file]
libgo/runtime/malloc.goc
libgo/runtime/runtime.h