mirror of
https://github.com/golang/go
synced 2024-11-11 23:20:24 -07:00
runtime/internal/atomic: rename Storep1 to StorepNoWB
Make it clear that the point of this function stores a pointer *without* a write barrier. sed -i -e 's/Storep1/StorepNoWB/' $(git grep -l Storep1) Updates #15270. Change-Id: Ifad7e17815e51a738070655fe3b178afdadaecf6 Reviewed-on: https://go-review.googlesource.com/21994 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org>
This commit is contained in:
parent
da6205b67e
commit
4721ea6abc
@ -20,7 +20,7 @@ import (
|
||||
//
|
||||
//go:nosplit
|
||||
func atomicstorep(ptr unsafe.Pointer, new unsafe.Pointer) {
|
||||
atomic.Storep1(noescape(ptr), new)
|
||||
atomic.StorepNoWB(noescape(ptr), new)
|
||||
writebarrierptr_nostore((*uintptr)(ptr), uintptr(new))
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ func sync_atomic_StoreUintptr(ptr *uintptr, new uintptr)
|
||||
//go:nosplit
|
||||
func sync_atomic_StorePointer(ptr *unsafe.Pointer, new unsafe.Pointer) {
|
||||
sync_atomic_StoreUintptr((*uintptr)(unsafe.Pointer(ptr)), uintptr(new))
|
||||
atomic.Storep1(noescape(unsafe.Pointer(ptr)), new)
|
||||
atomic.StorepNoWB(noescape(unsafe.Pointer(ptr)), new)
|
||||
writebarrierptr_nostore((*uintptr)(unsafe.Pointer(ptr)), uintptr(new))
|
||||
}
|
||||
|
||||
|
@ -1075,8 +1075,8 @@ func mapzero(t *_type) {
|
||||
throw("map element too large")
|
||||
}
|
||||
}
|
||||
atomic.Storep1(unsafe.Pointer(&zeroptr), persistentalloc(cursize, 64, &memstats.other_sys))
|
||||
atomic.Storep1(unsafe.Pointer(&zerosize), unsafe.Pointer(zerosize))
|
||||
atomic.StorepNoWB(unsafe.Pointer(&zeroptr), persistentalloc(cursize, 64, &memstats.other_sys))
|
||||
atomic.StorepNoWB(unsafe.Pointer(&zerosize), unsafe.Pointer(zerosize))
|
||||
}
|
||||
unlock(&zerolock)
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ TEXT runtime∕internal∕atomic·Xchguintptr(SB), NOSPLIT, $0-12
|
||||
JMP runtime∕internal∕atomic·Xchg(SB)
|
||||
|
||||
|
||||
TEXT runtime∕internal∕atomic·Storep1(SB), NOSPLIT, $0-8
|
||||
TEXT runtime∕internal∕atomic·StorepNoWB(SB), NOSPLIT, $0-8
|
||||
MOVL ptr+0(FP), BX
|
||||
MOVL val+4(FP), AX
|
||||
XCHGL AX, 0(BX)
|
||||
|
@ -115,7 +115,7 @@ TEXT runtime∕internal∕atomic·Xchg64(SB), NOSPLIT, $0-24
|
||||
TEXT runtime∕internal∕atomic·Xchguintptr(SB), NOSPLIT, $0-24
|
||||
JMP runtime∕internal∕atomic·Xchg64(SB)
|
||||
|
||||
TEXT runtime∕internal∕atomic·Storep1(SB), NOSPLIT, $0-16
|
||||
TEXT runtime∕internal∕atomic·StorepNoWB(SB), NOSPLIT, $0-16
|
||||
MOVQ ptr+0(FP), BX
|
||||
MOVQ val+8(FP), AX
|
||||
XCHGQ AX, 0(BX)
|
||||
|
@ -115,7 +115,7 @@ TEXT runtime∕internal∕atomic·Xchg64(SB), NOSPLIT, $0-24
|
||||
TEXT runtime∕internal∕atomic·Xchguintptr(SB), NOSPLIT, $0-12
|
||||
JMP runtime∕internal∕atomic·Xchg(SB)
|
||||
|
||||
TEXT runtime∕internal∕atomic·Storep1(SB), NOSPLIT, $0-8
|
||||
TEXT runtime∕internal∕atomic·StorepNoWB(SB), NOSPLIT, $0-8
|
||||
MOVL ptr+0(FP), BX
|
||||
MOVL val+4(FP), AX
|
||||
XCHGL AX, 0(BX)
|
||||
|
@ -155,7 +155,7 @@ TEXT ·Xchg64(SB), NOSPLIT, $0-24
|
||||
TEXT ·Xchguintptr(SB), NOSPLIT, $0-24
|
||||
JMP ·Xchg64(SB)
|
||||
|
||||
TEXT ·Storep1(SB), NOSPLIT, $0-16
|
||||
TEXT ·StorepNoWB(SB), NOSPLIT, $0-16
|
||||
JMP ·Store64(SB)
|
||||
|
||||
TEXT ·Store(SB), NOSPLIT, $0-12
|
||||
|
@ -150,7 +150,7 @@ TEXT runtime∕internal∕atomic·Xchguintptr(SB), NOSPLIT, $0-24
|
||||
BR runtime∕internal∕atomic·Xchg64(SB)
|
||||
|
||||
|
||||
TEXT runtime∕internal∕atomic·Storep1(SB), NOSPLIT, $0-16
|
||||
TEXT runtime∕internal∕atomic·StorepNoWB(SB), NOSPLIT, $0-16
|
||||
BR runtime∕internal∕atomic·Store64(SB)
|
||||
|
||||
TEXT runtime∕internal∕atomic·Store(SB), NOSPLIT, $0-12
|
||||
|
@ -73,4 +73,4 @@ func Store(ptr *uint32, val uint32)
|
||||
func Store64(ptr *uint64, val uint64)
|
||||
|
||||
// NO go:noescape annotation; see atomic_pointer.go.
|
||||
func Storep1(ptr unsafe.Pointer, val unsafe.Pointer)
|
||||
func StorepNoWB(ptr unsafe.Pointer, val unsafe.Pointer)
|
||||
|
@ -61,5 +61,8 @@ func Store(ptr *uint32, val uint32)
|
||||
//go:noescape
|
||||
func Store64(ptr *uint64, val uint64)
|
||||
|
||||
// StorepNoWB performs *ptr = val atomically and without a write
|
||||
// barrier.
|
||||
//
|
||||
// NO go:noescape annotation; see atomic_pointer.go.
|
||||
func Storep1(ptr unsafe.Pointer, val unsafe.Pointer)
|
||||
func StorepNoWB(ptr unsafe.Pointer, val unsafe.Pointer)
|
||||
|
@ -85,7 +85,7 @@ func Loadp(addr unsafe.Pointer) unsafe.Pointer {
|
||||
}
|
||||
|
||||
//go:nosplit
|
||||
func Storep1(addr unsafe.Pointer, v unsafe.Pointer) {
|
||||
func StorepNoWB(addr unsafe.Pointer, v unsafe.Pointer) {
|
||||
for {
|
||||
old := *(*unsafe.Pointer)(addr)
|
||||
if Casp1((*unsafe.Pointer)(addr), old, v) {
|
||||
|
@ -77,4 +77,4 @@ func Store(ptr *uint32, val uint32)
|
||||
func Store64(ptr *uint64, val uint64)
|
||||
|
||||
// NO go:noescape annotation; see atomic_pointer.go.
|
||||
func Storep1(ptr unsafe.Pointer, val unsafe.Pointer)
|
||||
func StorepNoWB(ptr unsafe.Pointer, val unsafe.Pointer)
|
||||
|
@ -25,7 +25,7 @@ TEXT ·Loadp(SB),NOSPLIT,$-8-16
|
||||
MOVD R0, ret+8(FP)
|
||||
RET
|
||||
|
||||
TEXT runtime∕internal∕atomic·Storep1(SB), NOSPLIT, $0-16
|
||||
TEXT runtime∕internal∕atomic·StorepNoWB(SB), NOSPLIT, $0-16
|
||||
B runtime∕internal∕atomic·Store64(SB)
|
||||
|
||||
TEXT runtime∕internal∕atomic·Store(SB), NOSPLIT, $0-12
|
||||
|
@ -53,4 +53,4 @@ func Store(ptr *uint32, val uint32)
|
||||
func Store64(ptr *uint64, val uint64)
|
||||
|
||||
// NO go:noescape annotation; see atomic_pointer.go.
|
||||
func Storep1(ptr unsafe.Pointer, val unsafe.Pointer)
|
||||
func StorepNoWB(ptr unsafe.Pointer, val unsafe.Pointer)
|
||||
|
@ -53,4 +53,4 @@ func Store(ptr *uint32, val uint32)
|
||||
func Store64(ptr *uint64, val uint64)
|
||||
|
||||
// NO go:noescape annotation; see atomic_pointer.go.
|
||||
func Storep1(ptr unsafe.Pointer, val unsafe.Pointer)
|
||||
func StorepNoWB(ptr unsafe.Pointer, val unsafe.Pointer)
|
||||
|
@ -39,7 +39,7 @@ func Store64(ptr *uint64, val uint64) {
|
||||
// NO go:noescape annotation; see atomic_pointer.go.
|
||||
//go:noinline
|
||||
//go:nosplit
|
||||
func Storep1(ptr unsafe.Pointer, val unsafe.Pointer) {
|
||||
func StorepNoWB(ptr unsafe.Pointer, val unsafe.Pointer) {
|
||||
*(*uintptr)(ptr) = uintptr(val)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user