Steve Fink wrote:
Another hole is when we use the pointer value to compute a hash code,
which we unfortunately do pretty often. For JSObjects, at least, it
would be really nice if we had an identity value to use instead.
dmandelin and I talked about this, and initially I assumed this would
require bloating up every JSObject, but David pointed out that we could
add it on as an optional property (with a private name?) so that it
would only affect objects used as keys.

You don't know which those are and don't want to add it on first use as key, rather see next para.

  Is this feasible? And what other
gcthings would we need something analogous for?

The standard trick on top of this is to use the address for identity until and only when the GC moves the object, and only then assign the private-keyed override identity. This is done in Scheme implementations with good success.

/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

Reply via email to