Changeset 222384 in webkit for trunk/Source/JavaScriptCore/bytecode/ArrayAllocationProfile.h
- Timestamp:
- Sep 22, 2017, 5:19:54 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecode/ArrayAllocationProfile.h
r222382 r222384 33 33 class ArrayAllocationProfile { 34 34 public: 35 ArrayAllocationProfile()36 : m_currentIndexingType(ArrayWithUndecided)37 , m_lastArray(0)38 {39 }40 41 35 IndexingType selectIndexingType() 42 36 { 43 37 JSArray* lastArray = m_lastArray; 44 38 if (lastArray && UNLIKELY(lastArray->indexingType() != m_currentIndexingType)) 45 update IndexingType();39 updateProfile(); 46 40 return m_currentIndexingType; 41 } 42 43 // vector length hint becomes [0, BASE_CONTIGUOUS_VECTOR_LEN_MAX]. 44 unsigned vectorLengthHint() 45 { 46 JSArray* lastArray = m_lastArray; 47 if (lastArray && (m_largestSeenVectorLength != BASE_CONTIGUOUS_VECTOR_LEN_MAX) && UNLIKELY(lastArray->getVectorLength() > m_largestSeenVectorLength)) 48 updateProfile(); 49 return m_largestSeenVectorLength; 47 50 } 48 51 … … 53 56 } 54 57 55 JS_EXPORT_PRIVATE void update IndexingType();58 JS_EXPORT_PRIVATE void updateProfile(); 56 59 57 60 static IndexingType selectIndexingTypeFor(ArrayAllocationProfile* profile) … … 71 74 private: 72 75 73 IndexingType m_currentIndexingType; 74 JSArray* m_lastArray; 76 IndexingType m_currentIndexingType { ArrayWithUndecided }; 77 unsigned m_largestSeenVectorLength { 0 }; 78 JSArray* m_lastArray { nullptr }; 75 79 }; 76 80
Note:
See TracChangeset
for help on using the changeset viewer.