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_OVERLOADED_ERROR_H_
6 #define TRACEIMPL_OVERLOADED_ERROR_H_
8 #include "heap/stubs.h"
12 class X
: public GarbageCollected
<X
> {
14 void trace(Visitor
*) {}
15 void trace(InlinedGlobalMarkingVisitor
) {}
18 class InlinedBase
: public GarbageCollected
<InlinedBase
> {
20 virtual void trace(Visitor
* visitor
) { traceImpl(visitor
); }
21 virtual void trace(InlinedGlobalMarkingVisitor visitor
) {
26 template <typename VisitorDispatcher
>
27 void traceImpl(VisitorDispatcher visitor
) {
28 // Missing visitor->trace(x_base_).
34 class InlinedDerived
: public InlinedBase
{
36 void trace(Visitor
* visitor
) override
{ traceImpl(visitor
); }
37 void trace(InlinedGlobalMarkingVisitor visitor
) override
{
42 template <typename VisitorDispatcher
>
43 void traceImpl(VisitorDispatcher visitor
) {
44 // Missing visitor->trace(x_derived_) and InlinedBase::trace(visitor).
50 class ExternBase
: public GarbageCollected
<ExternBase
> {
52 virtual void trace(Visitor
*);
53 virtual void trace(InlinedGlobalMarkingVisitor
);
56 template <typename VisitorDispatcher
>
57 void traceImpl(VisitorDispatcher
);
62 class ExternDerived
: public ExternBase
{
64 void trace(Visitor
*) override
;
65 void trace(InlinedGlobalMarkingVisitor
) override
;
68 template <typename VisitorDispatcher
>
69 void traceImpl(VisitorDispatcher
);
76 #endif // TRACEIMPL_OVERLOADED_ERROR_H_