Skip to content

Commit 3f60d8b

Browse files
committed
core/vm: make jd analysis ref by value
1 parent ac83465 commit 3f60d8b

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

core/vm/analysis.go

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,75 +25,75 @@ var lookup = [8]byte{
2525
0x80, 0x40, 0x20, 0x10, 0x8, 0x4, 0x2, 0x1,
2626
}
2727

28-
func (bits *bitvec) set(pos uint64) {
28+
func (bits bitvec) set(pos uint64) {
2929
//(*bits)[pos/8] |= 0x80 >> (pos % 8)
30-
(*bits)[pos/8] |= lookup[pos%8]
30+
bits[pos/8] |= lookup[pos%8]
3131
}
3232

33-
func (bits *bitvec) set2(pos uint64) {
33+
func (bits bitvec) set2(pos uint64) {
3434
a := uint16(0b1100_0000_0000_0000) >> (pos % 8)
35-
(*bits)[pos/8] |= byte(a >> 8)
35+
bits[pos/8] |= byte(a >> 8)
3636
if b := byte(a); b != 0 {
3737
// If the bit-setting affects the neigbouring byte, we can assign - no need to OR it,
3838
// since it's the first write to that byte
39-
(*bits)[pos/8+1] = b
39+
bits[pos/8+1] = b
4040
}
4141
}
4242

43-
func (bits *bitvec) set3(pos uint64) {
43+
func (bits bitvec) set3(pos uint64) {
4444
a := uint16(0b1110_0000_0000_0000) >> (pos % 8)
45-
(*bits)[pos/8] |= byte(a >> 8)
45+
bits[pos/8] |= byte(a >> 8)
4646
if b := byte(a); b != 0 {
47-
(*bits)[pos/8+1] = b
47+
bits[pos/8+1] = b
4848
}
4949
}
5050

51-
func (bits *bitvec) set4(pos uint64) {
51+
func (bits bitvec) set4(pos uint64) {
5252
a := uint16(0b1111_0000_0000_0000) >> (pos % 8)
53-
(*bits)[pos/8] |= byte(a >> 8)
53+
bits[pos/8] |= byte(a >> 8)
5454
if b := byte(a); b != 0 {
55-
(*bits)[pos/8+1] = b
55+
bits[pos/8+1] = b
5656
}
5757
}
5858

59-
func (bits *bitvec) set5(pos uint64) {
59+
func (bits bitvec) set5(pos uint64) {
6060
a := uint16(0b1111_1000_0000_0000) >> (pos % 8)
61-
(*bits)[pos/8] |= byte(a >> 8)
61+
bits[pos/8] |= byte(a >> 8)
6262
if b := byte(a); b != 0 {
63-
(*bits)[pos/8+1] = b
63+
bits[pos/8+1] = b
6464
}
6565
}
6666

67-
func (bits *bitvec) set6(pos uint64) {
67+
func (bits bitvec) set6(pos uint64) {
6868
a := uint16(0b1111_1100_0000_0000) >> (pos % 8)
69-
(*bits)[pos/8] |= byte(a >> 8)
69+
bits[pos/8] |= byte(a >> 8)
7070
if b := byte(a); b != 0 {
71-
(*bits)[pos/8+1] = b
71+
bits[pos/8+1] = b
7272
}
7373
}
7474

75-
func (bits *bitvec) set7(pos uint64) {
75+
func (bits bitvec) set7(pos uint64) {
7676
a := uint16(0b1111_1110_0000_0000) >> (pos % 8)
77-
(*bits)[pos/8] |= byte(a >> 8)
77+
bits[pos/8] |= byte(a >> 8)
7878
if b := byte(a); b != 0 {
79-
(*bits)[pos/8+1] = b
79+
bits[pos/8+1] = b
8080
}
8181
}
8282

83-
func (bits *bitvec) set8(pos uint64) {
83+
func (bits bitvec) set8(pos uint64) {
8484
a := byte(0xFF >> (pos % 8))
85-
(*bits)[pos/8] |= a
85+
bits[pos/8] |= a
8686
if ^a != 0 {
87-
(*bits)[pos/8+1] = ^a
87+
bits[pos/8+1] = ^a
8888
}
8989
}
9090

91-
func (bits *bitvec) set16(pos uint64) {
91+
func (bits bitvec) set16(pos uint64) {
9292
a := byte(0xFF >> (pos % 8))
93-
(*bits)[pos/8] |= a
94-
(*bits)[pos/8+1] = 0xFF
93+
bits[pos/8] |= a
94+
bits[pos/8+1] = 0xFF
9595
if ^a != 0 {
96-
(*bits)[pos/8+2] = ^a
96+
bits[pos/8+2] = ^a
9797
}
9898
}
9999

0 commit comments

Comments
 (0)