1716 tty->print_cr("ConcGCThreads: %u", (uint) ConcGCThreads);
1717 }
1718 }
1719
1720 void Arguments::set_shenandoah_gc_flags() {
1721
1722 #if !(defined AARCH64 || defined AMD64 || defined IA32)
1723 UNSUPPORTED_GC_OPTION(UseShenandoahGC);
1724 #endif
1725
1726 #if 0 // leave this block as stepping stone for future platforms
1727 warning("Shenandoah GC is not fully supported on this platform:");
1728 warning(" concurrent modes are not supported, only STW cycles are enabled;");
1729 warning(" arch-specific barrier code is not implemented, disabling barriers;");
1730
1731 #if INCLUDE_ALL_GCS
1732 FLAG_SET_DEFAULT(ShenandoahGCHeuristics, "passive");
1733
1734 FLAG_SET_DEFAULT(ShenandoahSATBBarrier, false);
1735 FLAG_SET_DEFAULT(ShenandoahLoadRefBarrier, false);
1736 FLAG_SET_DEFAULT(ShenandoahKeepAliveBarrier, false);
1737 FLAG_SET_DEFAULT(ShenandoahStoreValEnqueueBarrier, false);
1738 FLAG_SET_DEFAULT(ShenandoahCASBarrier, false);
1739 FLAG_SET_DEFAULT(ShenandoahCloneBarrier, false);
1740
1741 FLAG_SET_DEFAULT(ShenandoahVerifyOptoBarriers, false);
1742 #endif
1743 #endif
1744
1745 #if INCLUDE_ALL_GCS
1746 if (!FLAG_IS_DEFAULT(ShenandoahGarbageThreshold)) {
1747 if (0 > ShenandoahGarbageThreshold || ShenandoahGarbageThreshold > 100) {
1748 vm_exit_during_initialization("The flag -XX:ShenandoahGarbageThreshold is out of range", NULL);
1749 }
1750 }
1751
1752 if (!FLAG_IS_DEFAULT(ShenandoahAllocationThreshold)) {
1753 if (0 > ShenandoahAllocationThreshold || ShenandoahAllocationThreshold > 100) {
1754 vm_exit_during_initialization("The flag -XX:ShenandoahAllocationThreshold is out of range", NULL);
1755 }
1756 }
1829 // When sampling is enabled, max out the PerfData memory to get more
1830 // Shenandoah data in, including Matrix.
1831 FLAG_SET_DEFAULT(PerfDataMemorySize, 2048*K);
1832 }
1833 #endif
1834
1835 #ifdef COMPILER2
1836 // Shenandoah cares more about pause times, rather than raw throughput.
1837 // Enabling safepoints in counted loops makes it more responsive with
1838 // long loops. However, it is risky in 8u, due to bugs it brings, for
1839 // example JDK-8176506. Warn user about this, and proceed.
1840 if (UseCountedLoopSafepoints) {
1841 warning("Enabling -XX:UseCountedLoopSafepoints is known to cause JVM bugs. Use at your own risk.");
1842 }
1843
1844 #ifdef ASSERT
1845 // C2 barrier verification is only reliable when all default barriers are enabled
1846 if (ShenandoahVerifyOptoBarriers &&
1847 (!FLAG_IS_DEFAULT(ShenandoahSATBBarrier) ||
1848 !FLAG_IS_DEFAULT(ShenandoahLoadRefBarrier) ||
1849 !FLAG_IS_DEFAULT(ShenandoahKeepAliveBarrier) ||
1850 !FLAG_IS_DEFAULT(ShenandoahStoreValEnqueueBarrier) ||
1851 !FLAG_IS_DEFAULT(ShenandoahCASBarrier) ||
1852 !FLAG_IS_DEFAULT(ShenandoahCloneBarrier)
1853 )) {
1854 warning("Unusual barrier configuration, disabling C2 barrier verification");
1855 FLAG_SET_DEFAULT(ShenandoahVerifyOptoBarriers, false);
1856 }
1857 #else
1858 guarantee(!ShenandoahVerifyOptoBarriers, "Should be disabled");
1859 #endif // ASSERT
1860 #endif // COMPILER2
1861
1862 #if INCLUDE_ALL_GCS
1863 if (AlwaysPreTouch) {
1864 // Shenandoah handles pre-touch on its own. It does not let the
1865 // generic storage code to do the pre-touch before Shenandoah has
1866 // a chance to do it on its own.
1867 FLAG_SET_DEFAULT(AlwaysPreTouch, false);
1868 FLAG_SET_DEFAULT(ShenandoahAlwaysPreTouch, true);
1869 }
|
1716 tty->print_cr("ConcGCThreads: %u", (uint) ConcGCThreads);
1717 }
1718 }
1719
1720 void Arguments::set_shenandoah_gc_flags() {
1721
1722 #if !(defined AARCH64 || defined AMD64 || defined IA32)
1723 UNSUPPORTED_GC_OPTION(UseShenandoahGC);
1724 #endif
1725
1726 #if 0 // leave this block as stepping stone for future platforms
1727 warning("Shenandoah GC is not fully supported on this platform:");
1728 warning(" concurrent modes are not supported, only STW cycles are enabled;");
1729 warning(" arch-specific barrier code is not implemented, disabling barriers;");
1730
1731 #if INCLUDE_ALL_GCS
1732 FLAG_SET_DEFAULT(ShenandoahGCHeuristics, "passive");
1733
1734 FLAG_SET_DEFAULT(ShenandoahSATBBarrier, false);
1735 FLAG_SET_DEFAULT(ShenandoahLoadRefBarrier, false);
1736 FLAG_SET_DEFAULT(ShenandoahStoreValEnqueueBarrier, false);
1737 FLAG_SET_DEFAULT(ShenandoahCASBarrier, false);
1738 FLAG_SET_DEFAULT(ShenandoahCloneBarrier, false);
1739
1740 FLAG_SET_DEFAULT(ShenandoahVerifyOptoBarriers, false);
1741 #endif
1742 #endif
1743
1744 #if INCLUDE_ALL_GCS
1745 if (!FLAG_IS_DEFAULT(ShenandoahGarbageThreshold)) {
1746 if (0 > ShenandoahGarbageThreshold || ShenandoahGarbageThreshold > 100) {
1747 vm_exit_during_initialization("The flag -XX:ShenandoahGarbageThreshold is out of range", NULL);
1748 }
1749 }
1750
1751 if (!FLAG_IS_DEFAULT(ShenandoahAllocationThreshold)) {
1752 if (0 > ShenandoahAllocationThreshold || ShenandoahAllocationThreshold > 100) {
1753 vm_exit_during_initialization("The flag -XX:ShenandoahAllocationThreshold is out of range", NULL);
1754 }
1755 }
1828 // When sampling is enabled, max out the PerfData memory to get more
1829 // Shenandoah data in, including Matrix.
1830 FLAG_SET_DEFAULT(PerfDataMemorySize, 2048*K);
1831 }
1832 #endif
1833
1834 #ifdef COMPILER2
1835 // Shenandoah cares more about pause times, rather than raw throughput.
1836 // Enabling safepoints in counted loops makes it more responsive with
1837 // long loops. However, it is risky in 8u, due to bugs it brings, for
1838 // example JDK-8176506. Warn user about this, and proceed.
1839 if (UseCountedLoopSafepoints) {
1840 warning("Enabling -XX:UseCountedLoopSafepoints is known to cause JVM bugs. Use at your own risk.");
1841 }
1842
1843 #ifdef ASSERT
1844 // C2 barrier verification is only reliable when all default barriers are enabled
1845 if (ShenandoahVerifyOptoBarriers &&
1846 (!FLAG_IS_DEFAULT(ShenandoahSATBBarrier) ||
1847 !FLAG_IS_DEFAULT(ShenandoahLoadRefBarrier) ||
1848 !FLAG_IS_DEFAULT(ShenandoahStoreValEnqueueBarrier) ||
1849 !FLAG_IS_DEFAULT(ShenandoahCASBarrier) ||
1850 !FLAG_IS_DEFAULT(ShenandoahCloneBarrier)
1851 )) {
1852 warning("Unusual barrier configuration, disabling C2 barrier verification");
1853 FLAG_SET_DEFAULT(ShenandoahVerifyOptoBarriers, false);
1854 }
1855 #else
1856 guarantee(!ShenandoahVerifyOptoBarriers, "Should be disabled");
1857 #endif // ASSERT
1858 #endif // COMPILER2
1859
1860 #if INCLUDE_ALL_GCS
1861 if (AlwaysPreTouch) {
1862 // Shenandoah handles pre-touch on its own. It does not let the
1863 // generic storage code to do the pre-touch before Shenandoah has
1864 // a chance to do it on its own.
1865 FLAG_SET_DEFAULT(AlwaysPreTouch, false);
1866 FLAG_SET_DEFAULT(ShenandoahAlwaysPreTouch, true);
1867 }
|