]> Cypherpunks repositories - gostls13.git/commit
cmd/cc, cmd/gc, runtime: Uniquely encode iface and eface pointers in the pointer...
authorCarl Shapiro <cshapiro@google.com>
Fri, 9 Aug 2013 23:48:12 +0000 (16:48 -0700)
committerCarl Shapiro <cshapiro@google.com>
Fri, 9 Aug 2013 23:48:12 +0000 (16:48 -0700)
commitabc516e4202e0206a6d8725efd8308d1982c1189
treee9d968d9fb6c41b3cee6a827468861c7336749d0
parent556b337ece484d34d3dee1419579ca89475fcefc
cmd/cc, cmd/gc, runtime: Uniquely encode iface and eface pointers in the pointer map.

Prior to this change, pointer maps encoded the disposition of
a word using a single bit.  A zero signaled a non-pointer
value and a one signaled a pointer value.  Interface values,
which are a effectively a union type, were conservatively
labeled as a pointer.

This change widens the logical element size of the pointer map
to two bits per word.  As before, zero signals a non-pointer
value and one signals a pointer value.  Additionally, a two
signals an iface pointer and a three signals an eface pointer.

Following other changes to the runtime, values two and three
will allow a type information to drive interpretation of the
subsequent word so only those interface values containing a
pointer value will be scanned.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12689046
src/cmd/cc/pgen.c
src/cmd/gc/pgen.c
src/pkg/runtime/mgc0.c