compiler, runtime: copy slice code from Go 1.7 runtime
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 28 Oct 2016 22:34:47 +0000 (22:34 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 28 Oct 2016 22:34:47 +0000 (22:34 +0000)
commit94f56408db96e2e12f6e1322ed2c1c465df934f6
treef5eaac76bc47cc2637e5e30b9ff6c27499fac2d9
parent21f1031d6cc228e2b468338b3dfa4303d54ac207
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

From-SVN: r241667
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