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 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1742 // for a constructed array. Otherwise, it must be a boilerplate | 1742 // for a constructed array. Otherwise, it must be a boilerplate |
1743 // for an object or array literal. | 1743 // for an object or array literal. |
1744 return transition_info()->IsJSArray() || transition_info()->IsJSObject(); | 1744 return transition_info()->IsJSArray() || transition_info()->IsJSObject(); |
1745 } | 1745 } |
1746 | 1746 |
1747 | 1747 |
1748 // Heuristic: We only need to create allocation site info if the boilerplate | 1748 // Heuristic: We only need to create allocation site info if the boilerplate |
1749 // elements kind is the initial elements kind. | 1749 // elements kind is the initial elements kind. |
1750 AllocationSiteMode AllocationSite::GetMode( | 1750 AllocationSiteMode AllocationSite::GetMode( |
1751 ElementsKind boilerplate_elements_kind) { | 1751 ElementsKind boilerplate_elements_kind) { |
1752 if (FLAG_pretenuring_call_new || | 1752 if (IsFastSmiElementsKind(boilerplate_elements_kind)) { |
1753 IsFastSmiElementsKind(boilerplate_elements_kind)) { | |
1754 return TRACK_ALLOCATION_SITE; | 1753 return TRACK_ALLOCATION_SITE; |
1755 } | 1754 } |
1756 | 1755 |
1757 return DONT_TRACK_ALLOCATION_SITE; | 1756 return DONT_TRACK_ALLOCATION_SITE; |
1758 } | 1757 } |
1759 | 1758 |
1760 | 1759 |
1761 AllocationSiteMode AllocationSite::GetMode(ElementsKind from, | 1760 AllocationSiteMode AllocationSite::GetMode(ElementsKind from, |
1762 ElementsKind to) { | 1761 ElementsKind to) { |
1763 if (FLAG_pretenuring_call_new || | 1762 if (IsFastSmiElementsKind(from) && |
1764 (IsFastSmiElementsKind(from) && | 1763 IsMoreGeneralElementsKindTransition(from, to)) { |
1765 IsMoreGeneralElementsKindTransition(from, to))) { | |
1766 return TRACK_ALLOCATION_SITE; | 1764 return TRACK_ALLOCATION_SITE; |
1767 } | 1765 } |
1768 | 1766 |
1769 return DONT_TRACK_ALLOCATION_SITE; | 1767 return DONT_TRACK_ALLOCATION_SITE; |
1770 } | 1768 } |
1771 | 1769 |
1772 | 1770 |
1773 inline bool AllocationSite::CanTrack(InstanceType type) { | 1771 inline bool AllocationSite::CanTrack(InstanceType type) { |
1774 if (FLAG_allocation_site_pretenuring) { | 1772 if (FLAG_allocation_site_pretenuring) { |
1775 return type == JS_ARRAY_TYPE || | 1773 return type == JS_ARRAY_TYPE || |
(...skipping 6141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7917 #undef READ_INT64_FIELD | 7915 #undef READ_INT64_FIELD |
7918 #undef WRITE_INT64_FIELD | 7916 #undef WRITE_INT64_FIELD |
7919 #undef READ_BYTE_FIELD | 7917 #undef READ_BYTE_FIELD |
7920 #undef WRITE_BYTE_FIELD | 7918 #undef WRITE_BYTE_FIELD |
7921 #undef NOBARRIER_READ_BYTE_FIELD | 7919 #undef NOBARRIER_READ_BYTE_FIELD |
7922 #undef NOBARRIER_WRITE_BYTE_FIELD | 7920 #undef NOBARRIER_WRITE_BYTE_FIELD |
7923 | 7921 |
7924 } } // namespace v8::internal | 7922 } } // namespace v8::internal |
7925 | 7923 |
7926 #endif // V8_OBJECTS_INL_H_ | 7924 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |