< prev index next >

src/share/vm/runtime/arguments.cpp

Print this page




1561   if (!DumpSharedSpaces && !RequireSharedSpaces &&
1562       (FLAG_IS_DEFAULT(UseSharedSpaces) || !UseSharedSpaces)) {
1563     no_shared_spaces("COMPILER2 default: -Xshare:auto | off, have to manually setup to on.");
1564   }
1565 #endif
1566 
1567   set_conservative_max_heap_alignment();
1568 
1569 #ifndef ZERO
1570 #ifdef _LP64
1571   set_use_compressed_oops();
1572 
1573   // set_use_compressed_klass_ptrs() must be called after calling
1574   // set_use_compressed_oops().
1575   set_use_compressed_klass_ptrs();
1576 
1577   // Also checks that certain machines are slower with compressed oops
1578   // in vm_version initialization code.
1579 #endif // _LP64
1580 #endif // !ZERO



1581 }
1582 
1583 void Arguments::set_parallel_gc_flags() {
1584   assert(UseParallelGC || UseParallelOldGC, "Error");
1585   // Enable ParallelOld unless it was explicitly disabled (cmd line or rc file).
1586   if (FLAG_IS_DEFAULT(UseParallelOldGC)) {
1587     FLAG_SET_DEFAULT(UseParallelOldGC, true);
1588   }
1589   FLAG_SET_DEFAULT(UseParallelGC, true);
1590 
1591   // If no heap maximum was requested explicitly, use some reasonable fraction
1592   // of the physical memory, up to a maximum of 1GB.
1593   FLAG_SET_DEFAULT(ParallelGCThreads,
1594                    Abstract_VM_Version::parallel_worker_threads());
1595   if (ParallelGCThreads == 0) {
1596     jio_fprintf(defaultStream::error_stream(),
1597         "The Parallel GC can not be combined with -XX:ParallelGCThreads=0\n");
1598     vm_exit(1);
1599   }
1600 


1816       reasonable_initial = limit_by_allocatable_memory(reasonable_initial);
1817 
1818       if (PrintGCDetails && Verbose) {
1819         // Cannot use gclog_or_tty yet.
1820         tty->print_cr("  Initial heap size " SIZE_FORMAT, (size_t)reasonable_initial);
1821       }
1822       FLAG_SET_ERGO(size_t, InitialHeapSize, (size_t)reasonable_initial);
1823     }
1824     // If the minimum heap size has not been set (via -Xms),
1825     // synchronize with InitialHeapSize to avoid errors with the default value.
1826     if (min_heap_size() == 0) {
1827       set_min_heap_size(MIN2((size_t)reasonable_minimum, InitialHeapSize));
1828       if (PrintGCDetails && Verbose) {
1829         // Cannot use gclog_or_tty yet.
1830         tty->print_cr("  Minimum heap size " SIZE_FORMAT, min_heap_size());
1831       }
1832     }
1833   }
1834 }
1835 










1836 // This must be called after ergonomics.
1837 void Arguments::set_bytecode_flags() {
1838   if (!RewriteBytecodes) {
1839     FLAG_SET_DEFAULT(RewriteFrequentPairs, false);
1840   }
1841 }
1842 
1843 // Aggressive optimization flags  -XX:+AggressiveOpts
1844 void Arguments::set_aggressive_opts_flags() {
1845 #ifdef COMPILER2
1846   if (AggressiveUnboxing) {
1847     if (FLAG_IS_DEFAULT(EliminateAutoBox)) {
1848       FLAG_SET_DEFAULT(EliminateAutoBox, true);
1849     } else if (!EliminateAutoBox) {
1850       // warning("AggressiveUnboxing is disabled because EliminateAutoBox is disabled");
1851       AggressiveUnboxing = false;
1852     }
1853     if (FLAG_IS_DEFAULT(DoEscapeAnalysis)) {
1854       FLAG_SET_DEFAULT(DoEscapeAnalysis, true);
1855     } else if (!DoEscapeAnalysis) {




1561   if (!DumpSharedSpaces && !RequireSharedSpaces &&
1562       (FLAG_IS_DEFAULT(UseSharedSpaces) || !UseSharedSpaces)) {
1563     no_shared_spaces("COMPILER2 default: -Xshare:auto | off, have to manually setup to on.");
1564   }
1565 #endif
1566 
1567   set_conservative_max_heap_alignment();
1568 
1569 #ifndef ZERO
1570 #ifdef _LP64
1571   set_use_compressed_oops();
1572 
1573   // set_use_compressed_klass_ptrs() must be called after calling
1574   // set_use_compressed_oops().
1575   set_use_compressed_klass_ptrs();
1576 
1577   // Also checks that certain machines are slower with compressed oops
1578   // in vm_version initialization code.
1579 #endif // _LP64
1580 #endif // !ZERO
1581 
1582   // Set up runtime image flags.
1583   set_runtime_image_flags();
1584 }
1585 
1586 void Arguments::set_parallel_gc_flags() {
1587   assert(UseParallelGC || UseParallelOldGC, "Error");
1588   // Enable ParallelOld unless it was explicitly disabled (cmd line or rc file).
1589   if (FLAG_IS_DEFAULT(UseParallelOldGC)) {
1590     FLAG_SET_DEFAULT(UseParallelOldGC, true);
1591   }
1592   FLAG_SET_DEFAULT(UseParallelGC, true);
1593 
1594   // If no heap maximum was requested explicitly, use some reasonable fraction
1595   // of the physical memory, up to a maximum of 1GB.
1596   FLAG_SET_DEFAULT(ParallelGCThreads,
1597                    Abstract_VM_Version::parallel_worker_threads());
1598   if (ParallelGCThreads == 0) {
1599     jio_fprintf(defaultStream::error_stream(),
1600         "The Parallel GC can not be combined with -XX:ParallelGCThreads=0\n");
1601     vm_exit(1);
1602   }
1603 


1819       reasonable_initial = limit_by_allocatable_memory(reasonable_initial);
1820 
1821       if (PrintGCDetails && Verbose) {
1822         // Cannot use gclog_or_tty yet.
1823         tty->print_cr("  Initial heap size " SIZE_FORMAT, (size_t)reasonable_initial);
1824       }
1825       FLAG_SET_ERGO(size_t, InitialHeapSize, (size_t)reasonable_initial);
1826     }
1827     // If the minimum heap size has not been set (via -Xms),
1828     // synchronize with InitialHeapSize to avoid errors with the default value.
1829     if (min_heap_size() == 0) {
1830       set_min_heap_size(MIN2((size_t)reasonable_minimum, InitialHeapSize));
1831       if (PrintGCDetails && Verbose) {
1832         // Cannot use gclog_or_tty yet.
1833         tty->print_cr("  Minimum heap size " SIZE_FORMAT, min_heap_size());
1834       }
1835     }
1836   }
1837 }
1838 
1839   // Set up runtime image flags
1840 void Arguments::set_runtime_image_flags() {
1841 #ifdef _LP64
1842   // Memory map image file by default on 64 bit machines.
1843   if (FLAG_IS_DEFAULT(MemoryMapImage)) {
1844     FLAG_SET_ERGO(bool, MemoryMapImage, true);
1845   }
1846 #endif
1847 }
1848 
1849 // This must be called after ergonomics.
1850 void Arguments::set_bytecode_flags() {
1851   if (!RewriteBytecodes) {
1852     FLAG_SET_DEFAULT(RewriteFrequentPairs, false);
1853   }
1854 }
1855 
1856 // Aggressive optimization flags  -XX:+AggressiveOpts
1857 void Arguments::set_aggressive_opts_flags() {
1858 #ifdef COMPILER2
1859   if (AggressiveUnboxing) {
1860     if (FLAG_IS_DEFAULT(EliminateAutoBox)) {
1861       FLAG_SET_DEFAULT(EliminateAutoBox, true);
1862     } else if (!EliminateAutoBox) {
1863       // warning("AggressiveUnboxing is disabled because EliminateAutoBox is disabled");
1864       AggressiveUnboxing = false;
1865     }
1866     if (FLAG_IS_DEFAULT(DoEscapeAnalysis)) {
1867       FLAG_SET_DEFAULT(DoEscapeAnalysis, true);
1868     } else if (!DoEscapeAnalysis) {


< prev index next >