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

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

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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 class PLATFORM_EXPORT ProcessHeap { 117 class PLATFORM_EXPORT ProcessHeap {
118 STATIC_ONLY(ProcessHeap); 118 STATIC_ONLY(ProcessHeap);
119 119
120 public: 120 public:
121 static void init(); 121 static void init();
122 static void shutdown(); 122 static void shutdown();
123 123
124 static CrossThreadPersistentRegion& crossThreadPersistentRegion(); 124 static CrossThreadPersistentRegion& crossThreadPersistentRegion();
125 125
126 static bool isLowEndDevice() { return s_isLowEndDevice; }
126 static void increaseTotalAllocatedObjectSize(size_t delta) { 127 static void increaseTotalAllocatedObjectSize(size_t delta) {
127 atomicAdd(&s_totalAllocatedObjectSize, static_cast<long>(delta)); 128 atomicAdd(&s_totalAllocatedObjectSize, static_cast<long>(delta));
128 } 129 }
129 static void decreaseTotalAllocatedObjectSize(size_t delta) { 130 static void decreaseTotalAllocatedObjectSize(size_t delta) {
130 atomicSubtract(&s_totalAllocatedObjectSize, static_cast<long>(delta)); 131 atomicSubtract(&s_totalAllocatedObjectSize, static_cast<long>(delta));
131 } 132 }
132 static size_t totalAllocatedObjectSize() { 133 static size_t totalAllocatedObjectSize() {
133 return acquireLoad(&s_totalAllocatedObjectSize); 134 return acquireLoad(&s_totalAllocatedObjectSize);
134 } 135 }
135 static void increaseTotalMarkedObjectSize(size_t delta) { 136 static void increaseTotalMarkedObjectSize(size_t delta) {
(...skipping 11 matching lines...) Expand all
147 static void decreaseTotalAllocatedSpace(size_t delta) { 148 static void decreaseTotalAllocatedSpace(size_t delta) {
148 atomicSubtract(&s_totalAllocatedSpace, static_cast<long>(delta)); 149 atomicSubtract(&s_totalAllocatedSpace, static_cast<long>(delta));
149 } 150 }
150 static size_t totalAllocatedSpace() { 151 static size_t totalAllocatedSpace() {
151 return acquireLoad(&s_totalAllocatedSpace); 152 return acquireLoad(&s_totalAllocatedSpace);
152 } 153 }
153 static void resetHeapCounters(); 154 static void resetHeapCounters();
154 155
155 private: 156 private:
156 static bool s_shutdownComplete; 157 static bool s_shutdownComplete;
158 static bool s_isLowEndDevice;
157 static size_t s_totalAllocatedSpace; 159 static size_t s_totalAllocatedSpace;
158 static size_t s_totalAllocatedObjectSize; 160 static size_t s_totalAllocatedObjectSize;
159 static size_t s_totalMarkedObjectSize; 161 static size_t s_totalMarkedObjectSize;
160 162
161 friend class ThreadState; 163 friend class ThreadState;
162 }; 164 };
163 165
164 // Stats for the heap. 166 // Stats for the heap.
165 class ThreadHeapStats { 167 class ThreadHeapStats {
166 USING_FAST_MALLOC(ThreadHeapStats); 168 USING_FAST_MALLOC(ThreadHeapStats);
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 template <typename T> 672 template <typename T>
671 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) { 673 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) {
672 T** cell = reinterpret_cast<T**>(object); 674 T** cell = reinterpret_cast<T**>(object);
673 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) 675 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell))
674 *cell = nullptr; 676 *cell = nullptr;
675 } 677 }
676 678
677 } // namespace blink 679 } // namespace blink
678 680
679 #endif // Heap_h 681 #endif // Heap_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/MemoryCoordinator.cpp ('k') | third_party/WebKit/Source/platform/heap/Heap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698