Changeset 82874 in webkit
- Timestamp:
- Apr 4, 2011 2:29:56 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r82872 r82874 1 2011-04-04 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 Standardized handling of handles for immediate values 6 https://bugs.webkit.org/show_bug.cgi?id=57788 7 8 * collector/handles/HandleHeap.cpp: 9 (JSC::HandleHeap::clearWeakPointers): Don't check for null or non-cell 10 values here, because our write barrier guarantees that such values are 11 not in the weak list. 12 13 (JSC::HandleHeap::writeBarrier): Standardized on checking for null before 14 checking for cell, and on using early return instead of if/else. 15 16 * collector/handles/HandleHeap.h: 17 (JSC::HandleHeap::deallocate): 18 (JSC::HandleHeap::makeWeak): Ditto. 19 1 20 2011-04-04 Geoffrey Garen <ggaren@apple.com> 2 21 -
trunk/Source/JavaScriptCore/collector/handles/HandleHeap.cpp
r82871 r82874 68 68 69 69 JSValue value = *node->slot(); 70 if (!value || !value.isCell()) 71 continue; 72 70 ASSERT(value); 71 73 72 JSCell* cell = value.asCell(); 74 ASSERT(!cell || cell->structure()); 75 73 ASSERT(cell && cell->structure()); 76 74 #if ENABLE(JSC_ZOMBIES) 77 75 ASSERT(!cell->isZombie()); 78 76 #endif 77 79 78 if (Heap::isMarked(cell)) 80 79 continue; … … 98 97 ASSERT(!m_nextToFinalize); // Forbid assignment to handles during the finalization phase, since it would violate many GC invariants. 99 98 100 if ( slot->isCell() == value.isCell() && !value == !*slot)99 if (!value == !*slot && slot->isCell() == value.isCell()) 101 100 return; 101 102 102 Node* node = toNode(slot); 103 103 SentinelLinkedList<Node>::remove(node); 104 if (!value .isCell() || !value) {104 if (!value || !value.isCell()) { 105 105 m_immediateList.push(node); 106 106 return; 107 107 } 108 if (node->isWeak()) 108 109 if (node->isWeak()) { 109 110 m_weakList.push(node); 110 else 111 m_strongList.push(node); 111 return; 112 } 113 114 m_strongList.push(node); 112 115 } 113 116 -
trunk/Source/JavaScriptCore/collector/handles/HandleHeap.h
r82872 r82874 146 146 { 147 147 Node* node = toNode(handle); 148 if ( m_nextToFinalize == node) {148 if (node == m_nextToFinalize) { 149 149 m_nextToFinalize = node->next(); 150 150 ASSERT(m_nextToFinalize->next()); 151 151 } 152 152 153 SentinelLinkedList<Node>::remove(node); 153 154 m_freeList.push(node); … … 157 158 { 158 159 Node* node = toNode(handle); 160 node->makeWeak(weakOwner, context); 161 159 162 SentinelLinkedList<Node>::remove(node); 160 node->makeWeak(weakOwner, context); 161 if (handle->isCell() && *handle) 162 m_weakList.push(node); 163 else 163 if (!*handle || !handle->isCell()) { 164 164 m_immediateList.push(node); 165 return; 166 } 167 168 m_weakList.push(node); 165 169 } 166 170
Note: See TracChangeset
for help on using the changeset viewer.