Title: [95596] trunk/Source/_javascript_Core
- Revision
- 95596
- Author
- [email protected]
- Date
- 2011-09-20 21:19:36 -0700 (Tue, 20 Sep 2011)
Log Message
Some Heap cleanup.
Reviewed by Beth Dakin.
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::blessNewBlock): Removed blessNewBlockForSlowPath()
because it was unused; renamed blessNewBlockForFastPath() to blessNewBlock()
since there is only one now.
* heap/MarkedBlock.h: Removed ownerSet-related stuff since it was unused.
Updated mark bit overhead calculation. Deployed atomsPerBlock in one
place where we were recalculating it.
* heap/MarkedSpace.cpp:
(JSC::MarkedSpace::addBlock): Updated for rename.
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (95595 => 95596)
--- trunk/Source/_javascript_Core/ChangeLog 2011-09-21 03:37:05 UTC (rev 95595)
+++ trunk/Source/_javascript_Core/ChangeLog 2011-09-21 04:19:36 UTC (rev 95596)
@@ -1,3 +1,21 @@
+2011-09-20 Geoffrey Garen <[email protected]>
+
+ Some Heap cleanup.
+
+ Reviewed by Beth Dakin.
+
+ * heap/MarkedBlock.cpp:
+ (JSC::MarkedBlock::blessNewBlock): Removed blessNewBlockForSlowPath()
+ because it was unused; renamed blessNewBlockForFastPath() to blessNewBlock()
+ since there is only one now.
+
+ * heap/MarkedBlock.h: Removed ownerSet-related stuff since it was unused.
+ Updated mark bit overhead calculation. Deployed atomsPerBlock in one
+ place where we were recalculating it.
+
+ * heap/MarkedSpace.cpp:
+ (JSC::MarkedSpace::addBlock): Updated for rename.
+
2011-09-20 Filip Pizlo <[email protected]>
DFG JIT always speculates integer on modulo
Modified: trunk/Source/_javascript_Core/heap/MarkedBlock.cpp (95595 => 95596)
--- trunk/Source/_javascript_Core/heap/MarkedBlock.cpp 2011-09-21 03:37:05 UTC (rev 95595)
+++ trunk/Source/_javascript_Core/heap/MarkedBlock.cpp 2011-09-21 04:19:36 UTC (rev 95596)
@@ -187,7 +187,7 @@
}
}
-MarkedBlock::FreeCell* MarkedBlock::blessNewBlockForFastPath()
+MarkedBlock::FreeCell* MarkedBlock::blessNewBlock()
{
// This returns a free list that is ordered in reverse through the block,
// as in lazySweep() above.
@@ -210,17 +210,6 @@
return result;
}
-void MarkedBlock::blessNewBlockForSlowPath()
-{
- HEAP_DEBUG_BLOCK(this);
-
- m_marks.clearAll();
- for (size_t i = firstAtom(); i < m_endAtom; i += m_atomsPerCell)
- reinterpret_cast<FreeCell*>(&atoms()[i])->setNoObject();
-
- setDestructorState(FreeCellsDontHaveObjects);
-}
-
void MarkedBlock::canonicalizeBlock(FreeCell* firstFreeCell)
{
HEAP_DEBUG_BLOCK(this);
Modified: trunk/Source/_javascript_Core/heap/MarkedBlock.h (95595 => 95596)
--- trunk/Source/_javascript_Core/heap/MarkedBlock.h 2011-09-21 03:37:05 UTC (rev 95595)
+++ trunk/Source/_javascript_Core/heap/MarkedBlock.h 2011-09-21 04:19:36 UTC (rev 95596)
@@ -65,10 +65,8 @@
// object the heap will commonly allocate is four words.
static const size_t atomSize = 4 * sizeof(void*);
static const size_t blockSize = 16 * KB;
+ static const size_t atomsPerBlock = blockSize / atomSize; // ~0.4% overhead for mark bits.
- static const size_t atomsPerBlock = blockSize / atomSize; // ~1.5% overhead
- static const size_t ownerSetsPerBlock = 8; // ~2% overhead.
-
struct FreeCell {
FreeCell* next;
@@ -112,8 +110,7 @@
// These should be called immediately after a block is created.
// Blessing for fast path creates a linked list, while blessing for
// slow path creates dummy cells.
- FreeCell* blessNewBlockForFastPath();
- void blessNewBlockForSlowPath();
+ FreeCell* blessNewBlock();
void reset();
@@ -150,7 +147,6 @@
Atom* atoms();
size_t atomNumber(const void*);
- size_t ownerSetNumber(const JSCell*);
template<DestructorState destructorState>
void callDestructor(JSCell*, void* jsFinalObjectVPtr);
@@ -176,7 +172,7 @@
size_t m_endAtom; // This is a fuzzy end. Always test for < m_endAtom.
size_t m_atomsPerCell;
- WTF::Bitmap<blockSize / atomSize> m_marks;
+ WTF::Bitmap<atomsPerBlock> m_marks;
bool m_inNewSpace;
int8_t m_destructorState; // use getters/setters for this, particularly since we may want to compact this (effectively log(3)/log(2)-bit) field into other fields
PageAllocationAligned m_allocation;
@@ -305,11 +301,6 @@
}
}
- inline size_t MarkedBlock::ownerSetNumber(const JSCell* cell)
- {
- return (reinterpret_cast<Bits>(cell) - reinterpret_cast<Bits>(this)) * ownerSetsPerBlock / blockSize;
- }
-
} // namespace JSC
namespace WTF {
Modified: trunk/Source/_javascript_Core/heap/MarkedSpace.cpp (95595 => 95596)
--- trunk/Source/_javascript_Core/heap/MarkedSpace.cpp 2011-09-21 03:37:05 UTC (rev 95595)
+++ trunk/Source/_javascript_Core/heap/MarkedSpace.cpp 2011-09-21 04:19:36 UTC (rev 95596)
@@ -50,7 +50,7 @@
ASSERT(!sizeClass.currentBlock);
ASSERT(!sizeClass.firstFreeCell);
sizeClass.currentBlock = block;
- sizeClass.firstFreeCell = block->blessNewBlockForFastPath();
+ sizeClass.firstFreeCell = block->blessNewBlock();
}
void MarkedSpace::removeBlock(MarkedBlock* block)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes