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 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1645 inline bool AllocationSite::CanTrack(InstanceType type) { | 1645 inline bool AllocationSite::CanTrack(InstanceType type) { |
1646 if (FLAG_allocation_site_pretenuring) { | 1646 if (FLAG_allocation_site_pretenuring) { |
1647 return type == JS_ARRAY_TYPE || | 1647 return type == JS_ARRAY_TYPE || |
1648 type == JS_OBJECT_TYPE || | 1648 type == JS_OBJECT_TYPE || |
1649 type < FIRST_NONSTRING_TYPE; | 1649 type < FIRST_NONSTRING_TYPE; |
1650 } | 1650 } |
1651 return type == JS_ARRAY_TYPE; | 1651 return type == JS_ARRAY_TYPE; |
1652 } | 1652 } |
1653 | 1653 |
1654 | 1654 |
1655 inline DependentCode::DependencyGroup AllocationSite::ToDependencyGroup( | |
1656 Reason reason) { | |
1657 switch (reason) { | |
1658 case TENURING: | |
1659 return DependentCode::kAllocationSiteTenuringChangedGroup; | |
1660 break; | |
1661 case TRANSITIONS: | |
1662 return DependentCode::kAllocationSiteTransitionChangedGroup; | |
1663 break; | |
1664 } | |
1665 UNREACHABLE(); | |
1666 return DependentCode::kAllocationSiteTransitionChangedGroup; | |
1667 } | |
1668 | |
1669 | |
1670 inline void AllocationSite::set_memento_found_count(int count) { | 1655 inline void AllocationSite::set_memento_found_count(int count) { |
1671 int value = pretenure_data()->value(); | 1656 int value = pretenure_data()->value(); |
1672 // Verify that we can count more mementos than we can possibly find in one | 1657 // Verify that we can count more mementos than we can possibly find in one |
1673 // new space collection. | 1658 // new space collection. |
1674 DCHECK((GetHeap()->MaxSemiSpaceSize() / | 1659 DCHECK((GetHeap()->MaxSemiSpaceSize() / |
1675 (StaticVisitorBase::kMinObjectSizeInWords * kPointerSize + | 1660 (StaticVisitorBase::kMinObjectSizeInWords * kPointerSize + |
1676 AllocationMemento::kSize)) < MementoFoundCountBits::kMax); | 1661 AllocationMemento::kSize)) < MementoFoundCountBits::kMax); |
1677 DCHECK(count < MementoFoundCountBits::kMax); | 1662 DCHECK(count < MementoFoundCountBits::kMax); |
1678 set_pretenure_data( | 1663 set_pretenure_data( |
1679 Smi::FromInt(MementoFoundCountBits::update(value, count)), | 1664 Smi::FromInt(MementoFoundCountBits::update(value, count)), |
(...skipping 5748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7428 #undef READ_SHORT_FIELD | 7413 #undef READ_SHORT_FIELD |
7429 #undef WRITE_SHORT_FIELD | 7414 #undef WRITE_SHORT_FIELD |
7430 #undef READ_BYTE_FIELD | 7415 #undef READ_BYTE_FIELD |
7431 #undef WRITE_BYTE_FIELD | 7416 #undef WRITE_BYTE_FIELD |
7432 #undef NOBARRIER_READ_BYTE_FIELD | 7417 #undef NOBARRIER_READ_BYTE_FIELD |
7433 #undef NOBARRIER_WRITE_BYTE_FIELD | 7418 #undef NOBARRIER_WRITE_BYTE_FIELD |
7434 | 7419 |
7435 } } // namespace v8::internal | 7420 } } // namespace v8::internal |
7436 | 7421 |
7437 #endif // V8_OBJECTS_INL_H_ | 7422 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |