@@ -141,6 +141,35 @@ void Universe::Shutdown() {
141141#endif
142142}
143143
144+ static void printVmConfig () {
145+ if (GC_TYPE == GENERATIONAL) {
146+ cout << " \t garbage collector: generational\n " ;
147+ } else if (GC_TYPE == COPYING) {
148+ cout << " \t garbage collector: copying\n " ;
149+ } else if (GC_TYPE == MARK_SWEEP) {
150+ cout << " \t garbage collector: mark-sweep\n " ;
151+ } else if (GC_TYPE == DEBUG_COPYING) {
152+ cout << " \t garbage collector: debug copying\n " ;
153+ } else {
154+ cout << " \t garbage collector: unknown\n " ;
155+ }
156+
157+ if (USE_TAGGING) {
158+ cout << " \t with tagged integers\n " ;
159+ } else {
160+ cout << " \t not tagging integers\n " ;
161+ }
162+
163+ if (CACHE_INTEGER) {
164+ cout << " \t caching integers from " << INT_CACHE_MIN_VALUE << " to "
165+ << INT_CACHE_MAX_VALUE << " \n " ;
166+ } else {
167+ cout << " \t not caching integers\n " ;
168+ }
169+
170+ cout << " --------------------------------------\n " ;
171+ }
172+
144173vector<std::string> Universe::handleArguments (int32_t argc, char ** argv) {
145174 vector<std::string> vmArgs = vector<std::string>();
146175 dumpBytecodes = 0 ;
@@ -154,6 +183,8 @@ vector<std::string> Universe::handleArguments(int32_t argc, char** argv) {
154183 setupClassPath (std::string (argv[++i]));
155184 } else if (strncmp (argv[i], " -d" , 2 ) == 0 ) {
156185 ++dumpBytecodes;
186+ } else if (strncmp (argv[i], " -cfg" , 4 ) == 0 ) {
187+ printVmConfig ();
157188 } else if (strncmp (argv[i], " -g" , 2 ) == 0 ) {
158189 ++gcVerbosity;
159190 } else if (strncmp (argv[i], " -H" , 2 ) == 0 ) {
@@ -238,14 +269,15 @@ void Universe::addClassPath(const std::string& cp) {
238269void Universe::printUsageAndExit (char * executable) {
239270 cout << " Usage: " << executable << " [-options] [args...]\n\n " ;
240271 cout << " where options include:\n " ;
241- cout << " -cp <directories separated by " << pathSeparator << " >\n " ;
242- cout << " set search path for application classes\n " ;
243- cout << " -d enable disassembling (twice for tracing)\n " ;
244- cout << " -g enable garbage collection details:\n "
245- << " 1x - print statistics when VM shuts down\n "
246- << " 2x - print statistics upon each collection\n "
247- << " 3x - print statistics and dump heap upon each \n "
248- << " collection\n " ;
272+ cout << " -cp <directories separated by " << pathSeparator << " >\n " ;
273+ cout << " set search path for application classes\n " ;
274+ cout << " -d enable disassembling (twice for tracing)\n " ;
275+ cout << " -cfg print VM configuration\n " ;
276+ cout << " -g enable garbage collection details:\n "
277+ << " 1x - print statistics when VM shuts down\n "
278+ << " 2x - print statistics upon each collection\n "
279+ << " 3x - print statistics and dump heap upon each collection\n "
280+ << " \n " ;
249281 cout << " -HxMB set the heap size to x MB (default: 1 MB)\n " ;
250282 cout << " -HxKB set the heap size to x KB (default: 1 MB)\n " ;
251283 cout << " -h show this help\n " ;
0 commit comments