comparison src/share/vm/runtime/globals.cpp @ 4970:33df1aeaebbf

Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Mon, 27 Feb 2012 13:10:13 +0100
parents 4f25538b54c9
children 80fe40862b02
comparison
equal deleted inserted replaced
4703:2cfb7fb2dce7 4970:33df1aeaebbf
80 return is_unlocked_ext(); 80 return is_unlocked_ext();
81 } 81 }
82 } 82 }
83 83
84 bool Flag::is_writeable() const { 84 bool Flag::is_writeable() const {
85 return (strcmp(kind, "{manageable}") == 0 || strcmp(kind, "{product rw}") == 0); 85 return strcmp(kind, "{manageable}") == 0 ||
86 } 86 strcmp(kind, "{product rw}") == 0 ||
87 87 is_writeable_ext();
88 // All flags except "manageable" are assumed internal flags. 88 }
89
90 // All flags except "manageable" are assumed to be internal flags.
89 // Long term, we need to define a mechanism to specify which flags 91 // Long term, we need to define a mechanism to specify which flags
90 // are external/stable and change this function accordingly. 92 // are external/stable and change this function accordingly.
91 bool Flag::is_external() const { 93 bool Flag::is_external() const {
92 return (strcmp(kind, "{manageable}") == 0); 94 return strcmp(kind, "{manageable}") == 0 || is_external_ext();
93 } 95 }
96
94 97
95 // Length of format string (e.g. "%.1234s") for printing ccstr below 98 // Length of format string (e.g. "%.1234s") for printing ccstr below
96 #define FORMAT_BUFFER_LEN 16 99 #define FORMAT_BUFFER_LEN 16
97 100
98 void Flag::print_on(outputStream* st, bool withComments) { 101 void Flag::print_on(outputStream* st, bool withComments) {
483 static int compare_flags(const void* void_a, const void* void_b) { 486 static int compare_flags(const void* void_a, const void* void_b) {
484 return strcmp((*((Flag**) void_a))->name, (*((Flag**) void_b))->name); 487 return strcmp((*((Flag**) void_a))->name, (*((Flag**) void_b))->name);
485 } 488 }
486 } 489 }
487 490
488 void CommandLineFlags::printSetFlags() { 491 void CommandLineFlags::printSetFlags(outputStream* out) {
489 // Print which flags were set on the command line 492 // Print which flags were set on the command line
490 // note: this method is called before the thread structure is in place 493 // note: this method is called before the thread structure is in place
491 // which means resource allocation cannot be used. 494 // which means resource allocation cannot be used.
492 495
493 // Compute size 496 // Compute size
502 qsort(array, length, sizeof(Flag*), compare_flags); 505 qsort(array, length, sizeof(Flag*), compare_flags);
503 506
504 // Print 507 // Print
505 for (int i = 0; i < length; i++) { 508 for (int i = 0; i < length; i++) {
506 if (array[i]->origin /* naked field! */) { 509 if (array[i]->origin /* naked field! */) {
507 array[i]->print_as_flag(tty); 510 array[i]->print_as_flag(out);
508 tty->print(" "); 511 out->print(" ");
509 } 512 }
510 } 513 }
511 tty->cr(); 514 out->cr();
512 FREE_C_HEAP_ARRAY(Flag*, array); 515 FREE_C_HEAP_ARRAY(Flag*, array);
513 } 516 }
514 517
515 #ifndef PRODUCT 518 #ifndef PRODUCT
516 519
519 assert(Arguments::check_vm_args_consistency(), "Some flag settings conflict"); 522 assert(Arguments::check_vm_args_consistency(), "Some flag settings conflict");
520 } 523 }
521 524
522 #endif // PRODUCT 525 #endif // PRODUCT
523 526
524 void CommandLineFlags::printFlags(bool withComments) { 527 void CommandLineFlags::printFlags(outputStream* out, bool withComments) {
525 // Print the flags sorted by name 528 // Print the flags sorted by name
526 // note: this method is called before the thread structure is in place 529 // note: this method is called before the thread structure is in place
527 // which means resource allocation cannot be used. 530 // which means resource allocation cannot be used.
528 531
529 // Compute size 532 // Compute size
536 array[index] = &flagTable[index]; 539 array[index] = &flagTable[index];
537 } 540 }
538 qsort(array, length, sizeof(Flag*), compare_flags); 541 qsort(array, length, sizeof(Flag*), compare_flags);
539 542
540 // Print 543 // Print
541 tty->print_cr("[Global flags]"); 544 out->print_cr("[Global flags]");
542 for (int i = 0; i < length; i++) { 545 for (int i = 0; i < length; i++) {
543 if (array[i]->is_unlocked()) { 546 if (array[i]->is_unlocked()) {
544 array[i]->print_on(tty, withComments); 547 array[i]->print_on(out, withComments);
545 } 548 }
546 } 549 }
547 FREE_C_HEAP_ARRAY(Flag*, array); 550 FREE_C_HEAP_ARRAY(Flag*, array);
548 } 551 }