InternPool: avoid indexToKey recursion for ptr_slice

Recursion makes this hot function more difficult to profile and
optimize.

The ptr_slice encoding now additionally includes the slice type. This
makes typeOf() implementable without indexToKey() as well as no longer
using recursion in the ptr_slice prong of indexToKey itself.

Unfortunately some logic had to be duplicated. However, I think that a
future enhancement could eliminate the duplication as well as remove
some other unwanted code, improving performance, by representing a slice
value in `Key.Ptr` without `addr` populated directly, but with an
`Index` pointing to the underlying manyptr value.
55cda9a592Andrew Kelley committed on 6/11/2023, 3:47:56 AMparentf7177fb
1 file changedLine totals unavailable