]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/gc: unexport global constants
authorHajime Hoshi <hajimehoshi@gmail.com>
Sun, 28 May 2017 14:38:59 +0000 (23:38 +0900)
committerMatthew Dempsky <mdempsky@google.com>
Sat, 23 Sep 2017 20:11:30 +0000 (20:11 +0000)
Change-Id: Ib292ef3b0a31b2c7bdd77519324362667f30389c
Reviewed-on: https://go-review.googlesource.com/44393
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/compile/internal/gc/bv.go
src/cmd/compile/internal/gc/esc.go
src/cmd/compile/internal/gc/go.go

index 72f29e825382f91ed54de631a95b8ecfbb06a7ee..03c4b9d8297366a0e44e03d090a0ecc98de190a9 100644 (file)
@@ -5,9 +5,9 @@
 package gc
 
 const (
-       WORDBITS  = 32
-       WORDMASK  = WORDBITS - 1
-       WORDSHIFT = 5
+       wordBits  = 32
+       wordMask  = wordBits - 1
+       wordShift = 5
 )
 
 // A bvec is a bit vector.
@@ -17,7 +17,7 @@ type bvec struct {
 }
 
 func bvalloc(n int32) bvec {
-       nword := (n + WORDBITS - 1) / WORDBITS
+       nword := (n + wordBits - 1) / wordBits
        return bvec{n, make([]uint32, nword)}
 }
 
@@ -28,7 +28,7 @@ type bulkBvec struct {
 }
 
 func bvbulkalloc(nbit int32, count int32) bulkBvec {
-       nword := (nbit + WORDBITS - 1) / WORDBITS
+       nword := (nbit + wordBits - 1) / wordBits
        size := int64(nword) * int64(count)
        if int64(int32(size*4)) != size*4 {
                Fatalf("bvbulkalloc too big: nbit=%d count=%d nword=%d size=%d", nbit, count, nword, size)
@@ -66,24 +66,24 @@ func (bv bvec) Get(i int32) bool {
        if i < 0 || i >= bv.n {
                Fatalf("bvget: index %d is out of bounds with length %d\n", i, bv.n)
        }
-       mask := uint32(1 << uint(i%WORDBITS))
-       return bv.b[i>>WORDSHIFT]&mask != 0
+       mask := uint32(1 << uint(i%wordBits))
+       return bv.b[i>>wordShift]&mask != 0
 }
 
 func (bv bvec) Set(i int32) {
        if i < 0 || i >= bv.n {
                Fatalf("bvset: index %d is out of bounds with length %d\n", i, bv.n)
        }
-       mask := uint32(1 << uint(i%WORDBITS))
-       bv.b[i/WORDBITS] |= mask
+       mask := uint32(1 << uint(i%wordBits))
+       bv.b[i/wordBits] |= mask
 }
 
 func (bv bvec) Unset(i int32) {
        if i < 0 || i >= bv.n {
                Fatalf("bvunset: index %d is out of bounds with length %d\n", i, bv.n)
        }
-       mask := uint32(1 << uint(i%WORDBITS))
-       bv.b[i/WORDBITS] &^= mask
+       mask := uint32(1 << uint(i%wordBits))
+       bv.b[i/wordBits] &^= mask
 }
 
 // bvnext returns the smallest index >= i for which bvget(bv, i) == 1.
@@ -94,11 +94,11 @@ func (bv bvec) Next(i int32) int32 {
        }
 
        // Jump i ahead to next word with bits.
-       if bv.b[i>>WORDSHIFT]>>uint(i&WORDMASK) == 0 {
-               i &^= WORDMASK
-               i += WORDBITS
-               for i < bv.n && bv.b[i>>WORDSHIFT] == 0 {
-                       i += WORDBITS
+       if bv.b[i>>wordShift]>>uint(i&wordMask) == 0 {
+               i &^= wordMask
+               i += wordBits
+               for i < bv.n && bv.b[i>>wordShift] == 0 {
+                       i += wordBits
                }
        }
 
@@ -107,7 +107,7 @@ func (bv bvec) Next(i int32) int32 {
        }
 
        // Find 1 bit.
-       w := bv.b[i>>WORDSHIFT] >> uint(i&WORDMASK)
+       w := bv.b[i>>wordShift] >> uint(i&wordMask)
 
        for w&1 == 0 {
                w >>= 1
@@ -118,8 +118,8 @@ func (bv bvec) Next(i int32) int32 {
 }
 
 func (bv bvec) IsEmpty() bool {
-       for i := int32(0); i < bv.n; i += WORDBITS {
-               if bv.b[i>>WORDSHIFT] != 0 {
+       for i := int32(0); i < bv.n; i += wordBits {
+               if bv.b[i>>wordShift] != 0 {
                        return false
                }
        }
@@ -129,7 +129,7 @@ func (bv bvec) IsEmpty() bool {
 func (bv bvec) Not() {
        i := int32(0)
        w := int32(0)
-       for ; i < bv.n; i, w = i+WORDBITS, w+1 {
+       for ; i < bv.n; i, w = i+wordBits, w+1 {
                bv.b[w] = ^bv.b[w]
        }
 }
index 0160c613579444b109b3c87d3a017ad8aa754c94..e70975170877e7fd945f1816c87a5258495d4307 100644 (file)
@@ -679,7 +679,7 @@ func (e *EscState) esc(n *Node, parent *Node) {
        // Big stuff escapes unconditionally
        // "Big" conditions that were scattered around in walk have been gathered here
        if n.Esc != EscHeap && n.Type != nil &&
-               (n.Type.Width > MaxStackVarSize ||
+               (n.Type.Width > maxStackVarSize ||
                        (n.Op == ONEW || n.Op == OPTRLIT) && n.Type.Elem().Width >= 1<<16 ||
                        n.Op == OMAKESLICE && !isSmallMakeSlice(n)) {
                if Debug['m'] > 2 {
index 07895a7fccf8db71645c10add8fa021f2be14b33..3f1c4221fe550a89f6de0e50b72926abbc910006 100644 (file)
@@ -14,7 +14,7 @@ import (
 
 const (
        BADWIDTH        = types.BADWIDTH
-       MaxStackVarSize = 10 * 1024 * 1024
+       maxStackVarSize = 10 * 1024 * 1024
 )
 
 // isRuntimePkg reports whether p is package runtime.