diff options
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/alg.go | 3 | ||||
| -rw-r--r-- | src/runtime/stubs.go | 21 |
2 files changed, 2 insertions, 22 deletions
diff --git a/src/runtime/alg.go b/src/runtime/alg.go index 1c373b7f25..e183452fbe 100644 --- a/src/runtime/alg.go +++ b/src/runtime/alg.go @@ -8,6 +8,7 @@ import ( "internal/abi" "internal/cpu" "internal/goarch" + "internal/runtime/sys" "unsafe" ) @@ -34,7 +35,7 @@ func memhash128(p unsafe.Pointer, h uintptr) uintptr { //go:nosplit func memhash_varlen(p unsafe.Pointer, h uintptr) uintptr { - ptr := getclosureptr() + ptr := sys.GetClosurePtr() size := *(*uintptr)(unsafe.Pointer(ptr + unsafe.Sizeof(h))) return memhash(p, h, size) } diff --git a/src/runtime/stubs.go b/src/runtime/stubs.go index 84f478db07..d334190976 100644 --- a/src/runtime/stubs.go +++ b/src/runtime/stubs.go @@ -307,27 +307,6 @@ func goexit(neverCallThisFunction) // data dependency ordering. func publicationBarrier() -// getclosureptr returns the pointer to the current closure. -// getclosureptr can only be used in an assignment statement -// at the entry of a function. Moreover, go:nosplit directive -// must be specified at the declaration of caller function, -// so that the function prolog does not clobber the closure register. -// for example: -// -// //go:nosplit -// func f(arg1, arg2, arg3 int) { -// dx := getclosureptr() -// } -// -// The compiler rewrites calls to this function into instructions that fetch the -// pointer from a well-known register (DX on x86 architecture, etc.) directly. -// -// WARNING: PGO-based devirtualization cannot detect that caller of -// getclosureptr require closure context, and thus must maintain a list of -// these functions, which is in -// cmd/compile/internal/devirtualize/pgo.maybeDevirtualizeFunctionCall. -func getclosureptr() uintptr - //go:noescape func asmcgocall(fn, arg unsafe.Pointer) int32 |
