The problem is that the same instance can now be retrieved multiple times from the map.

In case of an immutable object like string, it is perfectly fine.

But in case of e.g. a person object.. well.. things go wrong.

It is on my radar to add an optimization for serialization to deal with immutable objects. Currently we always put a full serialization barrier between even local calls, but this isn't needed.