From d8ee1c5a2c2bbbf3845f8edaacf827580ebac18c Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 5 Nov 2014 15:43:41 -0500 Subject: [PATCH] [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 --- src/cmd/gc/walk.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cmd/gc/walk.c b/src/cmd/gc/walk.c index 38bed1e22f..37bd62dead 100644 --- a/src/cmd/gc/walk.c +++ b/src/cmd/gc/walk.c @@ -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<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));