Changeset 97294 in webkit for trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
- Timestamp:
- Oct 12, 2011, 1:28:49 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r96463 r97294 1528 1528 void CodeBlock::visitAggregate(SlotVisitor& visitor) 1529 1529 { 1530 bool handleWeakReferences = false;1531 1532 1530 if (!!m_alternative) 1533 1531 m_alternative->visitAggregate(visitor); … … 1581 1579 1582 1580 #if ENABLE(VALUE_PROFILER) 1583 for (unsigned profileIndex = 0; profileIndex < numberOfValueProfiles(); ++profileIndex) { 1584 ValueProfile* profile = valueProfile(profileIndex); 1585 1586 for (unsigned index = 0; index < ValueProfile::numberOfBuckets; ++index) { 1587 if (!profile->m_buckets[index]) { 1588 if (!!profile->m_weakBuckets[index]) 1589 handleWeakReferences = true; 1590 continue; 1591 } 1592 1593 if (!JSValue::decode(profile->m_buckets[index]).isCell()) { 1594 profile->m_weakBuckets[index] = ValueProfile::WeakBucket(); 1595 continue; 1596 } 1597 1598 handleWeakReferences = true; 1599 } 1600 } 1601 #endif 1602 1603 if (handleWeakReferences) 1604 visitor.addWeakReferenceHarvester(this); 1605 } 1606 1607 void CodeBlock::visitWeakReferences(SlotVisitor&) 1608 { 1609 #if ENABLE(VALUE_PROFILER) 1610 for (unsigned profileIndex = 0; profileIndex < numberOfValueProfiles(); ++profileIndex) { 1611 ValueProfile* profile = valueProfile(profileIndex); 1612 1613 for (unsigned index = 0; index < ValueProfile::numberOfBuckets; ++index) { 1614 if (!!profile->m_buckets[index]) { 1615 JSValue value = JSValue::decode(profile->m_buckets[index]); 1616 if (!value.isCell()) 1617 continue; 1618 1619 JSCell* cell = value.asCell(); 1620 if (Heap::isMarked(cell)) 1621 continue; 1622 1623 profile->m_buckets[index] = JSValue::encode(JSValue()); 1624 profile->m_weakBuckets[index] = cell->structure(); 1625 } 1626 1627 ValueProfile::WeakBucket weak = profile->m_weakBuckets[index]; 1628 if (!weak || weak.isClassInfo()) 1629 continue; 1630 1631 ASSERT(weak.isStructure()); 1632 if (Heap::isMarked(weak.asStructure())) 1633 continue; 1634 1635 profile->m_weakBuckets[index] = weak.asStructure()->classInfo(); 1636 } 1637 } 1581 for (unsigned profileIndex = 0; profileIndex < numberOfValueProfiles(); ++profileIndex) 1582 valueProfile(profileIndex)->computeUpdatedPrediction(); 1638 1583 #endif 1639 1584 }
Note:
See TracChangeset
for help on using the changeset viewer.