https://codereview.chromium.org/640303006/diff/330001/src/heap/objects-visiting-inl.h
File src/heap/objects-visiting-inl.h (right):

https://codereview.chromium.org/640303006/diff/330001/src/heap/objects-visiting-inl.h#newcode360
src/heap/objects-visiting-inl.h:360: if (weak_cell->next() ==
heap->undefined_value()) {
On 2014/10/14 13:37:22, Erik Corry wrote:
I think this should set to smi zero.

Since there's no set_value function, there's no need to chain up the
weak cell
if it only contains undefined.

Even if there was a set_value method (is there actually one? the
design doc says
there isn't...) the write barrier should ensure that we come back here
if it is
used.

Good idea about skipping cleared weak cells. Added a check.

About setting to smi zero: undefined and smi zero help us distinguish
the following cases:
- weak cell is not in the list (next() == undefined)
- weak cell is the last element of the list (next() == smi zero)
- weak cell is in the list and not the last element (next() == pointer
to a weak cell)

We could probably use smi zero for first two cases, but then it would
complicate debugging.

https://codereview.chromium.org/640303006/

--
--
v8-dev mailing list
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to