Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include "platform/heap/PersistentNode.h" | 5 #include "platform/heap/PersistentNode.h" |
| 6 | 6 |
| 7 #include "base/debug/alias.h" | 7 #include "base/debug/alias.h" |
| 8 #include "platform/heap/Handle.h" | 8 #include "platform/heap/Handle.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 } | 27 } |
| 28 | 28 |
| 29 int PersistentRegion::numberOfPersistents() { | 29 int PersistentRegion::numberOfPersistents() { |
| 30 int persistentCount = 0; | 30 int persistentCount = 0; |
| 31 for (PersistentNodeSlots* slots = m_slots; slots; slots = slots->m_next) { | 31 for (PersistentNodeSlots* slots = m_slots; slots; slots = slots->m_next) { |
| 32 for (int i = 0; i < PersistentNodeSlots::slotCount; ++i) { | 32 for (int i = 0; i < PersistentNodeSlots::slotCount; ++i) { |
| 33 if (!slots->m_slot[i].isUnused()) | 33 if (!slots->m_slot[i].isUnused()) |
| 34 ++persistentCount; | 34 ++persistentCount; |
| 35 } | 35 } |
| 36 } | 36 } |
| 37 ASSERT(persistentCount == m_persistentCount); | 37 #if DCHECK_IS_ON() |
| 38 DCHECK(persistentCount == m_persistentCount); | |
|
Yuta Kitamura
2016/11/21 09:26:12
Use DCHECK_EQ.
Alexander Alekseev
2016/11/23 09:20:30
Done.
| |
| 39 #endif | |
| 38 return persistentCount; | 40 return persistentCount; |
| 39 } | 41 } |
| 40 | 42 |
| 41 void PersistentRegion::ensurePersistentNodeSlots(void* self, | 43 void PersistentRegion::ensurePersistentNodeSlots(void* self, |
| 42 TraceCallback trace) { | 44 TraceCallback trace) { |
| 43 ASSERT(!m_freeListHead); | 45 ASSERT(!m_freeListHead); |
| 44 PersistentNodeSlots* slots = new PersistentNodeSlots; | 46 PersistentNodeSlots* slots = new PersistentNodeSlots; |
| 45 for (int i = 0; i < PersistentNodeSlots::slotCount; ++i) { | 47 for (int i = 0; i < PersistentNodeSlots::slotCount; ++i) { |
| 46 PersistentNode* node = &slots->m_slot[i]; | 48 PersistentNode* node = &slots->m_slot[i]; |
| 47 node->setFreeListNext(m_freeListHead); | 49 node->setFreeListNext(m_freeListHead); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 191 } | 193 } |
| 192 } | 194 } |
| 193 } | 195 } |
| 194 #if DCHECK_IS_ON() | 196 #if DCHECK_IS_ON() |
| 195 DCHECK_EQ(persistentCount, m_persistentRegion->m_persistentCount); | 197 DCHECK_EQ(persistentCount, m_persistentRegion->m_persistentCount); |
| 196 #endif | 198 #endif |
| 197 } | 199 } |
| 198 #endif | 200 #endif |
| 199 | 201 |
| 200 } // namespace blink | 202 } // namespace blink |
| OLD | NEW |