Bug 650161 - Update help text for shrinking zeal mode r=terrence

This commit is contained in:
Jon Coppeard 2014-10-20 09:07:42 +01:00
parent 35bfa942e1
commit b3582e43a3
4 changed files with 28 additions and 37 deletions

View File

@ -2157,24 +2157,8 @@ static const JSFunctionSpecWithHelp TestingFunctions[] = {
#ifdef JS_GC_ZEAL
JS_FN_HELP("gczeal", GCZeal, 2, 0,
"gczeal(level, [period])",
" Specifies how zealous the garbage collector should be. Values for level:\n"
" 0: Normal amount of collection\n"
" 1: Collect when roots are added or removed\n"
" 2: Collect when memory is allocated\n"
" 3: Collect when the window paints (browser only)\n"
" 4: Verify pre write barriers between instructions\n"
" 5: Verify pre write barriers between paints\n"
" 6: Verify stack rooting\n"
" 7: Collect the nursery every N nursery allocations\n"
" 8: Incremental GC in two slices: 1) mark roots 2) finish collection\n"
" 9: Incremental GC in two slices: 1) mark all 2) new marking and finish\n"
" 10: Incremental GC in multiple slices\n"
" 11: Verify post write barriers between instructions\n"
" 12: Verify post write barriers between paints\n"
" 13: Check internal hashtables on minor GC\n"
" 14: Always compact arenas after GC\n"
" Period specifies that collection happens every n allocations.\n"),
"gczeal(level, [N])",
gc::ZealModeHelpText),
JS_FN_HELP("schedulegc", ScheduleGC, 1, 0,
"schedulegc(num | obj)",

View File

@ -763,7 +763,7 @@ class GCRuntime
* Otherwise, no additional GCs take place.
*
* You can control these values in several ways:
* - Pass the -Z flag to the shell (see the usage info for details)
* - Set the JS_GC_ZEAL environment variable
* - Call zeal() or schedulegc() from inside shell-executed JS code
* (see the help for details)
*
@ -775,6 +775,8 @@ class GCRuntime
*
* zeal_ values from 8 to 10 periodically run different types of
* incremental GC.
*
* zeal_ value 14 performs periodic shrinking collections.
*/
#ifdef JS_GC_ZEAL
int zealMode;

View File

@ -1241,6 +1241,24 @@ GCRuntime::GCRuntime(JSRuntime *rt) :
#ifdef JS_GC_ZEAL
const char *gc::ZealModeHelpText =
" Specifies how zealous the garbage collector should be. Values for level:\n"
" 0: Normal amount of collection\n"
" 1: Collect when roots are added or removed\n"
" 2: Collect when every N allocations (default: 100)\n"
" 3: Collect when the window paints (browser only)\n"
" 4: Verify pre write barriers between instructions\n"
" 5: Verify pre write barriers between paints\n"
" 6: Verify stack rooting\n"
" 7: Collect the nursery every N nursery allocations\n"
" 8: Incremental GC in two slices: 1) mark roots 2) finish collection\n"
" 9: Incremental GC in two slices: 1) mark all 2) new marking and finish\n"
" 10: Incremental GC in multiple slices\n"
" 11: Verify post write barriers between instructions\n"
" 12: Verify post write barriers between paints\n"
" 13: Check internal hashtables on minor GC\n"
" 14: Perform a shrinking collection every N allocations\n";
void
GCRuntime::setZeal(uint8_t zeal, uint32_t frequency)
{
@ -1288,23 +1306,8 @@ GCRuntime::initZeal()
}
if (zeal < 0 || zeal > ZealLimit || frequency < 0) {
fprintf(stderr,
"Format: JS_GC_ZEAL=N[,F]\n"
"N indicates \"zealousness\":\n"
" 0: no additional GCs\n"
" 1: additional GCs at common danger points\n"
" 2: GC every F allocations (default: 100)\n"
" 3: GC when the window paints (browser only)\n"
" 4: Verify pre write barriers between instructions\n"
" 5: Verify pre write barriers between paints\n"
" 6: Verify stack rooting\n"
" 7: Collect the nursery every N nursery allocations\n"
" 8: Incremental GC in two slices: 1) mark roots 2) finish collection\n"
" 9: Incremental GC in two slices: 1) mark all 2) new marking and finish\n"
" 10: Incremental GC in multiple slices\n"
" 11: Verify post write barriers between instructions\n"
" 12: Verify post write barriers between paints\n"
" 13: Purge analysis state every F allocations (default: 100)\n");
fprintf(stderr, "Format: JS_GC_ZEAL=level[,N]\n");
fputs(ZealModeHelpText, stderr);
return false;
}

View File

@ -1364,6 +1364,8 @@ const int ZealCheckHashTablesOnMinorGC = 13;
const int ZealCompactValue = 14;
const int ZealLimit = 14;
extern const char *ZealModeHelpText;
enum VerifierType {
PreBarrierVerifier,
PostBarrierVerifier