]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.garbage] runtime: remove another BitsMultiWord
authorRuss Cox <rsc@golang.org>
Thu, 2 Oct 2014 18:26:04 +0000 (14:26 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 2 Oct 2014 18:26:04 +0000 (14:26 -0400)
Not found because it was not used by name.
Add name in comments for what's left behind.

LGTM=rlh
R=rlh
CC=golang-codereviews
https://golang.org/cl/148430043

src/cmd/gc/plive.c
src/runtime/gcinfo_test.go

index 0feb2c710ac439dc736cdaa820bdb7c019a92821..3bfa69b1f02084078f8e1ea6b7444bc08d858933 100644 (file)
@@ -1092,7 +1092,7 @@ twobitwalktype1(Type *t, vlong *xoffset, Bvec *bv)
        case TCOMPLEX64:
        case TCOMPLEX128:
                for(i = 0; i < t->width; i++) {
-                       bvset(bv, ((*xoffset + i) / widthptr) * BitsPerPointer); // 1 = live scalar
+                       bvset(bv, ((*xoffset + i) / widthptr) * BitsPerPointer); // 1 = live scalar (BitsScalar)
                }
                *xoffset += t->width;
                break;
@@ -1105,7 +1105,7 @@ twobitwalktype1(Type *t, vlong *xoffset, Bvec *bv)
        case TMAP:
                if((*xoffset & (widthptr-1)) != 0)
                        fatal("twobitwalktype1: invalid alignment, %T", t);
-               bvset(bv, (*xoffset / widthptr) * BitsPerPointer + 1); // 2 = live ptr
+               bvset(bv, (*xoffset / widthptr) * BitsPerPointer + 1); // 2 = live ptr (BitsPointer)
                *xoffset += t->width;
                break;
 
@@ -1113,7 +1113,7 @@ twobitwalktype1(Type *t, vlong *xoffset, Bvec *bv)
                // struct { byte *str; intgo len; }
                if((*xoffset & (widthptr-1)) != 0)
                        fatal("twobitwalktype1: invalid alignment, %T", t);
-               bvset(bv, (*xoffset / widthptr) * BitsPerPointer + 1); // 2 = live ptr in first slot
+               bvset(bv, (*xoffset / widthptr) * BitsPerPointer + 1); // 2 = live ptr in first slot (BitsPointer)
                *xoffset += t->width;
                break;
 
@@ -1123,15 +1123,8 @@ twobitwalktype1(Type *t, vlong *xoffset, Bvec *bv)
                // struct { Type *type; union { void *ptr, uintptr val } data; }
                if((*xoffset & (widthptr-1)) != 0)
                        fatal("twobitwalktype1: invalid alignment, %T", t);
-               bvset(bv, ((*xoffset / widthptr) * BitsPerPointer) + 0);
-               bvset(bv, ((*xoffset / widthptr) * BitsPerPointer) + 1); // 3 = multiword
-               // next word contains 2 = Iface, 3 = Eface
-               if(isnilinter(t)) {
-                       bvset(bv, ((*xoffset / widthptr) * BitsPerPointer) + 2);
-                       bvset(bv, ((*xoffset / widthptr) * BitsPerPointer) + 3);
-               } else {
-                       bvset(bv, ((*xoffset / widthptr) * BitsPerPointer) + 3);
-               }
+               bvset(bv, (*xoffset / widthptr) * BitsPerPointer + 1); // 2 = live ptr in first slot (BitsPointer)
+               bvset(bv, (*xoffset / widthptr) * BitsPerPointer + 3); // 2 = live ptr in second slot (BitsPointer)
                *xoffset += t->width;
                break;
 
@@ -1144,7 +1137,7 @@ twobitwalktype1(Type *t, vlong *xoffset, Bvec *bv)
                        // struct { byte *array; uintgo len; uintgo cap; }
                        if((*xoffset & (widthptr-1)) != 0)
                                fatal("twobitwalktype1: invalid TARRAY alignment, %T", t);
-                       bvset(bv, (*xoffset / widthptr) * BitsPerPointer + 1); // 2 = live ptr in first slot
+                       bvset(bv, (*xoffset / widthptr) * BitsPerPointer + 1); // 2 = live ptr in first slot (BitsPointer)
                        *xoffset += t->width;
                } else
                        for(i = 0; i < t->bound; i++)
index 88f6703f97df8f21d3a12c9b4c8fafa6c1cf007d..e74d8c2c0bf7fc461ee58c871a6d6ed6025acbe2 100644 (file)
@@ -188,6 +188,6 @@ var (
 
        infoString = []byte{BitsPointer, BitsDead}
        infoSlice  = []byte{BitsPointer, BitsDead, BitsDead}
-       infoEface  = []byte{BitsMultiWord, BitsEface}
-       infoIface  = []byte{BitsMultiWord, BitsIface}
+       infoEface  = []byte{BitsPointer, BitsPointer}
+       infoIface  = []byte{BitsPointer, BitsPointer}
 )