Re: First cut at storing state per-isolate (issue 11274014)

12 views
Skip to first unread message

ad...@chromium.org

unread,
Nov 5, 2012, 6:31:36 AM11/5/12
to raf...@chromium.org, ross...@chromium.org, mstar...@chromium.org, v8-...@googlegroups.com
+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.

https://codereview.chromium.org/11274014/

mstar...@chromium.org

unread,
Nov 5, 2012, 8:08:10 AM11/5/12
to ad...@chromium.org, raf...@chromium.org, ross...@chromium.org, v8-...@googlegroups.com
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-observe.js
File src/object-observe.js (right):

https://codereview.chromium.org/11274014/diff/14001/src/object-observe.js#newcode48
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.

https://codereview.chromium.org/11274014/

ad...@chromium.org

unread,
Nov 5, 2012, 9:14:48 AM11/5/12
to raf...@chromium.org, ross...@chromium.org, mstar...@chromium.org, v8-...@googlegroups.com
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.

https://codereview.chromium.org/11274014/
Reply all
Reply to author
Forward
0 new messages