compiler: open code string slice expressions
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 21 Jun 2019 14:14:58 +0000 (14:14 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 21 Jun 2019 14:14:58 +0000 (14:14 +0000)
commitc9b236e5cafaea9d09ff8102140c72eb3d70e302
treedaa083891ba7e3c96f4ac7419562dc67146822a6
parent050e182a757bdf227a7e2425f06f9e2fd4dff8cb
compiler: open code string slice expressions

    Currently a string slice expression is implemented with a runtime
    call __go_string_slice. Change it to open code it, which is more
    efficient, and allows the backend to further optimize it.

    Also omit the write barrier for length-only update (i.e.
    s = s[:n]).

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/182540

From-SVN: r272549
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/expressions.h
gcc/go/gofrontend/runtime.def
gcc/go/gofrontend/statements.cc
libgo/Makefile.am
libgo/Makefile.in
libgo/runtime/go-strslice.c [deleted file]