2649 #endif // PRODUCT
2650
2651 if (EnableInvokeDynamic && !EnableMethodHandles) {
2652 if (!FLAG_IS_DEFAULT(EnableMethodHandles)) {
2653 warning("forcing EnableMethodHandles true because EnableInvokeDynamic is true");
2654 }
2655 EnableMethodHandles = true;
2656 }
2657 if (EnableMethodHandles && !AnonymousClasses) {
2658 if (!FLAG_IS_DEFAULT(AnonymousClasses)) {
2659 warning("forcing AnonymousClasses true because EnableMethodHandles is true");
2660 }
2661 AnonymousClasses = true;
2662 }
2663 if ((EnableMethodHandles || AnonymousClasses) && ScavengeRootsInCode == 0) {
2664 if (!FLAG_IS_DEFAULT(ScavengeRootsInCode)) {
2665 warning("forcing ScavengeRootsInCode non-zero because EnableMethodHandles or AnonymousClasses is true");
2666 }
2667 ScavengeRootsInCode = 1;
2668 }
2669
2670 if (PrintGCDetails) {
2671 // Turn on -verbose:gc options as well
2672 PrintGC = true;
2673 if (FLAG_IS_DEFAULT(TraceClassUnloading)) {
2674 TraceClassUnloading = true;
2675 }
2676 }
2677
2678 #ifdef SERIALGC
2679 set_serial_gc_flags();
2680 #endif // SERIALGC
2681 #ifdef KERNEL
2682 no_shared_spaces();
2683 #endif // KERNEL
2684
2685 // Set flags based on ergonomics.
2686 set_ergonomics_flags();
2687
2688 // Check the GC selections again.
2689 if (!check_gc_consistency()) {
2690 return JNI_EINVAL;
2691 }
2692
2693 if (UseParallelGC || UseParallelOldGC) {
2694 // Set some flags for ParallelGC if needed.
2695 set_parallel_gc_flags();
2696 } else if (UseConcMarkSweepGC) {
2697 // Set some flags for CMS
2698 set_cms_and_parnew_gc_flags();
2699 } else if (UseParNewGC) {
2700 // Set some flags for ParNew
2701 set_parnew_gc_flags();
2702 } else if (UseG1GC) {
2703 // Set some flags for garbage-first, if needed.
2704 set_g1_gc_flags();
2705 }
2706
2707 #ifdef SERIALGC
|
2649 #endif // PRODUCT
2650
2651 if (EnableInvokeDynamic && !EnableMethodHandles) {
2652 if (!FLAG_IS_DEFAULT(EnableMethodHandles)) {
2653 warning("forcing EnableMethodHandles true because EnableInvokeDynamic is true");
2654 }
2655 EnableMethodHandles = true;
2656 }
2657 if (EnableMethodHandles && !AnonymousClasses) {
2658 if (!FLAG_IS_DEFAULT(AnonymousClasses)) {
2659 warning("forcing AnonymousClasses true because EnableMethodHandles is true");
2660 }
2661 AnonymousClasses = true;
2662 }
2663 if ((EnableMethodHandles || AnonymousClasses) && ScavengeRootsInCode == 0) {
2664 if (!FLAG_IS_DEFAULT(ScavengeRootsInCode)) {
2665 warning("forcing ScavengeRootsInCode non-zero because EnableMethodHandles or AnonymousClasses is true");
2666 }
2667 ScavengeRootsInCode = 1;
2668 }
2669 #ifdef COMPILER2
2670 if (EnableInvokeDynamic && DoEscapeAnalysis) {
2671 // TODO: We need to find rules for invokedynamic and EA. For now,
2672 // simply disable EA by default.
2673 if (FLAG_IS_DEFAULT(DoEscapeAnalysis)) {
2674 DoEscapeAnalysis = false;
2675 }
2676 }
2677 #endif
2678
2679 if (PrintGCDetails) {
2680 // Turn on -verbose:gc options as well
2681 PrintGC = true;
2682 if (FLAG_IS_DEFAULT(TraceClassUnloading)) {
2683 TraceClassUnloading = true;
2684 }
2685 }
2686
2687 #ifdef SERIALGC
2688 set_serial_gc_flags();
2689 #endif // SERIALGC
2690 #ifdef KERNEL
2691 no_shared_spaces();
2692 #endif // KERNEL
2693
2694 // Set flags based on ergonomics.
2695 set_ergonomics_flags();
2696
2697 #ifdef _LP64
2698 // XXX JSR 292 currently does not support compressed oops.
2699 if (EnableMethodHandles && UseCompressedOops) {
2700 if (FLAG_IS_DEFAULT(UseCompressedOops) || FLAG_IS_ERGO(UseCompressedOops)) {
2701 UseCompressedOops = false;
2702 }
2703 }
2704 #endif // _LP64
2705
2706 // Check the GC selections again.
2707 if (!check_gc_consistency()) {
2708 return JNI_EINVAL;
2709 }
2710
2711 if (UseParallelGC || UseParallelOldGC) {
2712 // Set some flags for ParallelGC if needed.
2713 set_parallel_gc_flags();
2714 } else if (UseConcMarkSweepGC) {
2715 // Set some flags for CMS
2716 set_cms_and_parnew_gc_flags();
2717 } else if (UseParNewGC) {
2718 // Set some flags for ParNew
2719 set_parnew_gc_flags();
2720 } else if (UseG1GC) {
2721 // Set some flags for garbage-first, if needed.
2722 set_g1_gc_flags();
2723 }
2724
2725 #ifdef SERIALGC
|