1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef TRACEIMPL_OMITTED_TRACE_H_
6 #define TRACEIMPL_OMITTED_TRACE_H_
8 #include "heap/stubs.h"
12 class A
: public GarbageCollected
<A
> {
14 virtual void trace(Visitor
* visitor
) { traceImpl(visitor
); }
15 virtual void trace(InlinedGlobalMarkingVisitor visitor
) {
20 template <typename VisitorDispatcher
>
21 void traceImpl(VisitorDispatcher visitor
) {}
25 // trace() isn't necessary because we've got nothing to trace here.
30 void trace(Visitor
* visitor
) override
{ traceImpl(visitor
); }
31 void trace(InlinedGlobalMarkingVisitor visitor
) override
{
36 template <typename VisitorDispatcher
>
37 void traceImpl(VisitorDispatcher visitor
) {
38 // B::trace() is actually A::trace(), and in certain cases we only get
39 // limited information like "there is a function call that will be resolved
40 // to A::trace()". We still want to mark B as traced.
47 #endif // TRACEIMPL_OMITTED_TRACE_H_