[memprof] Introduce FrameIdConverter and CallStackIdConverter (#90307)

Currently, we convert FrameId to Frame and CallStackId to a call stack
at several places.  This patch unifies those into function objects --
FrameIdConverter and CallStackIdConverter.

The existing implementation of CallStackIdConverter, being removed in
this patch, handles both FrameId and CallStackId conversions.  This
patch splits it into two phases for flexibility (but make them
composable) because some places only require the FrameId conversion.

GitOrigin-RevId: e04df693bf5b38099ef1d7ab8e6ce6a1469597e2
5 files changed