r264259 - in /trunk/gcc/go/gofrontend: MERGE ex...
ian@gcc.gnu.org
ian@gcc.gnu.org
Thu Sep 13 00:45:00 GMT 2018
Author: ian
Date: Thu Sep 13 00:45:55 2018
New Revision: 264259
URL: https://gcc.gnu.org/viewcvs?rev=264259&root=gcc&view=rev
Log:
compiler: omit a couple of write barriers
Omit a write barrier for
s = s[0:]
for a slice s. In this case the pointer is not changing and no write
barrier is required.
Omit a write barrier for
s = append(s, v)
in the case where len(s) < cap(s) (and similarly when appending more
values). When the slice has enough capacity the pointer is not
changing and no write barrier is required.
These changes are required to avoid write barriers in the method
randomOrder.reset in the runtime package. That method is called from
procresize, at a point where we do not want to allocate memory.
Otherwise that method can use a write barrier, allocate memory, and
break TestReadMemStats.
Reviewed-on: https://go-review.googlesource.com/134219
Modified:
trunk/gcc/go/gofrontend/MERGE
trunk/gcc/go/gofrontend/expressions.cc
trunk/gcc/go/gofrontend/expressions.h
trunk/gcc/go/gofrontend/statements.cc
trunk/gcc/go/gofrontend/statements.h
trunk/gcc/go/gofrontend/wb.cc
More information about the Gcc-cvs
mailing list