1
0
mirror of https://github.com/golang/go synced 2024-11-19 15:05:00 -07:00

[dev.garbage] cmd/gc: emit pointer write barriers

This got lost in the change that added the writebarrierfat variants.

LGTM=rlh
R=rlh
CC=golang-codereviews
https://golang.org/cl/165510043
This commit is contained in:
Russ Cox 2014-11-05 15:43:41 -05:00
parent 75d3f62b3c
commit d8ee1c5a2c

View File

@ -2015,6 +2015,8 @@ applywritebarrier(Node *n, NodeList **init)
l = nod(OADDR, n->left, N);
l->etype = 1; // addr does not escape
if(t->width == widthptr) {
n = mkcall1(writebarrierfn("writebarrierptr", t, n->right->type), T, init,
l, n->right);
} else if(t->etype == TSTRING) {
n = mkcall1(writebarrierfn("writebarrierstring", t, n->right->type), T, init,
l, n->right);
@ -2037,6 +2039,8 @@ applywritebarrier(Node *n, NodeList **init)
if(BitsPointer != (1<<PtrBit))
fatal("wrong PtrBit");
switch(t->width/widthptr) {
default:
fatal("found writebarrierfat for %d-byte object of type %T", (int)t->width, t);
case 2:
snprint(name, sizeof name, "writebarrierfat%d%d",
bvget(bv, PtrBit), bvget(bv, BitsPerPointer+PtrBit));