// Copyright 2023 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.package abitypeInterfaceSwitchstruct { Cache *InterfaceSwitchCache NCases int// Array of NCases elements. // Each case must be a non-empty interface type. Cases [1]*InterfaceType}typeInterfaceSwitchCachestruct { Mask uintptr// mask for index. Must be a power of 2 minus 1 Entries [1]InterfaceSwitchCacheEntry// Mask+1 entries total}typeInterfaceSwitchCacheEntrystruct {// type of source value (a *Type) Typ uintptr// case # to dispatch to Case int// itab to use for resulting case variable (a *runtime.itab) Itab uintptr}const go122InterfaceSwitchCache = truefunc ( string) bool {if !go122InterfaceSwitchCache {returnfalse }// We need an atomic load instruction to make the cache multithreaded-safe. // (AtomicLoadPtr needs to be implemented in cmd/compile/internal/ssa/_gen/ARCH.rules.)switch {case"amd64", "arm64", "loong64", "mips", "mipsle", "mips64", "mips64le", "ppc64", "ppc64le", "riscv64", "s390x":returntruedefault:returnfalse }}typeTypeAssertstruct { Cache *TypeAssertCache Inter *InterfaceType CanFail bool}typeTypeAssertCachestruct { Mask uintptr Entries [1]TypeAssertCacheEntry}typeTypeAssertCacheEntrystruct {// type of source value (a *runtime._type) Typ uintptr// itab to use for result (a *runtime.itab) // nil if CanFail is set and conversion would fail. Itab uintptr}
The pages are generated with Goldsv0.7.0-preview. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.