Interesting observation.

The recursion in Box with ObjectVerify seems indeed redundant since the
referenced object will be found by the verifier later.
It should be fine if we just verify basic invariants in object-debug.cc,
given that there is an iterator that feeds the verifier with objects (which
is the case for the heap verifier).

On Wed, Oct 12, 2016 at 1:41 AM Adam Klein <ad...@chromium.org> wrote:

> +some GC folks directly
>
> On Tue, Oct 4, 2016 at 11:51 AM, Adam Klein <ad...@chromium.org> wrote:
>
> It seems there's some confusion (likely on my part) about what code needs
> to be added to objects-debug.cc when adding a new HeapObject. Consider two
> different Structs, AccessorPair and Box:
>
> void AccessorPair::AccessorPairVerify() {
>   CHECK(IsAccessorPair());
>   VerifyPointer(getter());
>   VerifyPointer(setter());
> }
>
> void Box::BoxVerify() {
>   CHECK(IsBox());
>   value()->ObjectVerify();
> }
>
> AccessorPair only calls VerifyPointer, which checks that the fields is
> either a Smi or is a pointer to a HeapObject that lives in the Heap.
> Meanwhile Box recurses into ObjectVerify on the thing it wraps. Which is
> correct?
>
> Reading Heap::Verify, it seems we call Verify on each space, which calls
> ObjectVerify() followed by iterating the body with a VerifyPointersVisitor.
> Which looks like it does something very similar to VerifyPointer(). So the
> call to VerifyPointer() in AccessorPairVerify looks redundant.
>
> What about the call to ObjectVerify() in BoxVerify? I expect we'll end up
> eventually calling ObjectVerify whenever the heap iteration hits
> Box::value() (and as per the previous paragraph, assuming we've already
> verified that the pointer is _in_ the heap).
>
> So do we really need anything in object-debug.cc other than specific
> invariants about the contents? Say, a field that ought to be one of a few
> object types.
>
> - Adam
>
>
> --
> --
> 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.
>

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