2682 #endif // PRODUCT
2683
2684 if (EnableInvokeDynamic && !EnableMethodHandles) {
2685 if (!FLAG_IS_DEFAULT(EnableMethodHandles)) {
2686 warning("forcing EnableMethodHandles true because EnableInvokeDynamic is true");
2687 }
2688 EnableMethodHandles = true;
2689 }
2690 if (EnableMethodHandles && !AnonymousClasses) {
2691 if (!FLAG_IS_DEFAULT(AnonymousClasses)) {
2692 warning("forcing AnonymousClasses true because EnableMethodHandles is true");
2693 }
2694 AnonymousClasses = true;
2695 }
2696 if ((EnableMethodHandles || AnonymousClasses) && ScavengeRootsInCode == 0) {
2697 if (!FLAG_IS_DEFAULT(ScavengeRootsInCode)) {
2698 warning("forcing ScavengeRootsInCode non-zero because EnableMethodHandles or AnonymousClasses is true");
2699 }
2700 ScavengeRootsInCode = 1;
2701 }
2702
2703 if (PrintGCDetails) {
2704 // Turn on -verbose:gc options as well
2705 PrintGC = true;
2706 if (FLAG_IS_DEFAULT(TraceClassUnloading)) {
2707 TraceClassUnloading = true;
2708 }
2709 }
2710
2711 #if defined(_LP64) && defined(COMPILER1)
2712 UseCompressedOops = false;
2713 #endif
2714
2715 #ifdef SERIALGC
2716 force_serial_gc();
2717 #endif // SERIALGC
2718 #ifdef KERNEL
2719 no_shared_spaces();
2720 #endif // KERNEL
2721
2722 // Set flags based on ergonomics.
2723 set_ergonomics_flags();
2724
2725 // Check the GC selections again.
2726 if (!check_gc_consistency()) {
2727 return JNI_EINVAL;
2728 }
2729
2730 if (UseConcMarkSweepGC) {
2731 // Set flags for CMS and ParNew. Check UseConcMarkSweep first
2732 // to ensure that when both UseConcMarkSweepGC and UseParNewGC
2733 // are true, we don't call set_parnew_gc_flags() as well.
2734 set_cms_and_parnew_gc_flags();
2735 } else {
2736 // Set heap size based on available physical memory
2737 set_heap_size();
2738 // Set per-collector flags
2739 if (UseParallelGC || UseParallelOldGC) {
2740 set_parallel_gc_flags();
2741 } else if (UseParNewGC) {
2742 set_parnew_gc_flags();
2743 } else if (UseG1GC) {
2744 set_g1_gc_flags();
|
2682 #endif // PRODUCT
2683
2684 if (EnableInvokeDynamic && !EnableMethodHandles) {
2685 if (!FLAG_IS_DEFAULT(EnableMethodHandles)) {
2686 warning("forcing EnableMethodHandles true because EnableInvokeDynamic is true");
2687 }
2688 EnableMethodHandles = true;
2689 }
2690 if (EnableMethodHandles && !AnonymousClasses) {
2691 if (!FLAG_IS_DEFAULT(AnonymousClasses)) {
2692 warning("forcing AnonymousClasses true because EnableMethodHandles is true");
2693 }
2694 AnonymousClasses = true;
2695 }
2696 if ((EnableMethodHandles || AnonymousClasses) && ScavengeRootsInCode == 0) {
2697 if (!FLAG_IS_DEFAULT(ScavengeRootsInCode)) {
2698 warning("forcing ScavengeRootsInCode non-zero because EnableMethodHandles or AnonymousClasses is true");
2699 }
2700 ScavengeRootsInCode = 1;
2701 }
2702 #ifdef COMPILER2
2703 if (EnableInvokeDynamic && DoEscapeAnalysis) {
2704 // TODO: We need to find rules for invokedynamic and EA. For now,
2705 // simply disable EA by default.
2706 if (FLAG_IS_DEFAULT(DoEscapeAnalysis)) {
2707 DoEscapeAnalysis = false;
2708 }
2709 }
2710 #endif
2711
2712 if (PrintGCDetails) {
2713 // Turn on -verbose:gc options as well
2714 PrintGC = true;
2715 if (FLAG_IS_DEFAULT(TraceClassUnloading)) {
2716 TraceClassUnloading = true;
2717 }
2718 }
2719
2720 #if defined(_LP64) && defined(COMPILER1)
2721 UseCompressedOops = false;
2722 #endif
2723
2724 #ifdef SERIALGC
2725 force_serial_gc();
2726 #endif // SERIALGC
2727 #ifdef KERNEL
2728 no_shared_spaces();
2729 #endif // KERNEL
2730
2731 // Set flags based on ergonomics.
2732 set_ergonomics_flags();
2733
2734 #ifdef _LP64
2735 // XXX JSR 292 currently does not support compressed oops.
2736 if (EnableMethodHandles && UseCompressedOops) {
2737 if (FLAG_IS_DEFAULT(UseCompressedOops) || FLAG_IS_ERGO(UseCompressedOops)) {
2738 UseCompressedOops = false;
2739 }
2740 }
2741 #endif // _LP64
2742
2743 // Check the GC selections again.
2744 if (!check_gc_consistency()) {
2745 return JNI_EINVAL;
2746 }
2747
2748 if (UseConcMarkSweepGC) {
2749 // Set flags for CMS and ParNew. Check UseConcMarkSweep first
2750 // to ensure that when both UseConcMarkSweepGC and UseParNewGC
2751 // are true, we don't call set_parnew_gc_flags() as well.
2752 set_cms_and_parnew_gc_flags();
2753 } else {
2754 // Set heap size based on available physical memory
2755 set_heap_size();
2756 // Set per-collector flags
2757 if (UseParallelGC || UseParallelOldGC) {
2758 set_parallel_gc_flags();
2759 } else if (UseParNewGC) {
2760 set_parnew_gc_flags();
2761 } else if (UseG1GC) {
2762 set_g1_gc_flags();
|