]> git.ipfire.org Git - thirdparty/gcc.git/commit
compiler: stack allocate a buffer for non-escaping string ops
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 19 Jun 2019 04:53:51 +0000 (04:53 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 19 Jun 2019 04:53:51 +0000 (04:53 +0000)
commit20a381c444d321b58eeacbf8a645670697b723f4
tree94c81c934c43d4b35ea3289daae6945a9a07b296
parente8d34d7bb713a241cce98b7b69952c7f0ac41bd4
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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@272468 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/expressions.h