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.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95596
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-09-20 Geoffrey Garen <ggaren@apple.com>
+
+ 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 <fpizlo@apple.com>
DFG JIT always speculates integer on modulo
}
}
-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.
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);
// 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; // ~1.5% overhead
- static const size_t ownerSetsPerBlock = 8; // ~2% overhead.
+ static const size_t atomsPerBlock = blockSize / atomSize; // ~0.4% overhead for mark bits.
struct FreeCell {
FreeCell* next;
// 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();
Atom* atoms();
size_t atomNumber(const void*);
- size_t ownerSetNumber(const JSCell*);
template<DestructorState destructorState>
void callDestructor(JSCell*, void* jsFinalObjectVPtr);
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;
}
}
- inline size_t MarkedBlock::ownerSetNumber(const JSCell* cell)
- {
- return (reinterpret_cast<Bits>(cell) - reinterpret_cast<Bits>(this)) * ownerSetsPerBlock / blockSize;
- }
-
} // namespace JSC
namespace WTF {
ASSERT(!sizeClass.currentBlock);
ASSERT(!sizeClass.firstFreeCell);
sizeClass.currentBlock = block;
- sizeClass.firstFreeCell = block->blessNewBlockForFastPath();
+ sizeClass.firstFreeCell = block->blessNewBlock();
}
void MarkedSpace::removeBlock(MarkedBlock* block)