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

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

Issue 2007283002: Allow CrossThreadPersistent in collections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 319
320 #if !ENABLE(ASSERT) 320 #if !ENABLE(ASSERT)
321 if (m_heapDoesNotContainCache->lookup(address)) 321 if (m_heapDoesNotContainCache->lookup(address))
322 return nullptr; 322 return nullptr;
323 #endif 323 #endif
324 324
325 if (BasePage* page = lookupPageForAddress(address)) { 325 if (BasePage* page = lookupPageForAddress(address)) {
326 ASSERT(page->contains(address)); 326 ASSERT(page->contains(address));
327 ASSERT(!page->orphaned()); 327 ASSERT(!page->orphaned());
328 ASSERT(!m_heapDoesNotContainCache->lookup(address)); 328 ASSERT(!m_heapDoesNotContainCache->lookup(address));
329 DCHECK(&visitor->heap() == &page->arena()->getThreadState()->heap());
329 page->checkAndMarkPointer(visitor, address); 330 page->checkAndMarkPointer(visitor, address);
330 return address; 331 return address;
331 } 332 }
332 333
333 #if !ENABLE(ASSERT) 334 #if !ENABLE(ASSERT)
334 m_heapDoesNotContainCache->addEntry(address); 335 m_heapDoesNotContainCache->addEntry(address);
335 #else 336 #else
336 if (!m_heapDoesNotContainCache->lookup(address)) 337 if (!m_heapDoesNotContainCache->lookup(address))
337 m_heapDoesNotContainCache->addEntry(address); 338 m_heapDoesNotContainCache->addEntry(address);
338 #endif 339 #endif
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 ProcessHeap::decreaseTotalMarkedObjectSize(m_stats.markedObjectSize()); 784 ProcessHeap::decreaseTotalMarkedObjectSize(m_stats.markedObjectSize());
784 785
785 m_stats.reset(); 786 m_stats.reset();
786 for (ThreadState* state : m_threads) 787 for (ThreadState* state : m_threads)
787 state->resetHeapCounters(); 788 state->resetHeapCounters();
788 } 789 }
789 790
790 ThreadHeap* ThreadHeap::s_mainThreadHeap = nullptr; 791 ThreadHeap* ThreadHeap::s_mainThreadHeap = nullptr;
791 792
792 } // namespace blink 793 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698