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

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

Issue 2522653002: Revert of Move ProcessHeap::isLowEndDevice to MemoryCoordinator (Closed)
Patch Set: Created 4 years 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 12 matching lines...) Expand all
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "platform/heap/Heap.h" 31 #include "platform/heap/Heap.h"
32 32
33 #include "base/sys_info.h"
33 #include "platform/Histogram.h" 34 #include "platform/Histogram.h"
34 #include "platform/RuntimeEnabledFeatures.h" 35 #include "platform/RuntimeEnabledFeatures.h"
35 #include "platform/ScriptForbiddenScope.h" 36 #include "platform/ScriptForbiddenScope.h"
36 #include "platform/heap/BlinkGCMemoryDumpProvider.h" 37 #include "platform/heap/BlinkGCMemoryDumpProvider.h"
37 #include "platform/heap/CallbackStack.h" 38 #include "platform/heap/CallbackStack.h"
38 #include "platform/heap/MarkingVisitor.h" 39 #include "platform/heap/MarkingVisitor.h"
39 #include "platform/heap/PageMemory.h" 40 #include "platform/heap/PageMemory.h"
40 #include "platform/heap/PagePool.h" 41 #include "platform/heap/PagePool.h"
41 #include "platform/heap/SafePoint.h" 42 #include "platform/heap/SafePoint.h"
42 #include "platform/heap/ThreadState.h" 43 #include "platform/heap/ThreadState.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 99
99 void ThreadHeap::flushHeapDoesNotContainCache() { 100 void ThreadHeap::flushHeapDoesNotContainCache() {
100 m_heapDoesNotContainCache->flush(); 101 m_heapDoesNotContainCache->flush();
101 } 102 }
102 103
103 void ProcessHeap::init() { 104 void ProcessHeap::init() {
104 s_shutdownComplete = false; 105 s_shutdownComplete = false;
105 s_totalAllocatedSpace = 0; 106 s_totalAllocatedSpace = 0;
106 s_totalAllocatedObjectSize = 0; 107 s_totalAllocatedObjectSize = 0;
107 s_totalMarkedObjectSize = 0; 108 s_totalMarkedObjectSize = 0;
109 s_isLowEndDevice = base::SysInfo::IsLowEndDevice();
108 110
109 GCInfoTable::init(); 111 GCInfoTable::init();
110 CallbackStackMemoryPool::instance().initialize(); 112 CallbackStackMemoryPool::instance().initialize();
111 } 113 }
112 114
113 void ProcessHeap::resetHeapCounters() { 115 void ProcessHeap::resetHeapCounters() {
114 s_totalAllocatedObjectSize = 0; 116 s_totalAllocatedObjectSize = 0;
115 s_totalMarkedObjectSize = 0; 117 s_totalMarkedObjectSize = 0;
116 } 118 }
117 119
(...skipping 12 matching lines...) Expand all
130 s_shutdownComplete = true; 132 s_shutdownComplete = true;
131 } 133 }
132 134
133 CrossThreadPersistentRegion& ProcessHeap::crossThreadPersistentRegion() { 135 CrossThreadPersistentRegion& ProcessHeap::crossThreadPersistentRegion() {
134 DEFINE_THREAD_SAFE_STATIC_LOCAL(CrossThreadPersistentRegion, persistentRegion, 136 DEFINE_THREAD_SAFE_STATIC_LOCAL(CrossThreadPersistentRegion, persistentRegion,
135 new CrossThreadPersistentRegion()); 137 new CrossThreadPersistentRegion());
136 return persistentRegion; 138 return persistentRegion;
137 } 139 }
138 140
139 bool ProcessHeap::s_shutdownComplete = false; 141 bool ProcessHeap::s_shutdownComplete = false;
142 bool ProcessHeap::s_isLowEndDevice = false;
140 size_t ProcessHeap::s_totalAllocatedSpace = 0; 143 size_t ProcessHeap::s_totalAllocatedSpace = 0;
141 size_t ProcessHeap::s_totalAllocatedObjectSize = 0; 144 size_t ProcessHeap::s_totalAllocatedObjectSize = 0;
142 size_t ProcessHeap::s_totalMarkedObjectSize = 0; 145 size_t ProcessHeap::s_totalMarkedObjectSize = 0;
143 146
144 ThreadHeapStats::ThreadHeapStats() 147 ThreadHeapStats::ThreadHeapStats()
145 : m_allocatedSpace(0), 148 : m_allocatedSpace(0),
146 m_allocatedObjectSize(0), 149 m_allocatedObjectSize(0),
147 m_objectSizeAtLastGC(0), 150 m_objectSizeAtLastGC(0),
148 m_markedObjectSize(0), 151 m_markedObjectSize(0),
149 m_markedObjectSizeAtLastCompleteSweep(0), 152 m_markedObjectSizeAtLastCompleteSweep(0),
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 ProcessHeap::decreaseTotalMarkedObjectSize(m_stats.markedObjectSize()); 644 ProcessHeap::decreaseTotalMarkedObjectSize(m_stats.markedObjectSize());
642 645
643 m_stats.reset(); 646 m_stats.reset();
644 for (ThreadState* state : m_threads) 647 for (ThreadState* state : m_threads)
645 state->resetHeapCounters(); 648 state->resetHeapCounters();
646 } 649 }
647 650
648 ThreadHeap* ThreadHeap::s_mainThreadHeap = nullptr; 651 ThreadHeap* ThreadHeap::s_mainThreadHeap = nullptr;
649 652
650 } // namespace blink 653 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Heap.h ('k') | third_party/WebKit/Source/platform/heap/HeapPage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698