aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/export_test.go
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2024-04-19 13:52:31 -0400
committerGopher Robot <gobot@golang.org>2024-08-02 16:41:53 +0000
commit4f7dc282c4bdfba4e63b39bbe9846c1469dc7ee5 (patch)
treeb4fa4f7de70120c25c408b85056ac30245cfaef9 /src/runtime/export_test.go
parent057b703407fa833193cbdc1f37179561c6c9da90 (diff)
downloadgo-4f7dc282c4bdfba4e63b39bbe9846c1469dc7ee5.tar.xz
all: split old and swiss map abi and compiler integration
The two map implementations are still identical, but now the compiler targets the appropriate ABI depending on GOEXPERIMENT. For #54766. Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-linux-amd64-longtest-swissmap Change-Id: I8438f64f044ba9de30ddbf2b8ceb9b4edd2d5614 Reviewed-on: https://go-review.googlesource.com/c/go/+/580779 Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/runtime/export_test.go')
-rw-r--r--src/runtime/export_test.go46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/runtime/export_test.go b/src/runtime/export_test.go
index b18480d0af..c45a4586d4 100644
--- a/src/runtime/export_test.go
+++ b/src/runtime/export_test.go
@@ -483,16 +483,6 @@ func (rw *RWMutex) Unlock() {
const RuntimeHmapSize = unsafe.Sizeof(hmap{})
-func MapBucketsCount(m map[int]int) int {
- h := *(**hmap)(unsafe.Pointer(&m))
- return 1 << h.B
-}
-
-func MapBucketsPointerIsNil(m map[int]int) bool {
- h := *(**hmap)(unsafe.Pointer(&m))
- return h.buckets == nil
-}
-
func OverLoadFactor(count int, B uint8) bool {
return overLoadFactor(count, B)
}
@@ -614,42 +604,6 @@ func stackOverflow(x *byte) {
stackOverflow(&buf[0])
}
-func MapTombstoneCheck(m map[int]int) {
- // Make sure emptyOne and emptyRest are distributed correctly.
- // We should have a series of filled and emptyOne cells, followed by
- // a series of emptyRest cells.
- h := *(**hmap)(unsafe.Pointer(&m))
- i := any(m)
- t := *(**maptype)(unsafe.Pointer(&i))
-
- for x := 0; x < 1<<h.B; x++ {
- b0 := (*bmap)(add(h.buckets, uintptr(x)*uintptr(t.BucketSize)))
- n := 0
- for b := b0; b != nil; b = b.overflow(t) {
- for i := 0; i < abi.MapBucketCount; i++ {
- if b.tophash[i] != emptyRest {
- n++
- }
- }
- }
- k := 0
- for b := b0; b != nil; b = b.overflow(t) {
- for i := 0; i < abi.MapBucketCount; i++ {
- if k < n && b.tophash[i] == emptyRest {
- panic("early emptyRest")
- }
- if k >= n && b.tophash[i] != emptyRest {
- panic("late non-emptyRest")
- }
- if k == n-1 && b.tophash[i] == emptyOne {
- panic("last non-emptyRest entry is emptyOne")
- }
- k++
- }
- }
- }
-}
-
func RunGetgThreadSwitchTest() {
// Test that getg works correctly with thread switch.
// With gccgo, if we generate getg inlined, the backend