I don't know enough about wrappers yet to have a definite opinion, but it's
my understanding that if I encounter a wrapper I can't just unwrap the
value and pass the resulting pointer on and let it escape unwrapped back
into content. If that is so, then we have a problem, because it means that
potentially every typed reference in wasm may need to be unwrapped, and
this will greatly increase the cost of all pointer operations in wasm,
notably field accesses through them. At the moment references are nullable
so we always pay for a null check but we hope to allow code generators to
ask for non-nullable pointers too; at which point a field reference is a
single indirect load. And indeed when there is a null check it might well
be handleable as a trap, the way we handle OOB accesses already.
(If I'm mistaken, and it's ok to unwrap something and let it stay unwrapped
and let the unwrapped pointer escape back into content, then things are
much simpler, as the unwrapping can take place during the unboxing from
anyref -> typed ref.)
--lars