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

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

Issue 2694243003: Remove ThreadState::m_isAtSafePoint (Closed)
Patch Set: Created 3 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 205
206 #if DCHECK_IS_ON() 206 #if DCHECK_IS_ON()
207 BasePage* ThreadHeap::findPageFromAddress(Address address) { 207 BasePage* ThreadHeap::findPageFromAddress(Address address) {
208 MutexLocker locker(m_threadAttachMutex); 208 MutexLocker locker(m_threadAttachMutex);
209 for (ThreadState* state : m_threads) { 209 for (ThreadState* state : m_threads) {
210 if (BasePage* page = state->findPageFromAddress(address)) 210 if (BasePage* page = state->findPageFromAddress(address))
211 return page; 211 return page;
212 } 212 }
213 return nullptr; 213 return nullptr;
214 } 214 }
215
216 bool ThreadHeap::isAtSafePoint() {
217 MutexLocker locker(m_threadAttachMutex);
218 for (ThreadState* state : m_threads) {
219 if (!state->isAtSafePoint())
220 return false;
221 }
222 return true;
223 }
224 #endif 215 #endif
225 216
226 Address ThreadHeap::checkAndMarkPointer(Visitor* visitor, Address address) { 217 Address ThreadHeap::checkAndMarkPointer(Visitor* visitor, Address address) {
227 ASSERT(ThreadState::current()->isInGC()); 218 ASSERT(ThreadState::current()->isInGC());
228 219
229 #if !DCHECK_IS_ON() 220 #if !DCHECK_IS_ON()
230 if (m_heapDoesNotContainCache->lookup(address)) 221 if (m_heapDoesNotContainCache->lookup(address))
231 return nullptr; 222 return nullptr;
232 #endif 223 #endif
233 224
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 ProcessHeap::decreaseTotalMarkedObjectSize(m_stats.markedObjectSize()); 579 ProcessHeap::decreaseTotalMarkedObjectSize(m_stats.markedObjectSize());
589 580
590 m_stats.reset(); 581 m_stats.reset();
591 for (ThreadState* state : m_threads) 582 for (ThreadState* state : m_threads)
592 state->resetHeapCounters(); 583 state->resetHeapCounters();
593 } 584 }
594 585
595 ThreadHeap* ThreadHeap::s_mainThreadHeap = nullptr; 586 ThreadHeap* ThreadHeap::s_mainThreadHeap = nullptr;
596 587
597 } // namespace blink 588 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698