On Nov 1, 2013, at 1:26 PM, Terrence Cole wrote:

> ...
> 
> Secondly, correctness. The GC is by definition a cross-cutting concern;
> you cannot build anything in SpiderMonkey without considering GC. This
> makes weak primitives a cross-cutting concern of a cross-cutting
> concern. Our experience with combining generational GC and WeakMaps
> reflects this.
> 
> When implementing generational GC, our first few instances attempted to
> deal with weak maps in an efficient way. Unfortunately, it turns out
> this is actually impossible in the presence of nested weakmaps: we
> cannot reach a fixed point while only visiting the nursery heap. Sadly,
> even after we realized this, we still had to spent a tremendous amount
> of effort merely proving to ourself that our design is safe in the
> presence of weak maps.

I'm in whole-hearted agreement with you over-all perspective in this message.

But I'm curious about the issues you have been having with with WeakMaps and 
generational GC.  I was one of the original designers of Ephemerons and our GCs 
were all generational and very highly optimized. Ephemerons certainly 
introduced additional work in the GC that were proportional  to there use but 
the generational nature of our collectors didn't significantly complicate our 
design  Of course, JS WeakMaps have a different granularity than Ephemerons 
(although Ephemerons could be use as a primitive for implementing WeakMaps).   

It might be interesting to chat sometime and compare our experiences WRT 
generational collection and weak references.

Allen
_______________________________________________
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