| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project 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 // Review notes: | 5 // Review notes: |
| 6 // | 6 // |
| 7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
| 8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
| 9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
| 10 // | 10 // |
| (...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1622 Object* array = READ_FIELD(this, kElementsOffset); | 1622 Object* array = READ_FIELD(this, kElementsOffset); |
| 1623 return static_cast<FixedArrayBase*>(array); | 1623 return static_cast<FixedArrayBase*>(array); |
| 1624 } | 1624 } |
| 1625 | 1625 |
| 1626 | 1626 |
| 1627 void AllocationSite::Initialize() { | 1627 void AllocationSite::Initialize() { |
| 1628 set_transition_info(Smi::FromInt(0)); | 1628 set_transition_info(Smi::FromInt(0)); |
| 1629 SetElementsKind(GetInitialFastElementsKind()); | 1629 SetElementsKind(GetInitialFastElementsKind()); |
| 1630 set_nested_site(Smi::FromInt(0)); | 1630 set_nested_site(Smi::FromInt(0)); |
| 1631 set_pretenure_data(0); | 1631 set_pretenure_data(0); |
| 1632 set_pretenure_create_count(0); | |
| 1633 set_dependent_code(DependentCode::cast(GetHeap()->empty_fixed_array()), | 1632 set_dependent_code(DependentCode::cast(GetHeap()->empty_fixed_array()), |
| 1634 SKIP_WRITE_BARRIER); | 1633 SKIP_WRITE_BARRIER); |
| 1635 } | 1634 } |
| 1636 | 1635 |
| 1637 | 1636 |
| 1638 bool AllocationSite::IsZombie() { return pretenure_decision() == kZombie; } | 1637 bool AllocationSite::IsZombie() { return pretenure_decision() == kZombie; } |
| 1639 | 1638 |
| 1640 | 1639 |
| 1641 bool AllocationSite::IsMaybeTenure() { | 1640 bool AllocationSite::IsMaybeTenure() { |
| 1642 return pretenure_decision() == kMaybeTenure; | 1641 return pretenure_decision() == kMaybeTenure; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1740 return DeoptDependentCodeBit::decode(value); | 1739 return DeoptDependentCodeBit::decode(value); |
| 1741 } | 1740 } |
| 1742 | 1741 |
| 1743 | 1742 |
| 1744 void AllocationSite::set_deopt_dependent_code(bool deopt) { | 1743 void AllocationSite::set_deopt_dependent_code(bool deopt) { |
| 1745 int value = pretenure_data(); | 1744 int value = pretenure_data(); |
| 1746 set_pretenure_data(DeoptDependentCodeBit::update(value, deopt)); | 1745 set_pretenure_data(DeoptDependentCodeBit::update(value, deopt)); |
| 1747 } | 1746 } |
| 1748 | 1747 |
| 1749 | 1748 |
| 1750 int AllocationSite::memento_create_count() { return pretenure_create_count(); } | 1749 int AllocationSite::memento_create_count() { |
| 1750 int value = pretenure_data(); |
| 1751 return MementoCreatedCountBits::decode(value); |
| 1752 } |
| 1751 | 1753 |
| 1752 | 1754 |
| 1753 void AllocationSite::set_memento_create_count(int count) { | 1755 void AllocationSite::set_memento_create_count(int count) { |
| 1754 set_pretenure_create_count(count); | 1756 int value = pretenure_data(); |
| 1757 set_pretenure_data(MementoCreatedCountBits::update(value, count)); |
| 1755 } | 1758 } |
| 1756 | 1759 |
| 1757 | 1760 |
| 1758 inline void AllocationSite::IncrementMementoCreateCount() { | 1761 inline void AllocationSite::IncrementMementoCreateCount() { |
| 1759 DCHECK(FLAG_allocation_site_pretenuring); | 1762 DCHECK(FLAG_allocation_site_pretenuring); |
| 1760 int value = memento_create_count(); | 1763 int value = memento_create_count(); |
| 1761 set_memento_create_count(value + 1); | 1764 set_memento_create_count(value + 1); |
| 1762 } | 1765 } |
| 1763 | 1766 |
| 1764 | 1767 |
| (...skipping 3758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5523 kAccessCheckInfoOffset) | 5526 kAccessCheckInfoOffset) |
| 5524 SMI_ACCESSORS(FunctionTemplateInfo, flag, kFlagOffset) | 5527 SMI_ACCESSORS(FunctionTemplateInfo, flag, kFlagOffset) |
| 5525 | 5528 |
| 5526 ACCESSORS(ObjectTemplateInfo, constructor, Object, kConstructorOffset) | 5529 ACCESSORS(ObjectTemplateInfo, constructor, Object, kConstructorOffset) |
| 5527 ACCESSORS(ObjectTemplateInfo, internal_field_count, Object, | 5530 ACCESSORS(ObjectTemplateInfo, internal_field_count, Object, |
| 5528 kInternalFieldCountOffset) | 5531 kInternalFieldCountOffset) |
| 5529 | 5532 |
| 5530 ACCESSORS(AllocationSite, transition_info, Object, kTransitionInfoOffset) | 5533 ACCESSORS(AllocationSite, transition_info, Object, kTransitionInfoOffset) |
| 5531 ACCESSORS(AllocationSite, nested_site, Object, kNestedSiteOffset) | 5534 ACCESSORS(AllocationSite, nested_site, Object, kNestedSiteOffset) |
| 5532 SMI_ACCESSORS(AllocationSite, pretenure_data, kPretenureDataOffset) | 5535 SMI_ACCESSORS(AllocationSite, pretenure_data, kPretenureDataOffset) |
| 5533 SMI_ACCESSORS(AllocationSite, pretenure_create_count, | |
| 5534 kPretenureCreateCountOffset) | |
| 5535 ACCESSORS(AllocationSite, dependent_code, DependentCode, | 5536 ACCESSORS(AllocationSite, dependent_code, DependentCode, |
| 5536 kDependentCodeOffset) | 5537 kDependentCodeOffset) |
| 5537 ACCESSORS(AllocationSite, weak_next, Object, kWeakNextOffset) | 5538 ACCESSORS(AllocationSite, weak_next, Object, kWeakNextOffset) |
| 5538 ACCESSORS(AllocationMemento, allocation_site, Object, kAllocationSiteOffset) | 5539 ACCESSORS(AllocationMemento, allocation_site, Object, kAllocationSiteOffset) |
| 5539 | 5540 |
| 5540 ACCESSORS(Script, source, Object, kSourceOffset) | 5541 ACCESSORS(Script, source, Object, kSourceOffset) |
| 5541 ACCESSORS(Script, name, Object, kNameOffset) | 5542 ACCESSORS(Script, name, Object, kNameOffset) |
| 5542 SMI_ACCESSORS(Script, id, kIdOffset) | 5543 SMI_ACCESSORS(Script, id, kIdOffset) |
| 5543 SMI_ACCESSORS(Script, line_offset, kLineOffsetOffset) | 5544 SMI_ACCESSORS(Script, line_offset, kLineOffsetOffset) |
| 5544 SMI_ACCESSORS(Script, column_offset, kColumnOffsetOffset) | 5545 SMI_ACCESSORS(Script, column_offset, kColumnOffsetOffset) |
| (...skipping 2224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7769 #undef WRITE_INT64_FIELD | 7770 #undef WRITE_INT64_FIELD |
| 7770 #undef READ_BYTE_FIELD | 7771 #undef READ_BYTE_FIELD |
| 7771 #undef WRITE_BYTE_FIELD | 7772 #undef WRITE_BYTE_FIELD |
| 7772 #undef NOBARRIER_READ_BYTE_FIELD | 7773 #undef NOBARRIER_READ_BYTE_FIELD |
| 7773 #undef NOBARRIER_WRITE_BYTE_FIELD | 7774 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7774 | 7775 |
| 7775 } // namespace internal | 7776 } // namespace internal |
| 7776 } // namespace v8 | 7777 } // namespace v8 |
| 7777 | 7778 |
| 7778 #endif // V8_OBJECTS_INL_H_ | 7779 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |