Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(872)

Side by Side Diff: third_party/WebKit/Source/platform/heap/Visitor.cpp

Issue 1974693002: Make Visitor use heap for the current thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Visitor.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Visitor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698