| 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/GCInfo.h" | 5 #include "platform/heap/GCInfo.h" |
| 6 | 6 |
| 7 #include "platform/heap/Handle.h" | 7 #include "platform/heap/Handle.h" |
| 8 #include "platform/heap/Heap.h" | 8 #include "platform/heap/Heap.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 void GCInfoTable::init() { | 60 void GCInfoTable::init() { |
| 61 RELEASE_ASSERT(!s_gcInfoTable); | 61 RELEASE_ASSERT(!s_gcInfoTable); |
| 62 resize(); | 62 resize(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void GCInfoTable::shutdown() { | 65 void GCInfoTable::shutdown() { |
| 66 WTF::Partitions::fastFree(s_gcInfoTable); | 66 WTF::Partitions::fastFree(s_gcInfoTable); |
| 67 s_gcInfoTable = nullptr; | 67 s_gcInfoTable = nullptr; |
| 68 } | 68 } |
| 69 | 69 |
| 70 #if ENABLE(ASSERT) | 70 #if DCHECK_IS_ON() |
| 71 void assertObjectHasGCInfo(const void* payload, size_t gcInfoIndex) { | 71 void assertObjectHasGCInfo(const void* payload, size_t gcInfoIndex) { |
| 72 ASSERT(HeapObjectHeader::fromPayload(payload)->checkHeader()); | 72 ASSERT(HeapObjectHeader::fromPayload(payload)->checkHeader()); |
| 73 #if !defined(COMPONENT_BUILD) | 73 #if !defined(COMPONENT_BUILD) |
| 74 // On component builds we cannot compare the gcInfos as they are statically | 74 // On component builds we cannot compare the gcInfos as they are statically |
| 75 // defined in each of the components and hence will not match. | 75 // defined in each of the components and hence will not match. |
| 76 BasePage* page = pageFromObject(payload); | 76 BasePage* page = pageFromObject(payload); |
| 77 ASSERT(!page->orphaned()); | 77 ASSERT(!page->orphaned()); |
| 78 ASSERT(HeapObjectHeader::fromPayload(payload)->gcInfoIndex() == gcInfoIndex); | 78 ASSERT(HeapObjectHeader::fromPayload(payload)->gcInfoIndex() == gcInfoIndex); |
| 79 #endif | 79 #endif |
| 80 } | 80 } |
| 81 #endif | 81 #endif |
| 82 | 82 |
| 83 } // namespace blink | 83 } // namespace blink |
| OLD | NEW |