compiler: stack allocate a buffer for non-escaping string ops
authorIan Lance Taylor <ian@gcc.gnu.org>
Wed, 19 Jun 2019 04:53:51 +0000 (04:53 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 19 Jun 2019 04:53:51 +0000 (04:53 +0000)
commit20b603dba4bea71cbdf9dde7db44d6b5bbcb7654
tree94c81c934c43d4b35ea3289daae6945a9a07b296
parent17f62b7e1fef0a04c738419b0108eeb89f6b7463
compiler: stack allocate a buffer for non-escaping string ops

    For string concatenation, string to/from byte or rune slice
    conversion, and int to string conversion, if the result does not
    escape, we can allocate a small (32-element, or 4-byte for int to
    string) buffer on stack, and pass it to the runtime function. If
    the result fits in the buffer, it doesn't need to do a heap
    allocation.

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

From-SVN: r272468
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/expressions.h