commit | 62e3a8cc0a862b0abd3d0b1ef6cf4b228992a137 | [log] [tgz] |
---|---|---|
author | Cherry Zhang <cherryyz@google.com> | Sun Jun 16 12:38:59 2019 -0400 |
committer | Ian Lance Taylor <iant@golang.org> | Fri Jun 21 14:13:54 2019 +0000 |
tree | 5f9f546dad5565a10b6f57fae5a1490dcfc066ba | |
parent | 7822080a6e226b1e5872e2fcefac30f666f4cc1e [diff] |
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]). Change-Id: I69739735e11b18abcd56a3108aee3ead8f7f2075 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/182540 Reviewed-by: Ian Lance Taylor <iant@golang.org>