diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2023-01-26 14:49:59 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-01-27 19:16:38 +0100 |
commit | 879a89fcda914581ea76f6d9786dc5c2e489991b (patch) | |
tree | 427b98bf81cf98450cd45453926ec9bfde74ecc3 /src/qml/memory/qv4mm.cpp | |
parent | 712cdc300a20ee8409aa920e8c30dd1871f5c877 (diff) |
MemoryManager: Remove grayBitmap
We're not using gray items anywhere. There is no need to waste the
memory for the bitmap.
Change-Id: I26983cbc005531184ed955cea6026b9a8c5be910
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/memory/qv4mm.cpp')
-rw-r--r-- | src/qml/memory/qv4mm.cpp | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/src/qml/memory/qv4mm.cpp b/src/qml/memory/qv4mm.cpp index 3add05b95e..a7892e9729 100644 --- a/src/qml/memory/qv4mm.cpp +++ b/src/qml/memory/qv4mm.cpp @@ -24,7 +24,6 @@ #include "qv4profiling_p.h" #include "qv4mapobject_p.h" #include "qv4setobject_p.h" -#include "qv4writebarrier_p.h" //#define MM_STATS @@ -272,9 +271,6 @@ bool Chunk::sweep(ExecutionEngine *engine) HeapItem *o = realBase(); bool lastSlotFree = false; for (uint i = 0; i < Chunk::EntriesInBitmap; ++i) { -#if WRITEBARRIER(none) - Q_ASSERT((grayBitmap[i] | blackBitmap[i]) == blackBitmap[i]); // check that we don't have gray only objects -#endif quintptr toFree = objectBitmap[i] ^ blackBitmap[i]; Q_ASSERT((toFree & objectBitmap[i]) == toFree); // check all black objects are marked as being used quintptr e = extendsBitmap[i]; @@ -318,7 +314,6 @@ bool Chunk::sweep(ExecutionEngine *engine) - (blackBitmap[i] | e)) * Chunk::SlotSize, Profiling::SmallItem); objectBitmap[i] = blackBitmap[i]; - grayBitmap[i] = 0; hasUsedSlots |= (blackBitmap[i] != 0); extendsBitmap[i] = e; lastSlotFree = !((objectBitmap[i]|extendsBitmap[i]) >> (sizeof(quintptr)*8 - 1)); @@ -368,7 +363,6 @@ void Chunk::freeAll(ExecutionEngine *engine) Q_V4_PROFILE_DEALLOC(engine, (qPopulationCount(objectBitmap[i]|extendsBitmap[i]) - qPopulationCount(e)) * Chunk::SlotSize, Profiling::SmallItem); objectBitmap[i] = 0; - grayBitmap[i] = 0; extendsBitmap[i] = e; o += Chunk::Bits; } @@ -380,36 +374,6 @@ void Chunk::resetBlackBits() memset(blackBitmap, 0, sizeof(blackBitmap)); } -void Chunk::collectGrayItems(MarkStack *markStack) -{ - // DEBUG << "sweeping chunk" << this << (*freeList); - HeapItem *o = realBase(); - for (uint i = 0; i < Chunk::EntriesInBitmap; ++i) { -#if WRITEBARRIER(none) - Q_ASSERT((grayBitmap[i] | blackBitmap[i]) == blackBitmap[i]); // check that we don't have gray only objects -#endif - quintptr toMark = blackBitmap[i] & grayBitmap[i]; // correct for a Steele type barrier - Q_ASSERT((toMark & objectBitmap[i]) == toMark); // check all black objects are marked as being used - // DEBUG << hex << " index=" << i << toFree; - while (toMark) { - uint index = qCountTrailingZeroBits(toMark); - quintptr bit = (static_cast<quintptr>(1) << index); - - toMark ^= bit; // mask out marked slot - // DEBUG << " index" << hex << index << toFree; - - HeapItem *itemToFree = o + index; - Heap::Base *b = *itemToFree; - Q_ASSERT(b->inUse()); - markStack->push(b); - } - grayBitmap[i] = 0; - o += Chunk::Bits; - } - // DEBUG << "swept chunk" << this << "freed" << slotsFreed << "slots."; - -} - void Chunk::sortIntoBins(HeapItem **bins, uint nBins) { // qDebug() << "sortIntoBins:"; @@ -622,13 +586,6 @@ void BlockAllocator::resetBlackBits() c->resetBlackBits(); } -void BlockAllocator::collectGrayItems(MarkStack *markStack) -{ - for (auto c : chunks) - c->collectGrayItems(markStack); - -} - HeapItem *HugeItemAllocator::allocate(size_t size) { MemorySegment *m = nullptr; Chunk *c = nullptr; @@ -698,18 +655,6 @@ void HugeItemAllocator::resetBlackBits() Chunk::clearBit(c.chunk->blackBitmap, c.chunk->first() - c.chunk->realBase()); } -void HugeItemAllocator::collectGrayItems(MarkStack *markStack) -{ - for (auto c : chunks) - // Correct for a Steele type barrier - if (Chunk::testBit(c.chunk->blackBitmap, c.chunk->first() - c.chunk->realBase()) && - Chunk::testBit(c.chunk->grayBitmap, c.chunk->first() - c.chunk->realBase())) { - HeapItem *i = c.chunk->first(); - Heap::Base *b = *i; - b->mark(markStack); - } -} - void HugeItemAllocator::freeAll() { for (auto &c : chunks) { |