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

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

Issue 2640163004: Replace ENABLE(ASSERT) with DCHECK_IS_ON(). (Closed)
Patch Set: Created 3 years, 11 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "platform/heap/HeapCompact.h" 5 #include "platform/heap/HeapCompact.h"
6 6
7 #include "platform/Histogram.h" 7 #include "platform/Histogram.h"
8 #include "platform/RuntimeEnabledFeatures.h" 8 #include "platform/RuntimeEnabledFeatures.h"
9 #include "platform/heap/Heap.h" 9 #include "platform/heap/Heap.h"
10 #include "platform/heap/SparseHeapBitmap.h" 10 #include "platform/heap/SparseHeapBitmap.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // Note: |slot| will reside outside the Oilpan heap if it is a 80 // Note: |slot| will reside outside the Oilpan heap if it is a
81 // PersistentHeapCollectionBase. Hence pageFromObject() cannot be 81 // PersistentHeapCollectionBase. Hence pageFromObject() cannot be
82 // used, as it sanity checks the |BasePage| it returns. Simply 82 // used, as it sanity checks the |BasePage| it returns. Simply
83 // derive the raw BasePage address here and check if it is a member 83 // derive the raw BasePage address here and check if it is a member
84 // of the compactable and relocatable page address set. 84 // of the compactable and relocatable page address set.
85 Address slotAddress = reinterpret_cast<Address>(slot); 85 Address slotAddress = reinterpret_cast<Address>(slot);
86 BasePage* slotPage = reinterpret_cast<BasePage*>( 86 BasePage* slotPage = reinterpret_cast<BasePage*>(
87 blinkPageAddress(slotAddress) + blinkGuardPageSize); 87 blinkPageAddress(slotAddress) + blinkGuardPageSize);
88 if (LIKELY(!m_relocatablePages.contains(slotPage))) 88 if (LIKELY(!m_relocatablePages.contains(slotPage)))
89 return; 89 return;
90 #if ENABLE(ASSERT) 90 #if DCHECK_IS_ON()
91 DCHECK(slotPage->contains(slotAddress)); 91 DCHECK(slotPage->contains(slotAddress));
92 #endif 92 #endif
93 // Unlikely case, the slot resides on a compacting arena's page. 93 // Unlikely case, the slot resides on a compacting arena's page.
94 // => It is an 'interior slot' (interior to a movable backing store.) 94 // => It is an 'interior slot' (interior to a movable backing store.)
95 // Record it as an interior slot, which entails: 95 // Record it as an interior slot, which entails:
96 // 96 //
97 // - Storing it in the interior map, which maps the slot to 97 // - Storing it in the interior map, which maps the slot to
98 // its (eventual) location. Initially nullptr. 98 // its (eventual) location. Initially nullptr.
99 // - Mark it as being interior pointer within the page's 99 // - Mark it as being interior pointer within the page's
100 // "interior" bitmap. This bitmap is used when moving a backing 100 // "interior" bitmap. This bitmap is used when moving a backing
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 fixups().addCompactingPage(page); 458 fixups().addCompactingPage(page);
459 } 459 }
460 460
461 bool HeapCompact::scheduleCompactionGCForTesting(bool value) { 461 bool HeapCompact::scheduleCompactionGCForTesting(bool value) {
462 bool current = s_forceCompactionGC; 462 bool current = s_forceCompactionGC;
463 s_forceCompactionGC = value; 463 s_forceCompactionGC = value;
464 return current; 464 return current;
465 } 465 }
466 466
467 } // namespace blink 467 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698