mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 08:15:31 +00:00
Bug 1569840 - Add a nurseryBytes runtime parameter r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D39836 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
14a6956635
commit
d1b58951a1
@ -345,6 +345,12 @@ typedef enum JSGCParamKey {
|
||||
*/
|
||||
JSGC_ZONE_ALLOC_DELAY_KB = 33,
|
||||
|
||||
/*
|
||||
* The current size of the nursery.
|
||||
*
|
||||
* read-only.
|
||||
*/
|
||||
JSGC_NURSERY_BYTES = 34,
|
||||
} JSGCParamKey;
|
||||
|
||||
/*
|
||||
|
@ -498,6 +498,7 @@ static bool MinorGC(JSContext* cx, unsigned argc, Value* vp) {
|
||||
_("minNurseryBytes", JSGC_MIN_NURSERY_BYTES, true) \
|
||||
_("maxNurseryBytes", JSGC_MAX_NURSERY_BYTES, true) \
|
||||
_("gcBytes", JSGC_BYTES, false) \
|
||||
_("nurseryBytes", JSGC_NURSERY_BYTES, false) \
|
||||
_("gcNumber", JSGC_NUMBER, false) \
|
||||
_("mode", JSGC_MODE, true) \
|
||||
_("unusedChunks", JSGC_UNUSED_CHUNKS, false) \
|
||||
|
@ -1824,6 +1824,8 @@ uint32_t GCRuntime::getParameter(JSGCParamKey key, const AutoLockGC& lock) {
|
||||
return uint32_t(tunables.gcMaxNurseryBytes());
|
||||
case JSGC_BYTES:
|
||||
return uint32_t(heapSize.gcBytes());
|
||||
case JSGC_NURSERY_BYTES:
|
||||
return nursery().capacity();
|
||||
case JSGC_NUMBER:
|
||||
return uint32_t(number);
|
||||
case JSGC_MODE:
|
||||
|
9
js/src/jit-test/tests/gc/bug-1569840.js
Normal file
9
js/src/jit-test/tests/gc/bug-1569840.js
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
gczeal(0);
|
||||
|
||||
gcparam("maxNurseryBytes", 1024*1024);
|
||||
gcparam("minNurseryBytes", 1024*1024);
|
||||
var obj = { foo: 'bar', baz: [1, 2, 3]};
|
||||
minorgc();
|
||||
assertEq(gcparam("nurseryBytes"), 1024*1024);
|
||||
|
Loading…
Reference in New Issue
Block a user