+mstarzinger to comment on usage of per-isolate state. He suggested we need
to
restructure this to create the WeakMaps in a way that doesn't tie them to a
context, but I'm not clear what the best way to do that will be.
Drive-by-comments: As discussed offline with Andreas, I think we will need a
separate "InternalWeakMap" that builds on the same backing functionality as
WeakMaps but isn't bound to a specific context. Unfortunately I am not yet
sure
about the specifics of that.
https://codereview.chromium.org/11274014/diff/14001/src/object-observ... src/object-observe.js:48: objectObservationState.observerInfoMap =
createInternalWeakMap();
This will make the WeakMap instantiated in this context globally
reachable from the whole isolate. Thereby the first context will be kept
alive indefinitely.
Minimal approach: use ObjectHashTable directly from object-observe.js via a
few
helper runtime functions. Pretty ugly, in that we're storing non-JS objects
in
properties of a real JS object, but seems to work.