Changeset 141192 in webkit
- Timestamp:
- Jan 29, 2013 5:44:28 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r141190 r141192 1 2013-01-29 Geoffrey Garen <ggaren@apple.com> 2 3 Make precise size classes more precise 4 https://bugs.webkit.org/show_bug.cgi?id=108270 5 6 Reviewed by Mark Hahnenberg. 7 8 Size inference makes this profitable. 9 10 I chose 8 byte increments because JSString is 24 bytes. Otherwise, 16 11 byte increments might be better. 12 13 * heap/Heap.h: 14 (Heap): Removed firstAllocatorWithoutDestructors because it's unused now. 15 16 * heap/MarkedBlock.h: 17 (MarkedBlock): Updated constants. 18 19 * heap/MarkedSpace.h: 20 (MarkedSpace): 21 (JSC): Also reduced the maximum precise size class because my testing 22 has shown that the smaller size classes are much more common. This 23 offsets some of the size class explosion caused by reducing the precise 24 increment. 25 26 * llint/LLIntData.cpp: 27 (JSC::LLInt::Data::performAssertions): No need for this ASSERT anymore 28 because we don't rely on firstAllocatorWithoutDestructors anymore, since 29 we pick size classes dynamically now. 30 1 31 2013-01-29 Oliver Hunt <oliver@apple.com> 2 32 -
trunk/Source/JavaScriptCore/heap/Heap.h
r141179 r141192 114 114 inline bool isBusy(); 115 115 116 MarkedAllocator& firstAllocatorWithoutDestructors() { return m_objectSpace.firstAllocator(); }117 116 MarkedAllocator& allocatorForObjectWithoutDestructor(size_t bytes) { return m_objectSpace.allocatorFor(bytes); } 118 117 MarkedAllocator& allocatorForObjectWithNormalDestructor(size_t bytes) { return m_objectSpace.normalDestructorAllocatorFor(bytes); } -
trunk/Source/JavaScriptCore/heap/MarkedBlock.h
r141179 r141192 71 71 class MarkedBlock : public HeapBlock<MarkedBlock> { 72 72 public: 73 // Ensure natural alignment for native types whilst recognizing that the smallest 74 // object the heap will commonly allocate is four words. 75 static const size_t atomSize = 4 * sizeof(void*); 76 static const size_t atomShift = 5; 73 static const size_t atomSize = 8; // bytes 77 74 static const size_t blockSize = 64 * KB; 78 75 static const size_t blockMask = ~(blockSize - 1); // blockSize must be a power of two. 79 76 80 static const size_t atomsPerBlock = blockSize / atomSize; // ~0.4% overhead77 static const size_t atomsPerBlock = blockSize / atomSize; 81 78 static const size_t atomMask = atomsPerBlock - 1; 82 79 -
trunk/Source/JavaScriptCore/heap/MarkedSpace.h
r131088 r141192 115 115 friend class LLIntOffsetsExtractor; 116 116 117 // [ 32... 512]117 // [ 32... 128 ] 118 118 static const size_t preciseStep = MarkedBlock::atomSize; 119 static const size_t preciseCutoff = 512;119 static const size_t preciseCutoff = 128; 120 120 static const size_t preciseCount = preciseCutoff / preciseStep; 121 121 … … 169 169 Functor functor; 170 170 return forEachDeadCell(functor); 171 }172 173 inline MarkedAllocator& MarkedSpace::firstAllocator()174 {175 return m_normalSpace.preciseAllocators[0];176 171 } 177 172 -
trunk/Source/JavaScriptCore/llint/LLIntData.cpp
r141050 r141192 108 108 ASSERT(ImplementsHasInstance == 2); 109 109 ASSERT(ImplementsDefaultHasInstance == 8); 110 #if USE(JSVALUE64)111 ASSERT(&globalData.heap.allocatorForObjectWithoutDestructor(JSFinalObject::allocationSize(JSFinalObject::defaultInlineCapacity())) - &globalData.heap.firstAllocatorWithoutDestructors() == 1);112 #else113 ASSERT(&globalData.heap.allocatorForObjectWithoutDestructor(JSFinalObject::allocationSize(JSFinalObject::defaultInlineCapacity())) - &globalData.heap.firstAllocatorWithoutDestructors() == 3);114 #endif115 110 ASSERT(FirstConstantRegisterIndex == 0x40000000); 116 111 ASSERT(GlobalCode == 0);
Note: See TracChangeset
for help on using the changeset viewer.