Thanks for the comments. I've templatized the compaction method. CQ it if you
like it; otherwise I'd be happy to iterate.

https://codereview.chromium.org/1276353004/diff/1/src/objects.cc
File src/objects.cc (right):

https://codereview.chromium.org/1276353004/diff/1/src/objects.cc#newcode7971
src/objects.cc:7971: if (WeakCell::cast(element)->cleared()) continue;
On 2015/08/07 21:37:24, Yang wrote:
Can we assert that we don't find PrototypeInfo objects here?

I agree with the sentiment, but I don't think such a check makes sense.
The WeakFixedArray shouldn't know or care what it's being used for and
what kind of objects are stored in it. The check would have to be
"DCHECK(!value->IsMap() || !Map::cast(value)->is_prototype_map())", but
that would mean that possible future use cases that store arbitrary maps
in a WeakFixedArray without caring about remembered indices couldn't use
the default empty callback.

https://codereview.chromium.org/1276353004/diff/1/src/objects.cc#newcode7979
src/objects.cc:7979: void WeakFixedArray::CompactPrototypeUserList() {
On 2015/08/07 21:37:24, Yang wrote:
This is essentially Compact() with an additional block inside the
loop. Can we
deduplicate by using template, or a flag?

Done. Used a template to provide a callback that's called for elements
being moved. You likey?

https://codereview.chromium.org/1276353004/diff/1/src/objects.h
File src/objects.h (right):

https://codereview.chromium.org/1276353004/diff/1/src/objects.h#newcode2543
src/objects.h:2543: void CompactPrototypeUserList();
On 2015/08/07 21:37:24, Yang wrote:
Not sure if this should live on Map instead.

Moved it to JSObject where all the other prototype registration stuff
lives.

https://codereview.chromium.org/1276353004/

--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to