mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.typeparams] runtime: replace funcPC with internal/abi.FuncPCABIInternal
At this point all funcPC references are ABIInternal functions. Replace with the intrinsics. Change-Id: I3ba7e485c83017408749b53f92877d3727a75e27 Reviewed-on: https://go-review.googlesource.com/c/go/+/321954 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
parent
6a81e063dd
commit
626e89c261
39 changed files with 111 additions and 99 deletions
|
|
@ -54,6 +54,7 @@ package runtime
|
|||
// before the table grows. Typical tables will be somewhat less loaded.
|
||||
|
||||
import (
|
||||
"internal/abi"
|
||||
"runtime/internal/atomic"
|
||||
"runtime/internal/math"
|
||||
"runtime/internal/sys"
|
||||
|
|
@ -394,7 +395,7 @@ func makeBucketArray(t *maptype, b uint8, dirtyalloc unsafe.Pointer) (buckets un
|
|||
func mapaccess1(t *maptype, h *hmap, key unsafe.Pointer) unsafe.Pointer {
|
||||
if raceenabled && h != nil {
|
||||
callerpc := getcallerpc()
|
||||
pc := funcPC(mapaccess1)
|
||||
pc := abi.FuncPCABIInternal(mapaccess1)
|
||||
racereadpc(unsafe.Pointer(h), callerpc, pc)
|
||||
raceReadObjectPC(t.key, key, callerpc, pc)
|
||||
}
|
||||
|
|
@ -452,7 +453,7 @@ bucketloop:
|
|||
func mapaccess2(t *maptype, h *hmap, key unsafe.Pointer) (unsafe.Pointer, bool) {
|
||||
if raceenabled && h != nil {
|
||||
callerpc := getcallerpc()
|
||||
pc := funcPC(mapaccess2)
|
||||
pc := abi.FuncPCABIInternal(mapaccess2)
|
||||
racereadpc(unsafe.Pointer(h), callerpc, pc)
|
||||
raceReadObjectPC(t.key, key, callerpc, pc)
|
||||
}
|
||||
|
|
@ -574,7 +575,7 @@ func mapassign(t *maptype, h *hmap, key unsafe.Pointer) unsafe.Pointer {
|
|||
}
|
||||
if raceenabled {
|
||||
callerpc := getcallerpc()
|
||||
pc := funcPC(mapassign)
|
||||
pc := abi.FuncPCABIInternal(mapassign)
|
||||
racewritepc(unsafe.Pointer(h), callerpc, pc)
|
||||
raceReadObjectPC(t.key, key, callerpc, pc)
|
||||
}
|
||||
|
|
@ -685,7 +686,7 @@ done:
|
|||
func mapdelete(t *maptype, h *hmap, key unsafe.Pointer) {
|
||||
if raceenabled && h != nil {
|
||||
callerpc := getcallerpc()
|
||||
pc := funcPC(mapdelete)
|
||||
pc := abi.FuncPCABIInternal(mapdelete)
|
||||
racewritepc(unsafe.Pointer(h), callerpc, pc)
|
||||
raceReadObjectPC(t.key, key, callerpc, pc)
|
||||
}
|
||||
|
|
@ -802,7 +803,7 @@ search:
|
|||
func mapiterinit(t *maptype, h *hmap, it *hiter) {
|
||||
if raceenabled && h != nil {
|
||||
callerpc := getcallerpc()
|
||||
racereadpc(unsafe.Pointer(h), callerpc, funcPC(mapiterinit))
|
||||
racereadpc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapiterinit))
|
||||
}
|
||||
|
||||
if h == nil || h.count == 0 {
|
||||
|
|
@ -852,7 +853,7 @@ func mapiternext(it *hiter) {
|
|||
h := it.h
|
||||
if raceenabled {
|
||||
callerpc := getcallerpc()
|
||||
racereadpc(unsafe.Pointer(h), callerpc, funcPC(mapiternext))
|
||||
racereadpc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapiternext))
|
||||
}
|
||||
if h.flags&hashWriting != 0 {
|
||||
throw("concurrent map iteration and map write")
|
||||
|
|
@ -978,7 +979,7 @@ next:
|
|||
func mapclear(t *maptype, h *hmap) {
|
||||
if raceenabled && h != nil {
|
||||
callerpc := getcallerpc()
|
||||
pc := funcPC(mapclear)
|
||||
pc := abi.FuncPCABIInternal(mapclear)
|
||||
racewritepc(unsafe.Pointer(h), callerpc, pc)
|
||||
}
|
||||
|
||||
|
|
@ -1363,7 +1364,7 @@ func reflect_maplen(h *hmap) int {
|
|||
}
|
||||
if raceenabled {
|
||||
callerpc := getcallerpc()
|
||||
racereadpc(unsafe.Pointer(h), callerpc, funcPC(reflect_maplen))
|
||||
racereadpc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(reflect_maplen))
|
||||
}
|
||||
return h.count
|
||||
}
|
||||
|
|
@ -1375,7 +1376,7 @@ func reflectlite_maplen(h *hmap) int {
|
|||
}
|
||||
if raceenabled {
|
||||
callerpc := getcallerpc()
|
||||
racereadpc(unsafe.Pointer(h), callerpc, funcPC(reflect_maplen))
|
||||
racereadpc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(reflect_maplen))
|
||||
}
|
||||
return h.count
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue