Bug 935022 - Fix the interaction between generational GC zeal mode and disabling generational collection r=terrence

This commit is contained in:
Jon Coppeard 2013-11-06 10:45:59 +00:00
parent 0143ebf10e
commit e93128c9fc
3 changed files with 13 additions and 1 deletions

View File

@ -80,6 +80,10 @@ js::Nursery::enable()
JS_ASSERT_IF(runtime()->gcZeal_ != ZealGenerationalGCValue, position_ == start()); JS_ASSERT_IF(runtime()->gcZeal_ != ZealGenerationalGCValue, position_ == start());
numActiveChunks_ = 1; numActiveChunks_ = 1;
setCurrentChunk(0); setCurrentChunk(0);
#ifdef JS_GC_ZEAL
if (runtime()->gcZeal_ == ZealGenerationalGCValue)
enterZealMode();
#endif
} }
void void
@ -95,6 +99,7 @@ js::Nursery::disable()
void * void *
js::Nursery::allocate(size_t size) js::Nursery::allocate(size_t size)
{ {
JS_ASSERT(isEnabled());
JS_ASSERT(!runtime()->isHeapBusy()); JS_ASSERT(!runtime()->isHeapBusy());
/* Ensure there's enough space to replace the contents with a RelocationOverlay. */ /* Ensure there's enough space to replace the contents with a RelocationOverlay. */

View File

@ -117,7 +117,10 @@ class Nursery
static const uint8_t FreshNursery = 0x2a; static const uint8_t FreshNursery = 0x2a;
static const uint8_t SweptNursery = 0x2b; static const uint8_t SweptNursery = 0x2b;
static const uint8_t AllocatedThing = 0x2c; static const uint8_t AllocatedThing = 0x2c;
void enterZealMode() { numActiveChunks_ = NumNurseryChunks; } void enterZealMode() {
if (isEnabled())
numActiveChunks_ = NumNurseryChunks;
}
#endif #endif
private: private:

View File

@ -0,0 +1,4 @@
function callback(obj) {}
setObjectMetadataCallback(callback);
gczeal(7);
var statusitems = [];