]> Cypherpunks.ru repositories - gostls13.git/commitdiff
[dev.typeparams] runtime: replace funcPC with internal/abi.FuncPCABIInternal
authorCherry Mui <cherryyz@google.com>
Fri, 21 May 2021 17:37:19 +0000 (13:37 -0400)
committerCherry Mui <cherryyz@google.com>
Fri, 21 May 2021 22:40:36 +0000 (22:40 +0000)
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>
39 files changed:
src/cmd/compile/internal/test/inl_test.go
src/runtime/chan.go
src/runtime/cpuprof.go
src/runtime/export_debug_test.go
src/runtime/export_test.go
src/runtime/iface.go
src/runtime/map.go
src/runtime/map_fast32.go
src/runtime/map_fast64.go
src/runtime/map_faststr.go
src/runtime/mbarrier.go
src/runtime/mprof.go
src/runtime/norace_linux_test.go
src/runtime/os3_solaris.go
src/runtime/os_aix.go
src/runtime/os_darwin.go
src/runtime/os_dragonfly.go
src/runtime/os_freebsd2.go
src/runtime/os_freebsd_amd64.go
src/runtime/os_linux.go
src/runtime/os_netbsd.go
src/runtime/os_openbsd.go
src/runtime/preempt.go
src/runtime/proc.go
src/runtime/select.go
src/runtime/signal_386.go
src/runtime/signal_arm.go
src/runtime/signal_arm64.go
src/runtime/signal_linux_s390x.go
src/runtime/signal_mips64x.go
src/runtime/signal_mipsx.go
src/runtime/signal_ppc64x.go
src/runtime/signal_riscv64.go
src/runtime/signal_unix.go
src/runtime/slice.go
src/runtime/stack.go
src/runtime/string.go
src/runtime/time.go
src/runtime/type.go

index 6f100033cf5b8b9666c458ce82b894db12d2a914..ad4e4fee976a0d43f6326948c84607e2f19342d6 100644 (file)
@@ -48,7 +48,6 @@ func TestIntendedInlining(t *testing.T) {
                        "fastlog2",
                        "fastrand",
                        "float64bits",
-                       "funcPC",
                        "getArgInfoFast",
                        "getm",
                        "getMCache",
index f2a75b30f44596490a95c191139d0a1346394ec8..3cdb5dce117e3325fab2712bca53df1c704c0f7c 100644 (file)
@@ -18,6 +18,7 @@ package runtime
 //  c.qcount < c.dataqsiz implies that c.sendq is empty.
 
 import (
+       "internal/abi"
        "runtime/internal/atomic"
        "runtime/internal/math"
        "unsafe"
@@ -169,7 +170,7 @@ func chansend(c *hchan, ep unsafe.Pointer, block bool, callerpc uintptr) bool {
        }
 
        if raceenabled {
-               racereadpc(c.raceaddr(), callerpc, funcPC(chansend))
+               racereadpc(c.raceaddr(), callerpc, abi.FuncPCABIInternal(chansend))
        }
 
        // Fast path: check for failed non-blocking operation without acquiring the lock.
@@ -365,7 +366,7 @@ func closechan(c *hchan) {
 
        if raceenabled {
                callerpc := getcallerpc()
-               racewritepc(c.raceaddr(), callerpc, funcPC(closechan))
+               racewritepc(c.raceaddr(), callerpc, abi.FuncPCABIInternal(closechan))
                racerelease(c.raceaddr())
        }
 
index e5d0193b9cbd4f5c10fc9ca0cac49464658ddec3..c81ab710c2021391708aa7a4e30c0395e9e6ff70 100644 (file)
@@ -13,6 +13,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/atomic"
        "runtime/internal/sys"
        "unsafe"
@@ -166,8 +167,8 @@ func (p *cpuProfile) addExtra() {
        if p.lostExtra > 0 {
                hdr := [1]uint64{p.lostExtra}
                lostStk := [2]uintptr{
-                       funcPC(_LostExternalCode) + sys.PCQuantum,
-                       funcPC(_ExternalCode) + sys.PCQuantum,
+                       abi.FuncPCABIInternal(_LostExternalCode) + sys.PCQuantum,
+                       abi.FuncPCABIInternal(_ExternalCode) + sys.PCQuantum,
                }
                p.log.write(nil, 0, hdr[:], lostStk[:])
                p.lostExtra = 0
@@ -176,8 +177,8 @@ func (p *cpuProfile) addExtra() {
        if p.lostAtomic > 0 {
                hdr := [1]uint64{p.lostAtomic}
                lostStk := [2]uintptr{
-                       funcPC(_LostSIGPROFDuringAtomic64) + sys.PCQuantum,
-                       funcPC(_System) + sys.PCQuantum,
+                       abi.FuncPCABIInternal(_LostSIGPROFDuringAtomic64) + sys.PCQuantum,
+                       abi.FuncPCABIInternal(_System) + sys.PCQuantum,
                }
                p.log.write(nil, 0, hdr[:], lostStk[:])
                p.lostAtomic = 0
index fe4c9045c107ebc01c0b25548d2e0c397397136a..9808fd52991d0d8f38508bb2f5d78eda21ba9d87 100644 (file)
@@ -125,7 +125,7 @@ func (h *debugCallHandler) inject(info *siginfo, ctxt *sigctxt, gp2 *g) bool {
                h.savedFP = *h.savedRegs.fpstate
                h.savedRegs.fpstate = nil
                // Set PC to debugCallV2.
-               ctxt.set_rip(uint64(funcPC(debugCallV2)))
+               ctxt.set_rip(uint64(abi.FuncPCABIInternal(debugCallV2)))
                // Call injected. Switch to the debugCall protocol.
                testSigtrap = h.handleF
        case _Grunnable:
index a6fc1e4785f6c7036a454ed345f50d7100fda034..b4de497aca841479fb1b232732ac821e989866d5 100644 (file)
@@ -27,8 +27,6 @@ var Exitsyscall = exitsyscall
 var LockedOSThread = lockedOSThread
 var Xadduintptr = atomic.Xadduintptr
 
-var FuncPC = funcPC
-
 var Fastlog2 = fastlog2
 
 var Atoi = atoi
index cd5fead9990cbfe2c98cfd291620c16b14f59589..b397d1ff8d42e9e2e8c51fefa314a62491e8103b 100644 (file)
@@ -5,6 +5,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/atomic"
        "runtime/internal/sys"
        "unsafe"
@@ -317,7 +318,7 @@ var (
 
 func convT2E(t *_type, elem unsafe.Pointer) (e eface) {
        if raceenabled {
-               raceReadObjectPC(t, elem, getcallerpc(), funcPC(convT2E))
+               raceReadObjectPC(t, elem, getcallerpc(), abi.FuncPCABIInternal(convT2E))
        }
        if msanenabled {
                msanread(elem, t.size)
@@ -390,7 +391,7 @@ func convTslice(val []byte) (x unsafe.Pointer) {
 
 func convT2Enoptr(t *_type, elem unsafe.Pointer) (e eface) {
        if raceenabled {
-               raceReadObjectPC(t, elem, getcallerpc(), funcPC(convT2Enoptr))
+               raceReadObjectPC(t, elem, getcallerpc(), abi.FuncPCABIInternal(convT2Enoptr))
        }
        if msanenabled {
                msanread(elem, t.size)
@@ -405,7 +406,7 @@ func convT2Enoptr(t *_type, elem unsafe.Pointer) (e eface) {
 func convT2I(tab *itab, elem unsafe.Pointer) (i iface) {
        t := tab._type
        if raceenabled {
-               raceReadObjectPC(t, elem, getcallerpc(), funcPC(convT2I))
+               raceReadObjectPC(t, elem, getcallerpc(), abi.FuncPCABIInternal(convT2I))
        }
        if msanenabled {
                msanread(elem, t.size)
@@ -420,7 +421,7 @@ func convT2I(tab *itab, elem unsafe.Pointer) (i iface) {
 func convT2Inoptr(tab *itab, elem unsafe.Pointer) (i iface) {
        t := tab._type
        if raceenabled {
-               raceReadObjectPC(t, elem, getcallerpc(), funcPC(convT2Inoptr))
+               raceReadObjectPC(t, elem, getcallerpc(), abi.FuncPCABIInternal(convT2Inoptr))
        }
        if msanenabled {
                msanread(elem, t.size)
index 111db56b01a2fe874767a6375b6c80d6588b3d4b..5575040f2af0ea9de19ecdaaa4b22fc60d2a6b9a 100644 (file)
@@ -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
 }
index 8d52dad217afb0fabce82c73c1a27ef52345eddd..420a01daec1ad7caea56e1021690d3330aa782d6 100644 (file)
@@ -5,6 +5,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/sys"
        "unsafe"
 )
@@ -12,7 +13,7 @@ import (
 func mapaccess1_fast32(t *maptype, h *hmap, key uint32) unsafe.Pointer {
        if raceenabled && h != nil {
                callerpc := getcallerpc()
-               racereadpc(unsafe.Pointer(h), callerpc, funcPC(mapaccess1_fast32))
+               racereadpc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapaccess1_fast32))
        }
        if h == nil || h.count == 0 {
                return unsafe.Pointer(&zeroVal[0])
@@ -52,7 +53,7 @@ func mapaccess1_fast32(t *maptype, h *hmap, key uint32) unsafe.Pointer {
 func mapaccess2_fast32(t *maptype, h *hmap, key uint32) (unsafe.Pointer, bool) {
        if raceenabled && h != nil {
                callerpc := getcallerpc()
-               racereadpc(unsafe.Pointer(h), callerpc, funcPC(mapaccess2_fast32))
+               racereadpc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapaccess2_fast32))
        }
        if h == nil || h.count == 0 {
                return unsafe.Pointer(&zeroVal[0]), false
@@ -95,7 +96,7 @@ func mapassign_fast32(t *maptype, h *hmap, key uint32) unsafe.Pointer {
        }
        if raceenabled {
                callerpc := getcallerpc()
-               racewritepc(unsafe.Pointer(h), callerpc, funcPC(mapassign_fast32))
+               racewritepc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapassign_fast32))
        }
        if h.flags&hashWriting != 0 {
                throw("concurrent map writes")
@@ -185,7 +186,7 @@ func mapassign_fast32ptr(t *maptype, h *hmap, key unsafe.Pointer) unsafe.Pointer
        }
        if raceenabled {
                callerpc := getcallerpc()
-               racewritepc(unsafe.Pointer(h), callerpc, funcPC(mapassign_fast32))
+               racewritepc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapassign_fast32))
        }
        if h.flags&hashWriting != 0 {
                throw("concurrent map writes")
@@ -272,7 +273,7 @@ done:
 func mapdelete_fast32(t *maptype, h *hmap, key uint32) {
        if raceenabled && h != nil {
                callerpc := getcallerpc()
-               racewritepc(unsafe.Pointer(h), callerpc, funcPC(mapdelete_fast32))
+               racewritepc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapdelete_fast32))
        }
        if h == nil || h.count == 0 {
                return
index f1368dc774ec4de8cc6ec4071fe507ee2020d6c0..cb202113ac5bb38287c19e6cba772732d29aec75 100644 (file)
@@ -5,6 +5,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/sys"
        "unsafe"
 )
@@ -12,7 +13,7 @@ import (
 func mapaccess1_fast64(t *maptype, h *hmap, key uint64) unsafe.Pointer {
        if raceenabled && h != nil {
                callerpc := getcallerpc()
-               racereadpc(unsafe.Pointer(h), callerpc, funcPC(mapaccess1_fast64))
+               racereadpc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapaccess1_fast64))
        }
        if h == nil || h.count == 0 {
                return unsafe.Pointer(&zeroVal[0])
@@ -52,7 +53,7 @@ func mapaccess1_fast64(t *maptype, h *hmap, key uint64) unsafe.Pointer {
 func mapaccess2_fast64(t *maptype, h *hmap, key uint64) (unsafe.Pointer, bool) {
        if raceenabled && h != nil {
                callerpc := getcallerpc()
-               racereadpc(unsafe.Pointer(h), callerpc, funcPC(mapaccess2_fast64))
+               racereadpc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapaccess2_fast64))
        }
        if h == nil || h.count == 0 {
                return unsafe.Pointer(&zeroVal[0]), false
@@ -95,7 +96,7 @@ func mapassign_fast64(t *maptype, h *hmap, key uint64) unsafe.Pointer {
        }
        if raceenabled {
                callerpc := getcallerpc()
-               racewritepc(unsafe.Pointer(h), callerpc, funcPC(mapassign_fast64))
+               racewritepc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapassign_fast64))
        }
        if h.flags&hashWriting != 0 {
                throw("concurrent map writes")
@@ -185,7 +186,7 @@ func mapassign_fast64ptr(t *maptype, h *hmap, key unsafe.Pointer) unsafe.Pointer
        }
        if raceenabled {
                callerpc := getcallerpc()
-               racewritepc(unsafe.Pointer(h), callerpc, funcPC(mapassign_fast64))
+               racewritepc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapassign_fast64))
        }
        if h.flags&hashWriting != 0 {
                throw("concurrent map writes")
@@ -272,7 +273,7 @@ done:
 func mapdelete_fast64(t *maptype, h *hmap, key uint64) {
        if raceenabled && h != nil {
                callerpc := getcallerpc()
-               racewritepc(unsafe.Pointer(h), callerpc, funcPC(mapdelete_fast64))
+               racewritepc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapdelete_fast64))
        }
        if h == nil || h.count == 0 {
                return
index 0673dd39c8ff6a87084668400febbf64520c0fa3..ed7e46b5f68906a15dba8e6c2326d3e084d5a28e 100644 (file)
@@ -5,6 +5,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/sys"
        "unsafe"
 )
@@ -12,7 +13,7 @@ import (
 func mapaccess1_faststr(t *maptype, h *hmap, ky string) unsafe.Pointer {
        if raceenabled && h != nil {
                callerpc := getcallerpc()
-               racereadpc(unsafe.Pointer(h), callerpc, funcPC(mapaccess1_faststr))
+               racereadpc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapaccess1_faststr))
        }
        if h == nil || h.count == 0 {
                return unsafe.Pointer(&zeroVal[0])
@@ -107,7 +108,7 @@ dohash:
 func mapaccess2_faststr(t *maptype, h *hmap, ky string) (unsafe.Pointer, bool) {
        if raceenabled && h != nil {
                callerpc := getcallerpc()
-               racereadpc(unsafe.Pointer(h), callerpc, funcPC(mapaccess2_faststr))
+               racereadpc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapaccess2_faststr))
        }
        if h == nil || h.count == 0 {
                return unsafe.Pointer(&zeroVal[0]), false
@@ -205,7 +206,7 @@ func mapassign_faststr(t *maptype, h *hmap, s string) unsafe.Pointer {
        }
        if raceenabled {
                callerpc := getcallerpc()
-               racewritepc(unsafe.Pointer(h), callerpc, funcPC(mapassign_faststr))
+               racewritepc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapassign_faststr))
        }
        if h.flags&hashWriting != 0 {
                throw("concurrent map writes")
@@ -300,7 +301,7 @@ done:
 func mapdelete_faststr(t *maptype, h *hmap, ky string) {
        if raceenabled && h != nil {
                callerpc := getcallerpc()
-               racewritepc(unsafe.Pointer(h), callerpc, funcPC(mapdelete_faststr))
+               racewritepc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapdelete_faststr))
        }
        if h == nil || h.count == 0 {
                return
index 4994347bdeb35610d1f45efb714b233004835105..b06ee725ddddd92c5018ad1edd4496c174f1edbf 100644 (file)
@@ -177,8 +177,8 @@ func typedmemmove(typ *_type, dst, src unsafe.Pointer) {
 //go:linkname reflect_typedmemmove reflect.typedmemmove
 func reflect_typedmemmove(typ *_type, dst, src unsafe.Pointer) {
        if raceenabled {
-               raceWriteObjectPC(typ, dst, getcallerpc(), funcPC(reflect_typedmemmove))
-               raceReadObjectPC(typ, src, getcallerpc(), funcPC(reflect_typedmemmove))
+               raceWriteObjectPC(typ, dst, getcallerpc(), abi.FuncPCABIInternal(reflect_typedmemmove))
+               raceReadObjectPC(typ, src, getcallerpc(), abi.FuncPCABIInternal(reflect_typedmemmove))
        }
        if msanenabled {
                msanwrite(dst, typ.size)
@@ -254,7 +254,7 @@ func typedslicecopy(typ *_type, dstPtr unsafe.Pointer, dstLen int, srcPtr unsafe
        // code and needs its own instrumentation.
        if raceenabled {
                callerpc := getcallerpc()
-               pc := funcPC(slicecopy)
+               pc := abi.FuncPCABIInternal(slicecopy)
                racewriterangepc(dstPtr, uintptr(n)*typ.size, callerpc, pc)
                racereadrangepc(srcPtr, uintptr(n)*typ.size, callerpc, pc)
        }
index 5235b898e4f56cdcf4613ee91803e8377c39192d..0ba415ba5acbe9c74808c3241cc3a6c4ee51c2ab 100644 (file)
@@ -8,6 +8,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/atomic"
        "unsafe"
 )
@@ -621,7 +622,7 @@ func record(r *MemProfileRecord, b *bucket) {
        r.AllocObjects = int64(mp.active.allocs)
        r.FreeObjects = int64(mp.active.frees)
        if raceenabled {
-               racewriterangepc(unsafe.Pointer(&r.Stack0[0]), unsafe.Sizeof(r.Stack0), getcallerpc(), funcPC(MemProfile))
+               racewriterangepc(unsafe.Pointer(&r.Stack0[0]), unsafe.Sizeof(r.Stack0), getcallerpc(), abi.FuncPCABIInternal(MemProfile))
        }
        if msanenabled {
                msanwrite(unsafe.Pointer(&r.Stack0[0]), unsafe.Sizeof(r.Stack0))
@@ -674,7 +675,7 @@ func BlockProfile(p []BlockProfileRecord) (n int, ok bool) {
                        }
                        r.Cycles = bp.cycles
                        if raceenabled {
-                               racewriterangepc(unsafe.Pointer(&r.Stack0[0]), unsafe.Sizeof(r.Stack0), getcallerpc(), funcPC(BlockProfile))
+                               racewriterangepc(unsafe.Pointer(&r.Stack0[0]), unsafe.Sizeof(r.Stack0), getcallerpc(), abi.FuncPCABIInternal(BlockProfile))
                        }
                        if msanenabled {
                                msanwrite(unsafe.Pointer(&r.Stack0[0]), unsafe.Sizeof(r.Stack0))
index 94b7c7a46777d81adf4a0059b81e20887531c324..b199aa633c12708c1361bc9c9af5e3c110e7b622 100644 (file)
@@ -9,6 +9,7 @@
 package runtime_test
 
 import (
+       "internal/abi"
        "runtime"
        "testing"
        "time"
@@ -25,7 +26,7 @@ func newOSProcCreated() {
 // Can't be run with -race because it inserts calls into newOSProcCreated()
 // that require a valid G/M.
 func TestNewOSProc0(t *testing.T) {
-       runtime.NewOSProc0(0x800000, unsafe.Pointer(runtime.FuncPC(newOSProcCreated)))
+       runtime.NewOSProc0(0x800000, unsafe.Pointer(abi.FuncPCABIInternal(newOSProcCreated)))
        check := time.NewTicker(100 * time.Millisecond)
        defer check.Stop()
        end := time.After(5 * time.Second)
index 3b1a773ee24e3e572eb7c41fa42aeb3286e59e4f..bfd7c7eb6410824cbf2bbbda0757e7c565defb77 100644 (file)
@@ -242,7 +242,7 @@ func setsig(i uint32, fn uintptr) {
 
        sa.sa_flags = _SA_SIGINFO | _SA_ONSTACK | _SA_RESTART
        sa.sa_mask = sigset_all
-       if fn == funcPC(sighandler) {
+       if fn == abi.FuncPCABIInternal(sighandler) { // abi.FuncPCABIInternal(sighandler) matches the callers in signal_unix.go
                fn = abi.FuncPCABI0(sigtramp)
        }
        *((*uintptr)(unsafe.Pointer(&sa._funcptr))) = fn
index 4fb1c8e845c87c5793a77c0f0bab6cca8b2e55fb..478dde2fc3ff4c1d8527c83a50fd86f19d8cbbb0 100644 (file)
@@ -8,6 +8,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "unsafe"
 )
 
@@ -267,7 +268,7 @@ func setsig(i uint32, fn uintptr) {
        var sa sigactiont
        sa.sa_flags = _SA_SIGINFO | _SA_ONSTACK | _SA_RESTART
        sa.sa_mask = sigset_all
-       if fn == funcPC(sighandler) {
+       if fn == abi.FuncPCABIInternal(sighandler) { // abi.FuncPCABIInternal(sighandler) matches the callers in signal_unix.go
                fn = uintptr(unsafe.Pointer(&sigtramp))
        }
        sa.sa_handler = fn
index 00139351abc71091c27335749abb4ebab2671875..df2c0ff4a5f5d9d0f3df59c2645085dbb3b8f167 100644 (file)
@@ -364,7 +364,7 @@ func setsig(i uint32, fn uintptr) {
        var sa usigactiont
        sa.sa_flags = _SA_SIGINFO | _SA_ONSTACK | _SA_RESTART
        sa.sa_mask = ^uint32(0)
-       if fn == funcPC(sighandler) { // funcPC(sighandler) matches the callers in signal_unix.go
+       if fn == abi.FuncPCABIInternal(sighandler) { // abi.FuncPCABIInternal(sighandler) matches the callers in signal_unix.go
                if iscgo {
                        fn = abi.FuncPCABI0(cgoSigtramp)
                } else {
index 45aeaecd891a11e00505832cff16b95ae39c4e1e..0c81ed4d7c3085aac93f36bde33748c8affc81e7 100644 (file)
@@ -227,7 +227,7 @@ func setsig(i uint32, fn uintptr) {
        var sa sigactiont
        sa.sa_flags = _SA_SIGINFO | _SA_ONSTACK | _SA_RESTART
        sa.sa_mask = sigset_all
-       if fn == funcPC(sighandler) {
+       if fn == abi.FuncPCABIInternal(sighandler) { // abi.FuncPCABIInternal(sighandler) matches the callers in signal_unix.go
                fn = abi.FuncPCABI0(sigtramp)
        }
        sa.sa_sigaction = fn
index 53ba23b64cfa8dcbcd4710bffc708558a4b11e9c..7e266dc27e2c62a34b74b35a5be352fdaf5e89c1 100644 (file)
@@ -15,7 +15,7 @@ func setsig(i uint32, fn uintptr) {
        var sa sigactiont
        sa.sa_flags = _SA_SIGINFO | _SA_ONSTACK | _SA_RESTART
        sa.sa_mask = sigset_all
-       if fn == funcPC(sighandler) {
+       if fn == abi.FuncPCABIInternal(sighandler) { // abi.FuncPCABIInternal(sighandler) matches the callers in signal_unix.go
                fn = abi.FuncPCABI0(sigtramp)
        }
        sa.sa_handler = fn
index 7ae80c25060be1442b5c4d5ffe3ca46988e63935..b179383eacc769316ab7a2c45b719e2a2a9c89b3 100644 (file)
@@ -14,7 +14,7 @@ func setsig(i uint32, fn uintptr) {
        var sa sigactiont
        sa.sa_flags = _SA_SIGINFO | _SA_ONSTACK | _SA_RESTART
        sa.sa_mask = sigset_all
-       if fn == funcPC(sighandler) {
+       if fn == abi.FuncPCABIInternal(sighandler) { // abi.FuncPCABIInternal(sighandler) matches the callers in signal_unix.go
                if iscgo {
                        fn = abi.FuncPCABI0(cgoSigtramp)
                } else {
index 9203f28351bfe80feed1522744e96cd54eea4f40..1984bf68445557529e5410e6aca2a4d3e7645ff0 100644 (file)
@@ -432,7 +432,7 @@ func setsig(i uint32, fn uintptr) {
        if GOARCH == "386" || GOARCH == "amd64" {
                sa.sa_restorer = abi.FuncPCABI0(sigreturn)
        }
-       if fn == funcPC(sighandler) {
+       if fn == abi.FuncPCABIInternal(sighandler) { // abi.FuncPCABIInternal(sighandler) matches the callers in signal_unix.go
                if iscgo {
                        fn = abi.FuncPCABI0(cgoSigtramp)
                } else {
index 0920d5293e5effe2bc6db35530f56506f8917aac..151cd17bbe8af549711251d8794723a2cdc44155 100644 (file)
@@ -319,7 +319,7 @@ func setsig(i uint32, fn uintptr) {
        var sa sigactiont
        sa.sa_flags = _SA_SIGINFO | _SA_ONSTACK | _SA_RESTART
        sa.sa_mask = sigset_all
-       if fn == funcPC(sighandler) {
+       if fn == abi.FuncPCABIInternal(sighandler) { // abi.FuncPCABIInternal(sighandler) matches the callers in signal_unix.go
                fn = abi.FuncPCABI0(sigtramp)
        }
        sa.sa_sigaction = fn
index 35995e7035ffe9eff3a760de22e10cd35fc3b117..54f36c6ebff7a4aebfd3c2a4a2b164043e00a58c 100644 (file)
@@ -192,7 +192,7 @@ func setsig(i uint32, fn uintptr) {
        var sa sigactiont
        sa.sa_flags = _SA_SIGINFO | _SA_ONSTACK | _SA_RESTART
        sa.sa_mask = uint32(sigset_all)
-       if fn == funcPC(sighandler) {
+       if fn == abi.FuncPCABIInternal(sighandler) { // abi.FuncPCABIInternal(sighandler) matches the callers in signal_unix.go
                fn = abi.FuncPCABI0(sigtramp)
        }
        sa.sa_sigaction = fn
index d1291c9c487a8ada15de8045f0b142fb5f8400bb..d6cdf1b8f8341e90d58d2734fde3627dd154ad20 100644 (file)
@@ -318,7 +318,7 @@ var asyncPreemptStack = ^uintptr(0)
 func init() {
        f := findfunc(abi.FuncPCABI0(asyncPreempt))
        total := funcMaxSPDelta(f)
-       f = findfunc(funcPC(asyncPreempt2))
+       f = findfunc(abi.FuncPCABIInternal(asyncPreempt2))
        total += funcMaxSPDelta(f)
        // Add some overhead for return PCs, etc.
        asyncPreemptStack = uintptr(total) + 8*sys.PtrSize
index 6c896cb993ecd0c3c69ddd6a5ede2c858457142b..63eeb6c9c75625c2a4b55469972ef282b842a73e 100644 (file)
@@ -466,18 +466,6 @@ func releaseSudog(s *sudog) {
        releasem(mp)
 }
 
-// funcPC returns the entry PC of the function f.
-// It assumes that f is a func value. Otherwise the behavior is undefined.
-// CAREFUL: In programs with plugins, funcPC can return different values
-// for the same function (because there are actually multiple copies of
-// the same function in the address space). To be safe, don't use the
-// results of this function in any == expression. It is only safe to
-// use the result as an address at which to start executing code.
-//go:nosplit
-func funcPC(f interface{}) uintptr {
-       return *(*uintptr)(efaceOf(&f).data)
-}
-
 // called from assembly
 func badmcall(fn func(*g)) {
        throw("runtime: mcall called on m->g0 stack")
@@ -2043,7 +2031,7 @@ func oneNewExtraM() {
        gp.lockedm.set(mp)
        gp.goid = int64(atomic.Xadd64(&sched.goidgen, 1))
        if raceenabled {
-               gp.racectx = racegostart(funcPC(newextram) + sys.PCQuantum)
+               gp.racectx = racegostart(abi.FuncPCABIInternal(newextram) + sys.PCQuantum)
        }
        // put on allg for garbage collector
        allgadd(gp)
@@ -4741,16 +4729,16 @@ func sigprof(pc, sp, lr uintptr, gp *g, mp *m) {
                        // If all of the above has failed, account it against abstract "System" or "GC".
                        n = 2
                        if inVDSOPage(pc) {
-                               pc = funcPC(_VDSO) + sys.PCQuantum
+                               pc = abi.FuncPCABIInternal(_VDSO) + sys.PCQuantum
                        } else if pc > firstmoduledata.etext {
                                // "ExternalCode" is better than "etext".
-                               pc = funcPC(_ExternalCode) + sys.PCQuantum
+                               pc = abi.FuncPCABIInternal(_ExternalCode) + sys.PCQuantum
                        }
                        stk[0] = pc
                        if mp.preemptoff != "" {
-                               stk[1] = funcPC(_GC) + sys.PCQuantum
+                               stk[1] = abi.FuncPCABIInternal(_GC) + sys.PCQuantum
                        } else {
-                               stk[1] = funcPC(_System) + sys.PCQuantum
+                               stk[1] = abi.FuncPCABIInternal(_System) + sys.PCQuantum
                        }
                }
        }
@@ -4794,7 +4782,7 @@ func sigprofNonGoPC(pc uintptr) {
        if prof.hz != 0 {
                stk := []uintptr{
                        pc,
-                       funcPC(_ExternalCode) + sys.PCQuantum,
+                       abi.FuncPCABIInternal(_ExternalCode) + sys.PCQuantum,
                }
                cpuprof.addNonGo(stk)
        }
@@ -6488,7 +6476,7 @@ func doInit(t *initTask) {
                        after := inittrace
 
                        f := *(*func())(unsafe.Pointer(&firstFunc))
-                       pkg := funcpkgpath(findfunc(funcPC(f)))
+                       pkg := funcpkgpath(findfunc(abi.FuncPCABIInternal(f)))
 
                        var sbuf [24]byte
                        print("init ", pkg, " @")
index e72761bfa91c59774541fa9831b5e0c78db89b34..74f0c291944ecdf4678c9683dbcefbde5c5f500d 100644 (file)
@@ -7,6 +7,7 @@ package runtime
 // This file contains the implementation of Go select statements.
 
 import (
+       "internal/abi"
        "runtime/internal/atomic"
        "unsafe"
 )
@@ -22,8 +23,8 @@ type scase struct {
 }
 
 var (
-       chansendpc = funcPC(chansend)
-       chanrecvpc = funcPC(chanrecv)
+       chansendpc = abi.FuncPCABIInternal(chansend)
+       chanrecvpc = abi.FuncPCABIInternal(chanrecv)
 )
 
 func selectsetpc(pc *uintptr) {
index 5824eaddb5630d5b2dc49bc68532c974cde09d81..c77a9cc52247487fb5118ee1162133b092291b59 100644 (file)
@@ -8,6 +8,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/sys"
        "unsafe"
 )
@@ -42,10 +43,10 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
        sp := uintptr(c.esp())
 
        if shouldPushSigpanic(gp, pc, *(*uintptr)(unsafe.Pointer(sp))) {
-               c.pushCall(funcPC(sigpanic), pc)
+               c.pushCall(abi.FuncPCABIInternal(sigpanic), pc)
        } else {
                // Not safe to push the call. Just clobber the frame.
-               c.set_eip(uint32(funcPC(sigpanic)))
+               c.set_eip(uint32(abi.FuncPCABIInternal(sigpanic)))
        }
 }
 
index 4d9c6224a29d1e6a64174b38fadcf22f8995b3c1..a0780788f809fc7a04fa7ca5d173cdea1325f89f 100644 (file)
@@ -7,7 +7,10 @@
 
 package runtime
 
-import "unsafe"
+import (
+       "internal/abi"
+       "unsafe"
+)
 
 func dumpregs(c *sigctxt) {
        print("trap    ", hex(c.trap()), "\n")
@@ -61,7 +64,7 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
 
        // In case we are panicking from external C code
        c.set_r10(uint32(uintptr(unsafe.Pointer(gp))))
-       c.set_pc(uint32(funcPC(sigpanic)))
+       c.set_pc(uint32(abi.FuncPCABIInternal(sigpanic)))
 }
 
 func (c *sigctxt) pushCall(targetPC, resumePC uintptr) {
index f04750084f4b011e5028ed08375548530a4d0318..9d4a8b8a99d54e6516418b84e44d8d7908b0d9d5 100644 (file)
@@ -8,6 +8,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/sys"
        "unsafe"
 )
@@ -77,7 +78,7 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
 
        // In case we are panicking from external C code
        c.set_r28(uint64(uintptr(unsafe.Pointer(gp))))
-       c.set_pc(uint64(funcPC(sigpanic)))
+       c.set_pc(uint64(abi.FuncPCABIInternal(sigpanic)))
 }
 
 func (c *sigctxt) pushCall(targetPC, resumePC uintptr) {
index 12d5c315931c89c5764e6813edbf55485b9c58be..03c58cbbb68cc00ea2d0a6224b1707c58d5d1921 100644 (file)
@@ -5,6 +5,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/sys"
        "unsafe"
 )
@@ -107,7 +108,7 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
        // In case we are panicking from external C code
        c.set_r0(0)
        c.set_r13(uint64(uintptr(unsafe.Pointer(gp))))
-       c.set_pc(uint64(funcPC(sigpanic)))
+       c.set_pc(uint64(abi.FuncPCABIInternal(sigpanic)))
 }
 
 func (c *sigctxt) pushCall(targetPC, resumePC uintptr) {
index 1616b570278a0ce8f91e0f702007b4f5677aba81..eebcc74886490a6d3f3e84d99be8c6391eb9ee0a 100644 (file)
@@ -9,6 +9,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/sys"
        "unsafe"
 )
@@ -80,7 +81,7 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
        }
 
        // In case we are panicking from external C code
-       sigpanicPC := uint64(funcPC(sigpanic))
+       sigpanicPC := uint64(abi.FuncPCABIInternal(sigpanic))
        c.set_r28(sigpanicPC >> 32 << 32) // RSB register
        c.set_r30(uint64(uintptr(unsafe.Pointer(gp))))
        c.set_pc(sigpanicPC)
index dcc7f1e9dd5e035e4caae63fbef5d181be917d2d..5067799bd6bd75368eac70205db44a38b906849d 100644 (file)
@@ -9,6 +9,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/sys"
        "unsafe"
 )
@@ -78,7 +79,7 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
 
        // In case we are panicking from external C code
        c.set_r30(uint32(uintptr(unsafe.Pointer(gp))))
-       c.set_pc(uint32(funcPC(sigpanic)))
+       c.set_pc(uint32(abi.FuncPCABIInternal(sigpanic)))
 }
 
 func (c *sigctxt) pushCall(targetPC, resumePC uintptr) {
index f2225da9a1771d53decc142e532630605f8a5da4..8a39d59957695ce14af2624fb51cf3b2ef8f2d19 100644 (file)
@@ -9,6 +9,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/sys"
        "unsafe"
 )
@@ -83,8 +84,8 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
        // In case we are panicking from external C code
        c.set_r0(0)
        c.set_r30(uint64(uintptr(unsafe.Pointer(gp))))
-       c.set_r12(uint64(funcPC(sigpanic)))
-       c.set_pc(uint64(funcPC(sigpanic)))
+       c.set_r12(uint64(abi.FuncPCABIInternal(sigpanic)))
+       c.set_pc(uint64(abi.FuncPCABIInternal(sigpanic)))
 }
 
 func (c *sigctxt) pushCall(targetPC, resumePC uintptr) {
index e6b1b14130e53b3960f57152d5b8926da2781759..aaaa217051b73c4b70b6d3d4ca7900882c605f12 100644 (file)
@@ -8,6 +8,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/sys"
        "unsafe"
 )
@@ -76,7 +77,7 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
 
        // In case we are panicking from external C code
        c.set_gp(uint64(uintptr(unsafe.Pointer(gp))))
-       c.set_pc(uint64(funcPC(sigpanic)))
+       c.set_pc(uint64(abi.FuncPCABIInternal(sigpanic)))
 }
 
 func (c *sigctxt) pushCall(targetPC, resumePC uintptr) {
index 6396232dd776e9c3b2ba9a7400c163e1062b0078..0b3414d45781d08a2282e026d3d6560cec74f73c 100644 (file)
@@ -144,7 +144,7 @@ func initsig(preinit bool) {
                }
 
                handlingSig[i] = 1
-               setsig(i, funcPC(sighandler))
+               setsig(i, abi.FuncPCABIInternal(sighandler))
        }
 }
 
@@ -195,7 +195,7 @@ func sigenable(sig uint32) {
                <-maskUpdatedChan
                if atomic.Cas(&handlingSig[sig], 0, 1) {
                        atomic.Storeuintptr(&fwdSig[sig], getsig(sig))
-                       setsig(sig, funcPC(sighandler))
+                       setsig(sig, abi.FuncPCABIInternal(sighandler))
                }
        }
 }
@@ -272,7 +272,7 @@ func setProcessCPUProfiler(hz int32) {
                // Enable the Go signal handler if not enabled.
                if atomic.Cas(&handlingSig[_SIGPROF], 0, 1) {
                        atomic.Storeuintptr(&fwdSig[_SIGPROF], getsig(_SIGPROF))
-                       setsig(_SIGPROF, funcPC(sighandler))
+                       setsig(_SIGPROF, abi.FuncPCABIInternal(sighandler))
                }
 
                var it itimerval
@@ -844,7 +844,7 @@ func raisebadsignal(sig uint32, c *sigctxt) {
        // We may receive another instance of the signal before we
        // restore the Go handler, but that is not so bad: we know
        // that the Go program has been ignoring the signal.
-       setsig(sig, funcPC(sighandler))
+       setsig(sig, abi.FuncPCABIInternal(sighandler))
 }
 
 //go:nosplit
index f9d4154acfd4416346c74bcac026b1aab37e1572..7a470f09b6c20463b6382517b2274d3c680c68fa 100644 (file)
@@ -5,6 +5,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/math"
        "runtime/internal/sys"
        "unsafe"
@@ -68,7 +69,7 @@ func makeslicecopy(et *_type, tolen int, fromlen int, from unsafe.Pointer) unsaf
 
        if raceenabled {
                callerpc := getcallerpc()
-               pc := funcPC(makeslicecopy)
+               pc := abi.FuncPCABIInternal(makeslicecopy)
                racereadrangepc(from, copymem, callerpc, pc)
        }
        if msanenabled {
@@ -144,7 +145,7 @@ func panicunsafeslicelen() {
 func growslice(et *_type, old slice, cap int) slice {
        if raceenabled {
                callerpc := getcallerpc()
-               racereadrangepc(old.array, uintptr(old.len*int(et.size)), callerpc, funcPC(growslice))
+               racereadrangepc(old.array, uintptr(old.len*int(et.size)), callerpc, abi.FuncPCABIInternal(growslice))
        }
        if msanenabled {
                msanread(old.array, uintptr(old.len*int(et.size)))
@@ -280,7 +281,7 @@ func slicecopy(toPtr unsafe.Pointer, toLen int, fromPtr unsafe.Pointer, fromLen
        size := uintptr(n) * width
        if raceenabled {
                callerpc := getcallerpc()
-               pc := funcPC(slicecopy)
+               pc := abi.FuncPCABIInternal(slicecopy)
                racereadrangepc(fromPtr, size, callerpc, pc)
                racewriterangepc(toPtr, size, callerpc, pc)
        }
index b21c9c95182cb84baa732ff81b81eddab602a4af..622de45f25a3fb2d19c05bcfbe731acc620f8e86 100644 (file)
@@ -1112,7 +1112,7 @@ func gostartcallfn(gobuf *gobuf, fv *funcval) {
        if fv != nil {
                fn = unsafe.Pointer(fv.fn)
        } else {
-               fn = unsafe.Pointer(funcPC(nilfunc))
+               fn = unsafe.Pointer(abi.FuncPCABIInternal(nilfunc))
        }
        gostartcall(gobuf, fn, unsafe.Pointer(fv))
 }
index d6030a1dca433b0d168d62665d930ba34b06965e..3c215d37540cc2f1c1b42db478a377bfe9e6722d 100644 (file)
@@ -5,6 +5,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "internal/bytealg"
        "runtime/internal/sys"
        "unsafe"
@@ -88,7 +89,7 @@ func slicebytetostring(buf *tmpBuf, ptr *byte, n int) (str string) {
                racereadrangepc(unsafe.Pointer(ptr),
                        uintptr(n),
                        getcallerpc(),
-                       funcPC(slicebytetostring))
+                       abi.FuncPCABIInternal(slicebytetostring))
        }
        if msanenabled {
                msanread(unsafe.Pointer(ptr), uintptr(n))
@@ -152,7 +153,7 @@ func slicebytetostringtmp(ptr *byte, n int) (str string) {
                racereadrangepc(unsafe.Pointer(ptr),
                        uintptr(n),
                        getcallerpc(),
-                       funcPC(slicebytetostringtmp))
+                       abi.FuncPCABIInternal(slicebytetostringtmp))
        }
        if msanenabled && n > 0 {
                msanread(unsafe.Pointer(ptr), uintptr(n))
@@ -203,7 +204,7 @@ func slicerunetostring(buf *tmpBuf, a []rune) string {
                racereadrangepc(unsafe.Pointer(&a[0]),
                        uintptr(len(a))*unsafe.Sizeof(a[0]),
                        getcallerpc(),
-                       funcPC(slicerunetostring))
+                       abi.FuncPCABIInternal(slicerunetostring))
        }
        if msanenabled && len(a) > 0 {
                msanread(unsafe.Pointer(&a[0]), uintptr(len(a))*unsafe.Sizeof(a[0]))
index dee6a674e4cdd277a9924abe27dfd1a389ba5759..90e9b1139f8c8b035cf64bd818891ebaf08614e0 100644 (file)
@@ -7,6 +7,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/atomic"
        "runtime/internal/sys"
        "unsafe"
@@ -856,7 +857,7 @@ func runOneTimer(pp *p, t *timer, now int64) {
        if raceenabled {
                ppcur := getg().m.p.ptr()
                if ppcur.timerRaceCtx == 0 {
-                       ppcur.timerRaceCtx = racegostart(funcPC(runtimer) + sys.PCQuantum)
+                       ppcur.timerRaceCtx = racegostart(abi.FuncPCABIInternal(runtimer) + sys.PCQuantum)
                }
                raceacquirectx(ppcur.timerRaceCtx, unsafe.Pointer(t))
        }
index 335fc57f4b9169815f6abc91b86b55ebe6a8ea63..52e65a3bd23bb310933291a6fecb57a2413e5cc5 100644 (file)
@@ -6,7 +6,10 @@
 
 package runtime
 
-import "unsafe"
+import (
+       "internal/abi"
+       "unsafe"
+)
 
 // tflag is documented in reflect/type.go.
 //
@@ -262,7 +265,7 @@ func (t *_type) textOff(off textOff) unsafe.Pointer {
        if off == -1 {
                // -1 is the sentinel value for unreachable code.
                // See cmd/link/internal/ld/data.go:relocsym.
-               return unsafe.Pointer(funcPC(unreachableMethod))
+               return unsafe.Pointer(abi.FuncPCABIInternal(unreachableMethod))
        }
        base := uintptr(unsafe.Pointer(t))
        var md *moduledata