Thin IoObject wrapper around basekit's PHash (cuckoo hash). DATA(self) is the PHash*; mark walks every key and value so contained IoObjects remain live. Unlike Io's own Object slots (which are stored in a PHash owned by the Object), Map is a separate user-visible collection with ordering-free semantics and symbol keys. The foreach implementation has two paths: on the iterative evaluator it materializes keys via IoMap_rawKeys and hands the List off to the foreach frame state machine (controlFlow.foreachInfo.mapSource carries the original Map so the loop can look the value up per iteration). The recursive fallback PHASH_FOREACH is used only during VM bootstrap before state->currentFrame exists.
Registered as the tag's compareFunc. Falls back to default pointer comparison against non-Maps. Otherwise compares by size first, then by walking the receiver's entries and comparing values for identical keys; any missing key or unequal value yields a nonzero result.
Registered as the tag's freeFunc. Frees the backing PHash; contained IoObjects are GC-managed and not touched here.
Io-visible thin wrapper over IoMap_rawKeys. Defined as a plain function (not IO_METHOD) because IoMap_rawKeys is also called from C paths that already have a raw Map pointer.
Registered as the tag's markFunc. Walks every key and value so contained IoObjects stay live for the GC.
Convenience constructor: looks up the registered proto and clones it. Used by C callers (serialization, foreach plumbing) that want a fresh Map without going through message machinery.
Builds the Map tag and installs clone/free/mark/compare function pointers. Stream write/read slots are left unset (the commented-out block below preserves the legacy BStream format).
Creates the Map proto, attaches a fresh PHash as its data pointer, and wires up the Io-visible method table (empty, at, atPut, keys, values, foreach, hasKey, hasValue, removeAt, ...). Called once during VM init; all later Maps are clones of this proto.
Low-level lookup used from C. Returns NULL on miss (not nil) so callers can distinguish a stored nil from an absent key.
Low-level insert used from C. IOREFs both key and value so the GC keeps them alive through this Map. Preferred over the Io-level atPut when a value is being threaded through internal machinery.
Registered as the tag's cloneFunc. Gives the clone its own PHash copy so mutation of one Map does not leak into the proto.
Builds a List of the Map's keys in PHash iteration order. Used by the Io-visible keys method and — importantly — by the iterative foreach path, which needs a materialized index-addressable collection to drive the foreach frame state machine.