For completeness (and irrelevant to this particular message I am replying...) I 
should mention that Bill pointed out in email that the cycle collector can't be 
completely oblivious to weak references, as I said before.  Right now, when the 
CC identifies a JS object as garbage, it doesn't do anything to it.  Instead, 
killing any C++ references to JS is expected to make the object garbage from 
the perspective of the GC.

With weak references, those dead JS objects could still be reachable via a weak 
reference, which in turn could reach an unlinked C++ object, which is basically 
a C++ object with its pointers nulled out, which is not great.  So to properly 
support weak references, the CC would have to do a callback for every JS object 
into the JS engine, which would then have to kill off any weak references to 
those dying objects.  This seems similar to the issue with generational GC, 
where we go from not having to do anything on destruction to having to do some 
explicit cleanup.


----- Original Message -----
> This topic has come up on es-discuss again[1], with Mark Miller
> referencing[2] an older post of his to the list that contains a proposal
> for mitigating the issues with making GCs visible[3].
> 
> 
> [1]: https://mail.mozilla.org/pipermail/es-discuss/2013-November/034619.html
> [2]: https://mail.mozilla.org/pipermail/es-discuss/2013-November/034630.html
> [3]: https://mail.mozilla.org/pipermail/es-discuss/2013-January/028542.html
> 
> 
> On Mon, Nov 4, 2013 at 7:14 PM, Brendan Eich <bren...@mozilla.com> wrote:
> 
> > Terrence Cole wrote:
> >
> >> Recently, Luke tried turning down the incremental slice time
> >> knob to see how low we could go. He found that2ms  is easily doable,
> >>
> >> except when traversing the browser C++ heap, taking about6ms.
> >>
> >
> > I wonder how this scales on, say, a Nexus 4 (not to drag us all down to a
> > ZTE Open). Anyone know?
> >
> >
> > /be
> > _______________________________________________
> > dev-tech-js-engine-internals mailing list
> > dev-tech-js-engine-internals@lists.mozilla.org
> > https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals
> >
> _______________________________________________
> dev-tech-js-engine-internals mailing list
> dev-tech-js-engine-internals@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals
> 
_______________________________________________
dev-tech-js-engine-internals mailing list
dev-tech-js-engine-internals@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to