]> Cypherpunks repositories - gostls13.git/commit
[dev.ssa] cmd/compile: implement OSLICESTR
authorKeith Randall <khr@golang.org>
Tue, 25 Aug 2015 06:52:03 +0000 (23:52 -0700)
committerDavid Chase <drchase@google.com>
Tue, 25 Aug 2015 17:14:57 +0000 (17:14 +0000)
commit3526cf586be92cb4c741aed54ccfd37cf00ddfc5
treed8ecce8f07271ca23777623d43013516908a2bde
parent8e601b23cd77f687407a358d2baba672f5a8e4d6
[dev.ssa] cmd/compile: implement OSLICESTR

Add a new function and generic operation to handle
bounds checking for slices. Unlike the index
bounds checking the index can be equal to the upper
bound.

Do gc-friendly slicing that generates proper code for
0-length result slices.

This is a takeover of Alexandru's original change,
(https://go-review.googlesource.com/#/c/12764/)
submittable now that the decompose phase is in.

Change-Id: I17d164cf42ed7839f84ca949c6ad3289269c9160
Reviewed-on: https://go-review.googlesource.com/13903
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/gc/testdata/string_ssa.go [new file with mode: 0644]
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/gen/genericOps.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewriteAMD64.go