aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/alg.go
diff options
context:
space:
mode:
authorCholerae Hu <choleraehyq@gmail.com>2017-08-05 14:44:00 +0800
committerDavid Chase <drchase@google.com>2017-08-11 18:11:22 +0000
commit57bf6aca711a53aa7fea877b98896cd0445c6ad0 (patch)
treec713a6faa9beace0a076b836c269726297e97db1 /src/runtime/alg.go
parentadc28cb1e03d4fd3e4750cdcc6215976e3e250c9 (diff)
downloadgo-57bf6aca711a53aa7fea877b98896cd0445c6ad0.tar.gz
go-57bf6aca711a53aa7fea877b98896cd0445c6ad0.zip
runtime, cmd/compile: add intrinsic getclosureptr
Intrinsic enabled on all architectures, runtime asm implementation removed on all architectures. Fixes #21258 Change-Id: I2cb86d460b497c2f287a5b3df5c37fdb231c23a7 Reviewed-on: https://go-review.googlesource.com/53411 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/runtime/alg.go')
-rw-r--r--src/runtime/alg.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/runtime/alg.go b/src/runtime/alg.go
index 8d388da5a2..b90142814f 100644
--- a/src/runtime/alg.go
+++ b/src/runtime/alg.go
@@ -63,10 +63,12 @@ func memhash128(p unsafe.Pointer, h uintptr) uintptr {
return memhash(p, h, 16)
}
-// memhash_varlen is defined in assembly because it needs access
-// to the closure. It appears here to provide an argument
-// signature for the assembly routine.
-func memhash_varlen(p unsafe.Pointer, h uintptr) uintptr
+//go:nosplit
+func memhash_varlen(p unsafe.Pointer, h uintptr) uintptr {
+ ptr := getclosureptr()
+ size := *(*uintptr)(unsafe.Pointer(ptr + unsafe.Sizeof(h)))
+ return memhash(p, h, size)
+}
var algarray = [alg_max]typeAlg{
alg_NOEQ: {nil, nil},