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

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

Issue 2715713005: Verify that a new heap page isn't also marked as being off heap. (Closed)
Patch Set: switch to CHECK() Created 3 years, 9 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 | « no previous file | third_party/WebKit/Source/platform/heap/ThreadState.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef PageMemory_h 5 #ifndef PageMemory_h
6 #define PageMemory_h 6 #define PageMemory_h
7 7
8 #include "platform/heap/HeapPage.h" 8 #include "platform/heap/HeapPage.h"
9 #include "wtf/Allocator.h" 9 #include "wtf/Allocator.h"
10 #include "wtf/Assertions.h" 10 #include "wtf/Assertions.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 USING_FAST_MALLOC(PageMemory); 167 USING_FAST_MALLOC(PageMemory);
168 168
169 public: 169 public:
170 ~PageMemory() { 170 ~PageMemory() {
171 __lsan_unregister_root_region(m_writable.base(), m_writable.size()); 171 __lsan_unregister_root_region(m_writable.base(), m_writable.size());
172 m_reserved->pageDeleted(writableStart()); 172 m_reserved->pageDeleted(writableStart());
173 } 173 }
174 174
175 WARN_UNUSED_RESULT bool commit() { 175 WARN_UNUSED_RESULT bool commit() {
176 m_reserved->markPageUsed(writableStart()); 176 m_reserved->markPageUsed(writableStart());
177 // Check that in-use page isn't also marked as being a non-heap page
178 // by the current heap's negative cache. That cache is invalidated
179 // when allocating new pages, but crbug.com/649485 suggests that
180 // we do get out of sync somehow.
181 //
182 // TODO(sof): consider removing check once bug has been diagnosed
183 // and addressed.
184 CHECK(!ThreadState::current()->isAddressInHeapDoesNotContainCache(
185 writableStart()));
177 return m_writable.commit(); 186 return m_writable.commit();
178 } 187 }
179 188
180 void decommit() { 189 void decommit() {
181 m_reserved->markPageUnused(writableStart()); 190 m_reserved->markPageUnused(writableStart());
182 m_writable.decommit(); 191 m_writable.decommit();
183 } 192 }
184 193
185 void markUnused() { m_reserved->markPageUnused(writableStart()); } 194 void markUnused() { m_reserved->markPageUnused(writableStart()); }
186 195
(...skipping 18 matching lines...) Expand all
205 private: 214 private:
206 PageMemory(PageMemoryRegion* reserved, const MemoryRegion& writable); 215 PageMemory(PageMemoryRegion* reserved, const MemoryRegion& writable);
207 216
208 PageMemoryRegion* m_reserved; 217 PageMemoryRegion* m_reserved;
209 MemoryRegion m_writable; 218 MemoryRegion m_writable;
210 }; 219 };
211 220
212 } // namespace blink 221 } // namespace blink
213 222
214 #endif 223 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/ThreadState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698