diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-06-06 00:44:01 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-06-06 00:44:01 +0000 |
commit | 269f05ff58289cfdd3a35f0d9afc8e229a98f50e (patch) | |
tree | 5375b70ffa2d9dda8fe739d2ee1a4a412d7d5c96 /libgo/go/runtime/map_fast32.go | |
parent | 91bd9240f918e758b75e362847f4fc3de8f99a12 (diff) |
compiler: make use of specialized fast map routines
In the runtime there are specialized fast map routines for
certain kep types. This CL lets the compiler make use of these
functions, instead of always using the generic ones.
As we now generate multiple versions of map delete calls, to make
things easier we delay the expansion of the built-in delete
function to flatten phase.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/180858
From-SVN: r271983
Diffstat (limited to 'libgo/go/runtime/map_fast32.go')
-rw-r--r-- | libgo/go/runtime/map_fast32.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libgo/go/runtime/map_fast32.go b/libgo/go/runtime/map_fast32.go index 1fa5cd968e4..07a35e18fc6 100644 --- a/libgo/go/runtime/map_fast32.go +++ b/libgo/go/runtime/map_fast32.go @@ -9,6 +9,15 @@ import ( "unsafe" ) +// For gccgo, use go:linkname to rename compiler-called functions to +// themselves, so that the compiler will export them. +// +//go:linkname mapaccess1_fast32 runtime.mapaccess1_fast32 +//go:linkname mapaccess2_fast32 runtime.mapaccess2_fast32 +//go:linkname mapassign_fast32 runtime.mapassign_fast32 +//go:linkname mapassign_fast32ptr runtime.mapassign_fast32ptr +//go:linkname mapdelete_fast32 runtime.mapdelete_fast32 + func mapaccess1_fast32(t *maptype, h *hmap, key uint32) unsafe.Pointer { if raceenabled && h != nil { callerpc := getcallerpc() |