Skip to content

Commit 7537bb7

Browse files
hajimehoshimdempsky
authored andcommitted
cmd/compile/internal/gc: unexport global constants
Change-Id: Ib292ef3b0a31b2c7bdd77519324362667f30389c Reviewed-on: https://go-review.googlesource.com/44393 Reviewed-by: Daniel Martí <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]> Run-TryBot: Daniel Martí <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 2f8b555 commit 7537bb7

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
package gc
66

77
const (
8-
WORDBITS = 32
9-
WORDMASK = WORDBITS - 1
10-
WORDSHIFT = 5
8+
wordBits = 32
9+
wordMask = wordBits - 1
10+
wordShift = 5
1111
)
1212

1313
// A bvec is a bit vector.
@@ -17,7 +17,7 @@ type bvec struct {
1717
}
1818

1919
func bvalloc(n int32) bvec {
20-
nword := (n + WORDBITS - 1) / WORDBITS
20+
nword := (n + wordBits - 1) / wordBits
2121
return bvec{n, make([]uint32, nword)}
2222
}
2323

@@ -28,7 +28,7 @@ type bulkBvec struct {
2828
}
2929

3030
func bvbulkalloc(nbit int32, count int32) bulkBvec {
31-
nword := (nbit + WORDBITS - 1) / WORDBITS
31+
nword := (nbit + wordBits - 1) / wordBits
3232
size := int64(nword) * int64(count)
3333
if int64(int32(size*4)) != size*4 {
3434
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 {
6666
if i < 0 || i >= bv.n {
6767
Fatalf("bvget: index %d is out of bounds with length %d\n", i, bv.n)
6868
}
69-
mask := uint32(1 << uint(i%WORDBITS))
70-
return bv.b[i>>WORDSHIFT]&mask != 0
69+
mask := uint32(1 << uint(i%wordBits))
70+
return bv.b[i>>wordShift]&mask != 0
7171
}
7272

7373
func (bv bvec) Set(i int32) {
7474
if i < 0 || i >= bv.n {
7575
Fatalf("bvset: index %d is out of bounds with length %d\n", i, bv.n)
7676
}
77-
mask := uint32(1 << uint(i%WORDBITS))
78-
bv.b[i/WORDBITS] |= mask
77+
mask := uint32(1 << uint(i%wordBits))
78+
bv.b[i/wordBits] |= mask
7979
}
8080

8181
func (bv bvec) Unset(i int32) {
8282
if i < 0 || i >= bv.n {
8383
Fatalf("bvunset: index %d is out of bounds with length %d\n", i, bv.n)
8484
}
85-
mask := uint32(1 << uint(i%WORDBITS))
86-
bv.b[i/WORDBITS] &^= mask
85+
mask := uint32(1 << uint(i%wordBits))
86+
bv.b[i/wordBits] &^= mask
8787
}
8888

8989
// bvnext returns the smallest index >= i for which bvget(bv, i) == 1.
@@ -94,11 +94,11 @@ func (bv bvec) Next(i int32) int32 {
9494
}
9595

9696
// Jump i ahead to next word with bits.
97-
if bv.b[i>>WORDSHIFT]>>uint(i&WORDMASK) == 0 {
98-
i &^= WORDMASK
99-
i += WORDBITS
100-
for i < bv.n && bv.b[i>>WORDSHIFT] == 0 {
101-
i += WORDBITS
97+
if bv.b[i>>wordShift]>>uint(i&wordMask) == 0 {
98+
i &^= wordMask
99+
i += wordBits
100+
for i < bv.n && bv.b[i>>wordShift] == 0 {
101+
i += wordBits
102102
}
103103
}
104104

@@ -107,7 +107,7 @@ func (bv bvec) Next(i int32) int32 {
107107
}
108108

109109
// Find 1 bit.
110-
w := bv.b[i>>WORDSHIFT] >> uint(i&WORDMASK)
110+
w := bv.b[i>>wordShift] >> uint(i&wordMask)
111111

112112
for w&1 == 0 {
113113
w >>= 1
@@ -118,8 +118,8 @@ func (bv bvec) Next(i int32) int32 {
118118
}
119119

120120
func (bv bvec) IsEmpty() bool {
121-
for i := int32(0); i < bv.n; i += WORDBITS {
122-
if bv.b[i>>WORDSHIFT] != 0 {
121+
for i := int32(0); i < bv.n; i += wordBits {
122+
if bv.b[i>>wordShift] != 0 {
123123
return false
124124
}
125125
}
@@ -129,7 +129,7 @@ func (bv bvec) IsEmpty() bool {
129129
func (bv bvec) Not() {
130130
i := int32(0)
131131
w := int32(0)
132-
for ; i < bv.n; i, w = i+WORDBITS, w+1 {
132+
for ; i < bv.n; i, w = i+wordBits, w+1 {
133133
bv.b[w] = ^bv.b[w]
134134
}
135135
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ func (e *EscState) esc(n *Node, parent *Node) {
679679
// Big stuff escapes unconditionally
680680
// "Big" conditions that were scattered around in walk have been gathered here
681681
if n.Esc != EscHeap && n.Type != nil &&
682-
(n.Type.Width > MaxStackVarSize ||
682+
(n.Type.Width > maxStackVarSize ||
683683
(n.Op == ONEW || n.Op == OPTRLIT) && n.Type.Elem().Width >= 1<<16 ||
684684
n.Op == OMAKESLICE && !isSmallMakeSlice(n)) {
685685
if Debug['m'] > 2 {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
const (
1616
BADWIDTH = types.BADWIDTH
17-
MaxStackVarSize = 10 * 1024 * 1024
17+
maxStackVarSize = 10 * 1024 * 1024
1818
)
1919

2020
// isRuntimePkg reports whether p is package runtime.

0 commit comments

Comments
 (0)