From b275e55d86c78b8fdcfc70ea835ab3e00c7d6eeb Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Fri, 2 Sep 2016 13:56:52 -0400 Subject: [PATCH] runtime: clean up more traces of the old mark bit Commit 59877bf renamed bitMarked to bitScan, since the bitmap is no longer used for marking. However, there were several other references to this strewn about comments and in some other constant names. Fix these up, too. Change-Id: I4183d28c6b01977f1d75a99ad55b150f2211772d Reviewed-on: https://go-review.googlesource.com/28450 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Rick Hudson --- src/runtime/mbitmap.go | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/runtime/mbitmap.go b/src/runtime/mbitmap.go index f49fc67a0c..d05a072705 100644 --- a/src/runtime/mbitmap.go +++ b/src/runtime/mbitmap.go @@ -80,11 +80,11 @@ const ( bitPointer = 1 << 0 bitScan = 1 << 4 - heapBitsShift = 1 // shift offset between successive bitPointer or bitMarked entries + heapBitsShift = 1 // shift offset between successive bitPointer or bitScan entries heapBitmapScale = sys.PtrSize * (8 / 2) // number of data bytes described by one heap bitmap byte - // all mark/pointer bits in a byte - bitMarkedAll = bitScan | bitScan<>= 2 nb -= 2 - // Note: no bitMarker for second word because that's + // Note: no bitScan for second word because that's // the checkmark. if gcphase == _GCoff { *hbitp &^= uint8((bitPointer | bitScan | (bitPointer << heapBitsShift)) << (2 * heapBitsShift)) @@ -1211,7 +1211,7 @@ func heapBitsSetType(x, size, dataSize uintptr, typ *_type) { // but we'll stop at the break and then truncate // appropriately in Phase 3. hb = b & bitPointerAll - hb |= bitMarkedAll + hb |= bitScanAll if w += 4; w >= nw { break } @@ -1259,7 +1259,7 @@ func heapBitsSetType(x, size, dataSize uintptr, typ *_type) { // Emit bitmap byte. hb = b & bitPointerAll - hb |= bitMarkedAll + hb |= bitScanAll if w += 4; w >= nw { break } @@ -1275,7 +1275,7 @@ Phase3: // there are more entries than possible pointer slots. // Discard the excess entries (can't be more than 3). mask := uintptr(1)<<(4-(w-nw)) - 1 - hb &= mask | mask<<4 // apply mask to both pointer bits and mark bits + hb &= mask | mask<<4 // apply mask to both pointer bits and scan bits } // Change nw from counting possibly-pointer words to total words in allocation. @@ -1525,11 +1525,11 @@ Run: dst = add1(dst) bits >>= 8 } else { - v := bits&bitPointerAll | bitMarkedAll + v := bits&bitPointerAll | bitScanAll *dst = uint8(v) dst = subtract1(dst) bits >>= 4 - v = bits&bitPointerAll | bitMarkedAll + v = bits&bitPointerAll | bitScanAll *dst = uint8(v) dst = subtract1(dst) bits >>= 4 @@ -1563,11 +1563,11 @@ Run: dst = add1(dst) bits >>= 8 } else { - v := bits&0xf | bitMarkedAll + v := bits&0xf | bitScanAll *dst = uint8(v) dst = subtract1(dst) bits >>= 4 - v = bits&0xf | bitMarkedAll + v = bits&0xf | bitScanAll *dst = uint8(v) dst = subtract1(dst) bits >>= 4 @@ -1694,7 +1694,7 @@ Run: } } else { for nbits >= 4 { - *dst = uint8(bits&0xf | bitMarkedAll) + *dst = uint8(bits&0xf | bitScanAll) dst = subtract1(dst) bits >>= 4 nbits -= 4 @@ -1752,7 +1752,7 @@ Run: for i := c / 4; i > 0; i-- { bits |= (uintptr(*src) & 0xf) << nbits src = subtract1(src) - *dst = uint8(bits&0xf | bitMarkedAll) + *dst = uint8(bits&0xf | bitScanAll) dst = subtract1(dst) bits >>= 4 } @@ -1778,7 +1778,7 @@ Run: totalBits = (uintptr(unsafe.Pointer(dstStart))-uintptr(unsafe.Pointer(dst)))*4 + nbits nbits += -nbits & 3 for ; nbits > 0; nbits -= 4 { - v := bits&0xf | bitMarkedAll + v := bits&0xf | bitScanAll *dst = uint8(v) dst = subtract1(dst) bits >>= 4 -- 2.48.1