Skip to content

Commit

Permalink
Merge pull request #7723 from AlenBadel/mapping
Browse files Browse the repository at this point in the history
Add GC Mappings
  • Loading branch information
pshipton committed Dec 6, 2019
2 parents e153031 + d0093b6 commit 260d138
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
16 changes: 8 additions & 8 deletions runtime/gc_modron_startup/mmparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -938,19 +938,19 @@ gcParseSovereignArguments(J9JavaVM *vm)
goto _error;
}

if(-1 != FIND_ARG_IN_VMARGS(EXACT_MEMORY_MATCH, "-Xgcthreads", NULL)) {
result = option_set_to_opt_integer(vm, "-Xgcthreads", &index, EXACT_MEMORY_MATCH, &extensions->gcThreadCount);
if(-1 != FIND_ARG_IN_VMARGS(EXACT_MEMORY_MATCH, VMOPT_XGCTHREADS, NULL)) {
result = option_set_to_opt_integer(vm, VMOPT_XGCTHREADS, &index, EXACT_MEMORY_MATCH, &extensions->gcThreadCount);
if (OPTION_OK != result) {
if (OPTION_MALFORMED == result) {
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_MUST_BE_NUMBER, "-Xgcthreads");
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_MUST_BE_NUMBER, VMOPT_XGCTHREADS);
} else {
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_VALUE_OVERFLOWED, "-Xgcthreads");
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_VALUE_OVERFLOWED, VMOPT_XGCTHREADS);
}
goto _error;
}

if(0 == extensions->gcThreadCount) {
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_VALUE_MUST_BE_ABOVE, "-Xgcthreads", (UDATA)0);
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_VALUE_MUST_BE_ABOVE, VMOPT_XGCTHREADS, (UDATA)0);
goto _error;
}

Expand Down Expand Up @@ -996,12 +996,12 @@ gcParseSovereignArguments(J9JavaVM *vm)
}

#if defined(OMR_GC_MODRON_CONCURRENT_MARK)
result = option_set_to_opt_integer(vm, "-Xconcurrentbackground", &index, EXACT_MEMORY_MATCH, &extensions->concurrentBackground);
result = option_set_to_opt_integer(vm, VMOPT_XCONCURRENTBACKGROUND, &index, EXACT_MEMORY_MATCH, &extensions->concurrentBackground);
if (OPTION_OK != result) {
if (OPTION_MALFORMED == result) {
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_MUST_BE_NUMBER, "-Xconcurrentbackground");
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_MUST_BE_NUMBER, VMOPT_XCONCURRENTBACKGROUND);
} else {
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_VALUE_OVERFLOWED, "-Xconcurrentbackground");
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_VALUE_OVERFLOWED, VMOPT_XCONCURRENTBACKGROUND);
}
goto _error;
}
Expand Down
5 changes: 5 additions & 0 deletions runtime/oti/jvminit.h
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,9 @@ enum INIT_STAGE {
#define MAPOPT_XXONOUTOFMEMORYERROR_EQUALS "-XX:OnOutOfMemoryError="
#define MAPOPT_XXENABLEEXITONOUTOFMEMORYERROR "-XX:+ExitOnOutOfMemoryError"
#define MAPOPT_XXDISABLEEXITONOUTOFMEMORYERROR "-XX:-ExitOnOutOfMemoryError"
#define MAPOPT_XXPARALLELCMSTHREADS_EQUALS "-XX:ParallelCMSThreads="
#define MAPOPT_XXCONCGCTHREADS_EQUALS "-XX:ConcGCThreads="
#define MAPOPT_XXPARALLELGCTHREADS_EQUALS "-XX:ParallelGCThreads="

#define VMOPT_XXACTIVEPROCESSORCOUNT_EQUALS "-XX:ActiveProcessorCount="

Expand All @@ -524,6 +527,8 @@ enum INIT_STAGE {
#define VMOPT_XXIDLETUNINGCOMPACTONIDLEENABLE "-XX:+IdleTuningCompactOnIdle"
#define VMOPT_XXIDLETUNINGIGNOREUNRECOGNIZEDOPTIONSDISABLE "-XX:-IdleTuningIgnoreUnrecognizedOptions"
#define VMOPT_XXIDLETUNINGIGNOREUNRECOGNIZEDOPTIONSENABLE "-XX:+IdleTuningIgnoreUnrecognizedOptions"
#define VMOPT_XCONCURRENTBACKGROUND "-Xconcurrentbackground"
#define VMOPT_XGCTHREADS "-Xgcthreads"

/* Modularity command line options */
#define VMOPT_MODULE_UPGRADE_PATH "--upgrade-module-path"
Expand Down
12 changes: 12 additions & 0 deletions runtime/vm/jvminit.c
Original file line number Diff line number Diff line change
Expand Up @@ -4119,6 +4119,18 @@ registerVMCmdLineMappings(J9JavaVM* vm)
if (registerCmdLineMapping(vm, MAPOPT_XXDISABLEEXITONOUTOFMEMORYERROR, VMOPT_XDUMP_EXIT_OUTOFMEMORYERROR_DISABLE, EXACT_MAP_NO_OPTIONS) == RC_FAILED) {
return RC_FAILED;
}
/* Map -XX:ParallelCMSThreads=N to -Xconcurrentbackground */
if (registerCmdLineMapping(vm, MAPOPT_XXPARALLELCMSTHREADS_EQUALS, VMOPT_XCONCURRENTBACKGROUND, EXACT_MAP_WITH_OPTIONS) == RC_FAILED) {
return RC_FAILED;
}
/* Map -XX:ConcGCThreads=N to -Xconcurrentbackground */
if (registerCmdLineMapping(vm, MAPOPT_XXCONCGCTHREADS_EQUALS, VMOPT_XCONCURRENTBACKGROUND, EXACT_MAP_WITH_OPTIONS) == RC_FAILED) {
return RC_FAILED;
}
/* Map -XX:ParallelGCThreads=N to -XgcthreadsN */
if (registerCmdLineMapping(vm, MAPOPT_XXPARALLELGCTHREADS_EQUALS, VMOPT_XGCTHREADS, EXACT_MAP_WITH_OPTIONS) == RC_FAILED) {
return RC_FAILED;
}

return 0;
}
Expand Down

0 comments on commit 260d138

Please sign in to comment.