mirror of
https://github.com/golang/go
synced 2024-11-19 12:14:42 -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:
parent
75d3f62b3c
commit
d8ee1c5a2c
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user