OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "platform/heap/Visitor.h" | 5 #include "platform/heap/Visitor.h" |
6 | 6 |
7 #include "platform/heap/BlinkGC.h" | 7 #include "platform/heap/BlinkGC.h" |
8 #include "platform/heap/MarkingVisitor.h" | |
9 #include "platform/heap/ThreadState.h" | 8 #include "platform/heap/ThreadState.h" |
| 9 #include "platform/heap/VisitorImpl.h" |
10 #include "wtf/PtrUtil.h" | 10 #include "wtf/PtrUtil.h" |
11 #include <memory> | 11 #include <memory> |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 std::unique_ptr<Visitor> Visitor::create(ThreadState* state, | 15 std::unique_ptr<Visitor> Visitor::create(ThreadState* state, |
16 VisitorMarkingMode mode) { | 16 VisitorMarkingMode mode) { |
17 return WTF::makeUnique<MarkingVisitor>(state, mode); | 17 return WTF::makeUnique<Visitor>(state, mode); |
18 } | 18 } |
19 | 19 |
20 Visitor::Visitor(ThreadState* state, VisitorMarkingMode markingMode) | 20 Visitor::Visitor(ThreadState* state, VisitorMarkingMode markingMode) |
21 : VisitorHelper(state, markingMode) { | 21 : m_state(state), m_markingMode(markingMode) { |
22 // See ThreadState::runScheduledGC() why we need to already be in a | 22 // See ThreadState::runScheduledGC() why we need to already be in a |
23 // GCForbiddenScope before any safe point is entered. | 23 // GCForbiddenScope before any safe point is entered. |
24 DCHECK(state->isGCForbidden()); | 24 DCHECK(state->isGCForbidden()); |
25 #if DCHECK_IS_ON() | 25 #if DCHECK_IS_ON() |
26 DCHECK(state->checkThread()); | 26 DCHECK(state->checkThread()); |
27 #endif | 27 #endif |
28 } | 28 } |
29 | 29 |
30 Visitor::~Visitor() {} | 30 Visitor::~Visitor() {} |
31 | 31 |
| 32 void Visitor::markNoTracingCallback(Visitor* visitor, void* object) { |
| 33 visitor->markNoTracing(object); |
| 34 } |
| 35 |
32 } // namespace blink | 36 } // namespace blink |
OLD | NEW |