Title: [141192] trunk/Source/_javascript_Core
- Revision
- 141192
- Author
- [email protected]
- Date
- 2013-01-29 17:44:28 -0800 (Tue, 29 Jan 2013)
Log Message
Make precise size classes more precise
https://bugs.webkit.org/show_bug.cgi?id=108270
Reviewed by Mark Hahnenberg.
Size inference makes this profitable.
I chose 8 byte increments because JSString is 24 bytes. Otherwise, 16
byte increments might be better.
* heap/Heap.h:
(Heap): Removed firstAllocatorWithoutDestructors because it's unused now.
* heap/MarkedBlock.h:
(MarkedBlock): Updated constants.
* heap/MarkedSpace.h:
(MarkedSpace):
(JSC): Also reduced the maximum precise size class because my testing
has shown that the smaller size classes are much more common. This
offsets some of the size class explosion caused by reducing the precise
increment.
* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions): No need for this ASSERT anymore
because we don't rely on firstAllocatorWithoutDestructors anymore, since
we pick size classes dynamically now.
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (141191 => 141192)
--- trunk/Source/_javascript_Core/ChangeLog 2013-01-30 01:38:28 UTC (rev 141191)
+++ trunk/Source/_javascript_Core/ChangeLog 2013-01-30 01:44:28 UTC (rev 141192)
@@ -1,3 +1,33 @@
+2013-01-29 Geoffrey Garen <[email protected]>
+
+ Make precise size classes more precise
+ https://bugs.webkit.org/show_bug.cgi?id=108270
+
+ Reviewed by Mark Hahnenberg.
+
+ Size inference makes this profitable.
+
+ I chose 8 byte increments because JSString is 24 bytes. Otherwise, 16
+ byte increments might be better.
+
+ * heap/Heap.h:
+ (Heap): Removed firstAllocatorWithoutDestructors because it's unused now.
+
+ * heap/MarkedBlock.h:
+ (MarkedBlock): Updated constants.
+
+ * heap/MarkedSpace.h:
+ (MarkedSpace):
+ (JSC): Also reduced the maximum precise size class because my testing
+ has shown that the smaller size classes are much more common. This
+ offsets some of the size class explosion caused by reducing the precise
+ increment.
+
+ * llint/LLIntData.cpp:
+ (JSC::LLInt::Data::performAssertions): No need for this ASSERT anymore
+ because we don't rely on firstAllocatorWithoutDestructors anymore, since
+ we pick size classes dynamically now.
+
2013-01-29 Oliver Hunt <[email protected]>
Add some hardening to methodTable()
Modified: trunk/Source/_javascript_Core/heap/Heap.h (141191 => 141192)
--- trunk/Source/_javascript_Core/heap/Heap.h 2013-01-30 01:38:28 UTC (rev 141191)
+++ trunk/Source/_javascript_Core/heap/Heap.h 2013-01-30 01:44:28 UTC (rev 141192)
@@ -113,7 +113,6 @@
// true if an allocation or collection is in progress
inline bool isBusy();
- MarkedAllocator& firstAllocatorWithoutDestructors() { return m_objectSpace.firstAllocator(); }
MarkedAllocator& allocatorForObjectWithoutDestructor(size_t bytes) { return m_objectSpace.allocatorFor(bytes); }
MarkedAllocator& allocatorForObjectWithNormalDestructor(size_t bytes) { return m_objectSpace.normalDestructorAllocatorFor(bytes); }
MarkedAllocator& allocatorForObjectWithImmortalStructureDestructor(size_t bytes) { return m_objectSpace.immortalStructureDestructorAllocatorFor(bytes); }
Modified: trunk/Source/_javascript_Core/heap/MarkedBlock.h (141191 => 141192)
--- trunk/Source/_javascript_Core/heap/MarkedBlock.h 2013-01-30 01:38:28 UTC (rev 141191)
+++ trunk/Source/_javascript_Core/heap/MarkedBlock.h 2013-01-30 01:44:28 UTC (rev 141192)
@@ -70,14 +70,11 @@
class MarkedBlock : public HeapBlock<MarkedBlock> {
public:
- // Ensure natural alignment for native types whilst recognizing that the smallest
- // object the heap will commonly allocate is four words.
- static const size_t atomSize = 4 * sizeof(void*);
- static const size_t atomShift = 5;
+ static const size_t atomSize = 8; // bytes
static const size_t blockSize = 64 * KB;
static const size_t blockMask = ~(blockSize - 1); // blockSize must be a power of two.
- static const size_t atomsPerBlock = blockSize / atomSize; // ~0.4% overhead
+ static const size_t atomsPerBlock = blockSize / atomSize;
static const size_t atomMask = atomsPerBlock - 1;
struct FreeCell {
Modified: trunk/Source/_javascript_Core/heap/MarkedSpace.h (141191 => 141192)
--- trunk/Source/_javascript_Core/heap/MarkedSpace.h 2013-01-30 01:38:28 UTC (rev 141191)
+++ trunk/Source/_javascript_Core/heap/MarkedSpace.h 2013-01-30 01:44:28 UTC (rev 141192)
@@ -114,9 +114,9 @@
private:
friend class LLIntOffsetsExtractor;
- // [ 32... 512 ]
+ // [ 32... 128 ]
static const size_t preciseStep = MarkedBlock::atomSize;
- static const size_t preciseCutoff = 512;
+ static const size_t preciseCutoff = 128;
static const size_t preciseCount = preciseCutoff / preciseStep;
// [ 1024... blockSize ]
@@ -170,11 +170,6 @@
return forEachDeadCell(functor);
}
-inline MarkedAllocator& MarkedSpace::firstAllocator()
-{
- return m_normalSpace.preciseAllocators[0];
-}
-
inline MarkedAllocator& MarkedSpace::allocatorFor(size_t bytes)
{
ASSERT(bytes);
Modified: trunk/Source/_javascript_Core/llint/LLIntData.cpp (141191 => 141192)
--- trunk/Source/_javascript_Core/llint/LLIntData.cpp 2013-01-30 01:38:28 UTC (rev 141191)
+++ trunk/Source/_javascript_Core/llint/LLIntData.cpp 2013-01-30 01:44:28 UTC (rev 141192)
@@ -107,11 +107,6 @@
ASSERT(MasqueradesAsUndefined == 1);
ASSERT(ImplementsHasInstance == 2);
ASSERT(ImplementsDefaultHasInstance == 8);
-#if USE(JSVALUE64)
- ASSERT(&globalData.heap.allocatorForObjectWithoutDestructor(JSFinalObject::allocationSize(JSFinalObject::defaultInlineCapacity())) - &globalData.heap.firstAllocatorWithoutDestructors() == 1);
-#else
- ASSERT(&globalData.heap.allocatorForObjectWithoutDestructor(JSFinalObject::allocationSize(JSFinalObject::defaultInlineCapacity())) - &globalData.heap.firstAllocatorWithoutDestructors() == 3);
-#endif
ASSERT(FirstConstantRegisterIndex == 0x40000000);
ASSERT(GlobalCode == 0);
ASSERT(EvalCode == 1);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes