summaryrefslogtreecommitdiffstats
path: root/js/src/gc/Nursery.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2017-06-26 19:53:53 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-02-03 15:06:40 +0100
commit867bfbd87902a68680286ee9c52d882d854b90d3 (patch)
treeecf8a8e6b156405aafc6bbef5eef4209130aaa4a /js/src/gc/Nursery.cpp
parent1e1fb5ea2504e548bc17521bdb273c9e59b9cf01 (diff)
downloadUXP-867bfbd87902a68680286ee9c52d882d854b90d3.tar
UXP-867bfbd87902a68680286ee9c52d882d854b90d3.tar.gz
UXP-867bfbd87902a68680286ee9c52d882d854b90d3.tar.lz
UXP-867bfbd87902a68680286ee9c52d882d854b90d3.tar.xz
UXP-867bfbd87902a68680286ee9c52d882d854b90d3.zip
Remove GCZeal: Base cleanup
UXP repo issue #8
Diffstat (limited to 'js/src/gc/Nursery.cpp')
-rw-r--r--js/src/gc/Nursery.cpp82
1 files changed, 0 insertions, 82 deletions
diff --git a/js/src/gc/Nursery.cpp b/js/src/gc/Nursery.cpp
index 2c402fe0b..d37c1673b 100644
--- a/js/src/gc/Nursery.cpp
+++ b/js/src/gc/Nursery.cpp
@@ -74,14 +74,6 @@ struct js::Nursery::SweepAction
#endif
};
-#ifdef JS_GC_ZEAL
-struct js::Nursery::Canary
-{
- uintptr_t magicValue;
- Canary* next;
-};
-#endif
-
inline void
js::Nursery::NurseryChunk::poisonAndInit(JSRuntime* rt, uint8_t poison)
{
@@ -124,9 +116,6 @@ js::Nursery::Nursery(JSRuntime* rt)
, minorGcCount_(0)
, freeMallocedBuffersTask(nullptr)
, sweepActions_(nullptr)
-#ifdef JS_GC_ZEAL
- , lastCanary_(nullptr)
-#endif
{}
bool
@@ -209,10 +198,6 @@ js::Nursery::enable()
setCurrentChunk(0);
setStartPosition();
-#ifdef JS_GC_ZEAL
- if (runtime()->hasZealMode(ZealMode::GenerationalGC))
- enterZealMode();
-#endif
MOZ_ALWAYS_TRUE(runtime()->gc.storeBuffer.enable());
return;
@@ -243,23 +228,6 @@ js::Nursery::isEmpty() const
return position() == currentStartPosition_;
}
-#ifdef JS_GC_ZEAL
-void
-js::Nursery::enterZealMode() {
- if (isEnabled())
- updateNumChunks(maxNurseryChunks_);
-}
-
-void
-js::Nursery::leaveZealMode() {
- if (isEnabled()) {
- MOZ_ASSERT(isEmpty());
- setCurrentChunk(0);
- setStartPosition();
- }
-}
-#endif // JS_GC_ZEAL
-
JSObject*
js::Nursery::allocateObject(JSContext* cx, size_t size, size_t numDynamic, const js::Class* clasp)
{
@@ -305,12 +273,6 @@ js::Nursery::allocate(size_t size)
MOZ_ASSERT(position() % gc::CellSize == 0);
MOZ_ASSERT(size % gc::CellSize == 0);
-#ifdef JS_GC_ZEAL
- static const size_t CanarySize = (sizeof(Nursery::Canary) + CellSize - 1) & ~CellMask;
- if (runtime()->gc.hasZealMode(ZealMode::CheckNursery))
- size += CanarySize;
-#endif
-
if (currentEnd() < position() + size) {
if (currentChunk_ + 1 == numChunks())
return nullptr;
@@ -322,19 +284,6 @@ js::Nursery::allocate(size_t size)
JS_EXTRA_POISON(thing, JS_ALLOCATED_NURSERY_PATTERN, size);
-#ifdef JS_GC_ZEAL
- if (runtime()->gc.hasZealMode(ZealMode::CheckNursery)) {
- auto canary = reinterpret_cast<Canary*>(position() - CanarySize);
- canary->magicValue = CanaryMagicValue;
- canary->next = nullptr;
- if (lastCanary_) {
- MOZ_ASSERT(!lastCanary_->next);
- lastCanary_->next = canary;
- }
- lastCanary_ = canary;
- }
-#endif
-
MemProfiler::SampleNursery(reinterpret_cast<void*>(thing), size);
return thing;
}
@@ -561,14 +510,6 @@ js::Nursery::collect(JSRuntime* rt, JS::gcreason::Reason reason)
rt->gc.incMinorGcNumber();
-#ifdef JS_GC_ZEAL
- if (rt->gc.hasZealMode(ZealMode::CheckNursery)) {
- for (auto canary = lastCanary_; canary; canary = canary->next)
- MOZ_ASSERT(canary->magicValue == CanaryMagicValue);
- }
- lastCanary_ = nullptr;
-#endif
-
rt->gc.stats.beginNurseryCollection(reason);
TraceMinorGCStart();
@@ -752,10 +693,6 @@ js::Nursery::doCollection(JSRuntime* rt, JS::gcreason::Reason reason,
// Make sure hashtables have been updated after the collection.
maybeStartProfile(ProfileKey::CheckHashTables);
-#ifdef JS_GC_ZEAL
- if (rt->hasZealMode(ZealMode::CheckHashTablesOnMinorGC))
- CheckHashTablesAfterMovingGC(rt);
-#endif
maybeEndProfile(ProfileKey::CheckHashTables);
// Calculate and return the promotion rate.
@@ -828,17 +765,6 @@ js::Nursery::sweep()
runSweepActions();
sweepDictionaryModeObjects();
-#ifdef JS_GC_ZEAL
- /* Poison the nursery contents so touching a freed object will crash. */
- for (unsigned i = 0; i < numChunks(); i++)
- chunk(i).poisonAndInit(runtime(), JS_SWEPT_NURSERY_PATTERN);
-
- if (runtime()->hasZealMode(ZealMode::GenerationalGC)) {
- /* Only reset the alloc point when we are close to the end. */
- if (currentChunk_ + 1 == numChunks())
- setCurrentChunk(0);
- } else
-#endif
{
#ifdef JS_CRASH_DIAGNOSTICS
for (unsigned i = 0; i < numChunks(); ++i)
@@ -916,20 +842,12 @@ js::Nursery::growAllocableSpace()
void
js::Nursery::shrinkAllocableSpace()
{
-#ifdef JS_GC_ZEAL
- if (runtime()->hasZealMode(ZealMode::GenerationalGC))
- return;
-#endif
updateNumChunks(Max(numChunks() - 1, 1u));
}
void
js::Nursery::minimizeAllocableSpace()
{
-#ifdef JS_GC_ZEAL
- if (runtime()->hasZealMode(ZealMode::GenerationalGC))
- return;
-#endif
updateNumChunks(1);
}