< prev index next >

src/share/vm/runtime/globals.cpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 386           cp = eol+1;
 387           st->print("%5s %-35s += ", "", _name);
 388         }
 389         st->print("%-16s", cp);
 390       }
 391       else st->print("%-16s", "");
 392     }
 393 
 394     st->print("%-20s", " ");
 395     print_kind(st);
 396 
 397 #ifndef PRODUCT
 398     if (withComments) {
 399       st->print("%s", _doc);
 400     }
 401 #endif
 402 
 403     st->cr();
 404 
 405   } else if (!is_bool() && !is_ccstr()) {
 406 
 407     if (printRanges) {
 408 
 409       st->print("%9s %-50s ", _type, _name);
 410 
 411       CommandLineFlagRangeList::print(_name, st, true);
 412 
 413       st->print(" %-20s", " ");
 414       print_kind(st);
 415 
 416 #ifndef PRODUCT
 417       if (withComments) {
 418         st->print("%s", _doc);
 419       }
 420 #endif
 421 
 422       st->cr();
 423 
 424     }
 425   }
 426 }
 427 
 428 void Flag::print_kind(outputStream* st) {
 429   struct Data {
 430     int flag;
 431     const char* name;
 432   };
 433 
 434   Data data[] = {
 435       { KIND_JVMCI, "JVMCI" },
 436       { KIND_C1, "C1" },
 437       { KIND_C2, "C2" },
 438       { KIND_ARCH, "ARCH" },
 439       { KIND_SHARK, "SHARK" },
 440       { KIND_PLATFORM_DEPENDENT, "pd" },
 441       { KIND_PRODUCT, "product" },
 442       { KIND_MANAGEABLE, "manageable" },
 443       { KIND_DIAGNOSTIC, "diagnostic" },
 444       { KIND_EXPERIMENTAL, "experimental" },


1238 
1239   // Print
1240   for (size_t i = 0; i < length; i++) {
1241     if (array[i]->get_origin() /* naked field! */) {
1242       array[i]->print_as_flag(out);
1243       out->print(" ");
1244     }
1245   }
1246   out->cr();
1247   FREE_C_HEAP_ARRAY(Flag*, array);
1248 }
1249 
1250 #ifndef PRODUCT
1251 
1252 void CommandLineFlags::verify() {
1253   assert(Arguments::check_vm_args_consistency(), "Some flag settings conflict");
1254 }
1255 
1256 #endif // PRODUCT
1257 
1258 #define ONLY_PRINT_PRODUCT_FLAGS
1259 
1260 void CommandLineFlags::printFlags(outputStream* out, bool withComments, bool printRanges) {
1261   // Print the flags sorted by name
1262   // note: this method is called before the thread structure is in place
1263   //       which means resource allocation cannot be used.
1264 
1265   // The last entry is the null entry.
1266   const size_t length = Flag::numFlags - 1;
1267 
1268   // Sort
1269   Flag** array = NEW_C_HEAP_ARRAY(Flag*, length, mtInternal);
1270   for (size_t i = 0; i < length; i++) {
1271     array[i] = &flagTable[i];
1272   }
1273   qsort(array, length, sizeof(Flag*), compare_flags);
1274 
1275   // Print
1276   if (!printRanges) {
1277     out->print_cr("[Global flags]");
1278   } else {
1279     out->print_cr("[Global flags ranges]");
1280   }
1281 
1282   for (size_t i = 0; i < length; i++) {
1283     if (array[i]->is_unlocked()) {
1284 #ifdef ONLY_PRINT_PRODUCT_FLAGS
1285       if (!array[i]->is_notproduct() && !array[i]->is_develop())
1286 #endif // ONLY_PRINT_PRODUCT_FLAGS
1287       array[i]->print_on(out, withComments, printRanges);
1288     }
1289   }
1290   FREE_C_HEAP_ARRAY(Flag*, array);
1291 }
   1 /*
   2  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 386           cp = eol+1;
 387           st->print("%5s %-35s += ", "", _name);
 388         }
 389         st->print("%-16s", cp);
 390       }
 391       else st->print("%-16s", "");
 392     }
 393 
 394     st->print("%-20s", " ");
 395     print_kind(st);
 396 
 397 #ifndef PRODUCT
 398     if (withComments) {
 399       st->print("%s", _doc);
 400     }
 401 #endif
 402 
 403     st->cr();
 404 
 405   } else if (!is_bool() && !is_ccstr()) {



 406     st->print("%9s %-50s ", _type, _name);
 407 
 408     CommandLineFlagRangeList::print(_name, st, true);
 409 
 410     st->print(" %-20s", " ");
 411     print_kind(st);
 412 
 413 #ifndef PRODUCT
 414     if (withComments) {
 415       st->print("%s", _doc);
 416     }
 417 #endif
 418 
 419     st->cr();


 420   }
 421 }
 422 
 423 void Flag::print_kind(outputStream* st) {
 424   struct Data {
 425     int flag;
 426     const char* name;
 427   };
 428 
 429   Data data[] = {
 430       { KIND_JVMCI, "JVMCI" },
 431       { KIND_C1, "C1" },
 432       { KIND_C2, "C2" },
 433       { KIND_ARCH, "ARCH" },
 434       { KIND_SHARK, "SHARK" },
 435       { KIND_PLATFORM_DEPENDENT, "pd" },
 436       { KIND_PRODUCT, "product" },
 437       { KIND_MANAGEABLE, "manageable" },
 438       { KIND_DIAGNOSTIC, "diagnostic" },
 439       { KIND_EXPERIMENTAL, "experimental" },


1233 
1234   // Print
1235   for (size_t i = 0; i < length; i++) {
1236     if (array[i]->get_origin() /* naked field! */) {
1237       array[i]->print_as_flag(out);
1238       out->print(" ");
1239     }
1240   }
1241   out->cr();
1242   FREE_C_HEAP_ARRAY(Flag*, array);
1243 }
1244 
1245 #ifndef PRODUCT
1246 
1247 void CommandLineFlags::verify() {
1248   assert(Arguments::check_vm_args_consistency(), "Some flag settings conflict");
1249 }
1250 
1251 #endif // PRODUCT
1252 


1253 void CommandLineFlags::printFlags(outputStream* out, bool withComments, bool printRanges) {
1254   // Print the flags sorted by name
1255   // note: this method is called before the thread structure is in place
1256   //       which means resource allocation cannot be used.
1257 
1258   // The last entry is the null entry.
1259   const size_t length = Flag::numFlags - 1;
1260 
1261   // Sort
1262   Flag** array = NEW_C_HEAP_ARRAY(Flag*, length, mtInternal);
1263   for (size_t i = 0; i < length; i++) {
1264     array[i] = &flagTable[i];
1265   }
1266   qsort(array, length, sizeof(Flag*), compare_flags);
1267 
1268   // Print
1269   if (!printRanges) {
1270     out->print_cr("[Global flags]");
1271   } else {
1272     out->print_cr("[Global flags ranges]");
1273   }
1274 
1275   for (size_t i = 0; i < length; i++) {
1276     if (array[i]->is_unlocked()) {



1277       array[i]->print_on(out, withComments, printRanges);
1278     }
1279   }
1280   FREE_C_HEAP_ARRAY(Flag*, array);
1281 }
< prev index next >