| 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" | 8 #include "platform/heap/MarkingVisitor.h" |
| 9 #include "platform/heap/ThreadState.h" | 9 #include "platform/heap/ThreadState.h" |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 return adoptPtr(new MarkingVisitor<Visitor::ThreadLocalMarking>(state)); | 22 return adoptPtr(new MarkingVisitor<Visitor::ThreadLocalMarking>(state)); |
| 23 case BlinkGC::ThreadLocalWeakProcessing: | 23 case BlinkGC::ThreadLocalWeakProcessing: |
| 24 return adoptPtr(new MarkingVisitor<Visitor::WeakProcessing>(state)); | 24 return adoptPtr(new MarkingVisitor<Visitor::WeakProcessing>(state)); |
| 25 default: | 25 default: |
| 26 ASSERT_NOT_REACHED(); | 26 ASSERT_NOT_REACHED(); |
| 27 } | 27 } |
| 28 return nullptr; | 28 return nullptr; |
| 29 } | 29 } |
| 30 | 30 |
| 31 Visitor::Visitor(ThreadState* state, MarkingMode markingMode) | 31 Visitor::Visitor(ThreadState* state, MarkingMode markingMode) |
| 32 : m_state(state) | 32 : VisitorHelper(state) |
| 33 , m_markingMode(markingMode) | 33 , m_markingMode(markingMode) |
| 34 { | 34 { |
| 35 // See ThreadState::runScheduledGC() why we need to already be in a | 35 // See ThreadState::runScheduledGC() why we need to already be in a |
| 36 // GCForbiddenScope before any safe point is entered. | 36 // GCForbiddenScope before any safe point is entered. |
| 37 m_state->enterGCForbiddenScope(); | 37 state->enterGCForbiddenScope(); |
| 38 | 38 |
| 39 ASSERT(m_state->checkThread()); | 39 ASSERT(state->checkThread()); |
| 40 } | 40 } |
| 41 | 41 |
| 42 Visitor::~Visitor() | 42 Visitor::~Visitor() |
| 43 { | 43 { |
| 44 m_state->leaveGCForbiddenScope(); | 44 state()->leaveGCForbiddenScope(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 } // namespace blink | 47 } // namespace blink |
| OLD | NEW |