Changeset 183769 in webkit for trunk/Source/JavaScriptCore/heap/WeakBlock.cpp
- Timestamp:
- May 4, 2015, 1:42:10 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/heap/WeakBlock.cpp
r182347 r183769 35 35 namespace JSC { 36 36 37 WeakBlock* WeakBlock::create( )37 WeakBlock* WeakBlock::create(MarkedBlock& markedBlock) 38 38 { 39 return new (NotNull, fastMalloc(blockSize)) WeakBlock( );39 return new (NotNull, fastMalloc(blockSize)) WeakBlock(markedBlock); 40 40 } 41 41 … … 46 46 } 47 47 48 WeakBlock::WeakBlock( )48 WeakBlock::WeakBlock(MarkedBlock& markedBlock) 49 49 : DoublyLinkedListNode<WeakBlock>() 50 , m_markedBlock(&markedBlock) 50 51 { 51 52 for (size_t i = 0; i < weakImplCount(); ++i) { … … 99 100 return; 100 101 102 // If this WeakBlock doesn't belong to a MarkedBlock, we won't even be here. 103 ASSERT(m_markedBlock); 104 105 if (m_markedBlock->isAllocated()) 106 return; 107 101 108 SlotVisitor& visitor = heapRootVisitor.visitor(); 102 109 … … 107 114 108 115 const JSValue& jsValue = weakImpl->jsValue(); 109 if ( Heap::isLive(jsValue.asCell()))116 if (m_markedBlock->isMarkedOrNewlyAllocated(jsValue.asCell())) 110 117 continue; 111 118 … … 127 134 return; 128 135 136 // If this WeakBlock doesn't belong to a MarkedBlock, we won't even be here. 137 ASSERT(m_markedBlock); 138 139 if (m_markedBlock->isAllocated()) 140 return; 141 129 142 for (size_t i = 0; i < weakImplCount(); ++i) { 130 143 WeakImpl* weakImpl = &weakImpls()[i]; … … 132 145 continue; 133 146 134 if ( Heap::isLive(weakImpl->jsValue().asCell())) {147 if (m_markedBlock->isMarkedOrNewlyAllocated(weakImpl->jsValue().asCell())) { 135 148 ASSERT(weakImpl->state() == WeakImpl::Live); 136 149 continue;
Note:
See TracChangeset
for help on using the changeset viewer.