src/share/vm/runtime/arguments.cpp

changeset 4222
d2582a08fa5d
parent 4221
6ba00f89fbe1
parent 4168
5876f980ea19
child 4224
acabb5c282f5
     1.1 --- a/src/share/vm/runtime/arguments.cpp	Thu Oct 11 15:29:16 2012 -0700
     1.2 +++ b/src/share/vm/runtime/arguments.cpp	Thu Oct 18 21:58:55 2012 -0700
     1.3 @@ -1066,7 +1066,7 @@
     1.4    }
     1.5  }
     1.6  
     1.7 -#ifndef KERNEL
     1.8 +#if INCLUDE_ALTERNATE_GCS
     1.9  static void disable_adaptive_size_policy(const char* collector_name) {
    1.10    if (UseAdaptiveSizePolicy) {
    1.11      if (FLAG_IS_CMDLINE(UseAdaptiveSizePolicy)) {
    1.12 @@ -1141,7 +1141,7 @@
    1.13      FLAG_SET_ERGO(bool, UseParNewGC, true);
    1.14    }
    1.15  
    1.16 -  // Turn off AdaptiveSizePolicy for CMS until it is complete.
    1.17 +  // Turn off AdaptiveSizePolicy by default for cms until it is complete.
    1.18    disable_adaptive_size_policy("UseConcMarkSweepGC");
    1.19  
    1.20    // In either case, adjust ParallelGCThreads and/or UseParNewGC
    1.21 @@ -1283,7 +1283,7 @@
    1.22      tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
    1.23    }
    1.24  }
    1.25 -#endif // KERNEL
    1.26 +#endif // INCLUDE_ALTERNATE_GCS
    1.27  
    1.28  void set_object_alignment() {
    1.29    // Object alignment.
    1.30 @@ -1300,10 +1300,10 @@
    1.31    // Oop encoding heap max
    1.32    OopEncodingHeapMax = (uint64_t(max_juint) + 1) << LogMinObjAlignmentInBytes;
    1.33  
    1.34 -#ifndef KERNEL
    1.35 +#if INCLUDE_ALTERNATE_GCS
    1.36    // Set CMS global values
    1.37    CompactibleFreeListSpace::set_cms_values();
    1.38 -#endif // KERNEL
    1.39 +#endif // INCLUDE_ALTERNATE_GCS
    1.40  }
    1.41  
    1.42  bool verify_object_alignment() {
    1.43 @@ -1423,10 +1423,9 @@
    1.44      FLAG_SET_DEFAULT(UseCompressedKlassPointers, false);
    1.45    } else {
    1.46      // Turn on UseCompressedKlassPointers too
    1.47 -    // The compiler is broken for this so turn it on when the compiler is fixed.
    1.48 -    // if (FLAG_IS_DEFAULT(UseCompressedKlassPointers)) {
    1.49 -    //   FLAG_SET_ERGO(bool, UseCompressedKlassPointers, true);
    1.50 -    // }
    1.51 +    if (FLAG_IS_DEFAULT(UseCompressedKlassPointers)) {
    1.52 +      FLAG_SET_ERGO(bool, UseCompressedKlassPointers, true);
    1.53 +    }
    1.54      // Set the ClassMetaspaceSize to something that will not need to be
    1.55      // expanded, since it cannot be expanded.
    1.56      if (UseCompressedKlassPointers && FLAG_IS_DEFAULT(ClassMetaspaceSize)) {
    1.57 @@ -1991,9 +1990,15 @@
    1.58    }
    1.59  #endif // SPARC
    1.60  
    1.61 -  if (PrintNMTStatistics && MemTracker::tracking_level() == MemTracker::NMT_off) {
    1.62 -    warning("PrintNMTStatistics is disabled, because native memory tracking is not enabled");
    1.63 -    PrintNMTStatistics = false;
    1.64 +  if (PrintNMTStatistics) {
    1.65 +#if INCLUDE_NMT
    1.66 +    if (MemTracker::tracking_level() == MemTracker::NMT_off) {
    1.67 +#endif // INCLUDE_NMT
    1.68 +      warning("PrintNMTStatistics is disabled, because native memory tracking is not enabled");
    1.69 +      PrintNMTStatistics = false;
    1.70 +#if INCLUDE_NMT
    1.71 +    }
    1.72 +#endif
    1.73    }
    1.74  
    1.75    return status;
    1.76 @@ -2220,12 +2225,12 @@
    1.77            size_t len2 = strlen(pos+1) + 1; // options start after ':'.  Final zero must be copied.
    1.78            options = (char*)memcpy(NEW_C_HEAP_ARRAY(char, len2, mtInternal), pos+1, len2);
    1.79          }
    1.80 -#ifdef JVMTI_KERNEL
    1.81 +#if !INCLUDE_JVMTI
    1.82          if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) {
    1.83 -          warning("profiling and debugging agents are not supported with Kernel VM");
    1.84 +          warning("profiling and debugging agents are not supported in this VM");
    1.85          } else
    1.86 -#endif // JVMTI_KERNEL
    1.87 -        add_init_library(name, options);
    1.88 +#endif // !INCLUDE_JVMTI
    1.89 +          add_init_library(name, options);
    1.90        }
    1.91      // -agentlib and -agentpath
    1.92      } else if (match_option(option, "-agentlib:", &tail) ||
    1.93 @@ -2240,20 +2245,24 @@
    1.94          if(pos != NULL) {
    1.95            options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(pos + 1) + 1, mtInternal), pos + 1);
    1.96          }
    1.97 -#ifdef JVMTI_KERNEL
    1.98 +#if !INCLUDE_JVMTI
    1.99          if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) {
   1.100 -          warning("profiling and debugging agents are not supported with Kernel VM");
   1.101 +          warning("profiling and debugging agents are not supported in this VM");
   1.102          } else
   1.103 -#endif // JVMTI_KERNEL
   1.104 +#endif // !INCLUDE_JVMTI
   1.105          add_init_agent(name, options, is_absolute_path);
   1.106  
   1.107        }
   1.108      // -javaagent
   1.109      } else if (match_option(option, "-javaagent:", &tail)) {
   1.110 +#if !INCLUDE_JVMTI
   1.111 +      warning("Instrumentation agents are not supported in this VM");
   1.112 +#else
   1.113        if(tail != NULL) {
   1.114          char *options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(tail) + 1, mtInternal), tail);
   1.115          add_init_agent("instrument", options, false);
   1.116        }
   1.117 +#endif // !INCLUDE_JVMTI
   1.118      // -Xnoclassgc
   1.119      } else if (match_option(option, "-Xnoclassgc", &tail)) {
   1.120        FLAG_SET_CMDLINE(bool, ClassUnloading, false);
   1.121 @@ -2385,12 +2394,12 @@
   1.122            // EVM option, ignore silently for compatibility
   1.123      // -Xprof
   1.124      } else if (match_option(option, "-Xprof", &tail)) {
   1.125 -#ifndef FPROF_KERNEL
   1.126 +#if INCLUDE_FPROF
   1.127        _has_profile = true;
   1.128 -#else // FPROF_KERNEL
   1.129 +#else // INCLUDE_FPROF
   1.130        // do we have to exit?
   1.131 -      warning("Kernel VM does not support flat profiling.");
   1.132 -#endif // FPROF_KERNEL
   1.133 +      warning("Flat profiling is not supported in this VM.");
   1.134 +#endif // INCLUDE_FPROF
   1.135      // -Xaprof
   1.136      } else if (match_option(option, "-Xaprof", &tail)) {
   1.137        _has_alloc_profile = true;
   1.138 @@ -2438,6 +2447,9 @@
   1.139  #if defined(KERNEL)
   1.140        vm_exit_during_initialization(
   1.141            "Dumping a shared archive is not supported on the Kernel JVM.", NULL);
   1.142 +#elif !INCLUDE_CDS
   1.143 +      vm_exit_during_initialization(
   1.144 +          "Dumping a shared archive is not supported in this VM.", NULL);
   1.145  #else
   1.146        FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true);
   1.147        set_mode_flags(_int);     // Prevent compilation, which creates objects
   1.148 @@ -2490,7 +2502,11 @@
   1.149      // JNI hooks
   1.150      } else if (match_option(option, "-Xcheck", &tail)) {
   1.151        if (!strcmp(tail, ":jni")) {
   1.152 +#if !INCLUDE_JNI_CHECK
   1.153 +        warning("JNI CHECKING is not supported in this VM");
   1.154 +#else
   1.155          CheckJNICalls = true;
   1.156 +#endif // INCLUDE_JNI_CHECK
   1.157        } else if (is_bad_option(option, args->ignoreUnrecognized,
   1.158                                       "check")) {
   1.159          return JNI_EINVAL;
   1.160 @@ -3045,7 +3061,11 @@
   1.161        vm_exit(0);
   1.162      }
   1.163      if (match_option(option, "-XX:NativeMemoryTracking", &tail)) {
   1.164 +#if INCLUDE_NMT
   1.165        MemTracker::init_tracking_options(tail);
   1.166 +#else
   1.167 +      warning("Native Memory Tracking is not supported in this VM");
   1.168 +#endif
   1.169      }
   1.170  
   1.171  
   1.172 @@ -3108,6 +3128,21 @@
   1.173    UNSUPPORTED_OPTION(UseG1GC, "G1 GC");
   1.174  #endif
   1.175  
   1.176 +#if !INCLUDE_ALTERNATE_GCS
   1.177 +  if (UseParallelGC) {
   1.178 +    warning("Parallel GC is not supported in this VM.  Using Serial GC.");
   1.179 +  }
   1.180 +  if (UseParallelOldGC) {
   1.181 +    warning("Parallel Old GC is not supported in this VM.  Using Serial GC.");
   1.182 +  }
   1.183 +  if (UseConcMarkSweepGC) {
   1.184 +    warning("Concurrent Mark Sweep GC is not supported in this VM.  Using Serial GC.");
   1.185 +  }
   1.186 +  if (UseParNewGC) {
   1.187 +    warning("Par New GC is not supported in this VM.  Using Serial GC.");
   1.188 +  }
   1.189 +#endif // INCLUDE_ALTERNATE_GCS
   1.190 +
   1.191  #ifndef PRODUCT
   1.192    if (TraceBytecodesAt != 0) {
   1.193      TraceBytecodes = true;
   1.194 @@ -3156,9 +3191,9 @@
   1.195  #ifdef SERIALGC
   1.196    force_serial_gc();
   1.197  #endif // SERIALGC
   1.198 -#ifdef KERNEL
   1.199 +#if !INCLUDE_CDS
   1.200    no_shared_spaces();
   1.201 -#endif // KERNEL
   1.202 +#endif // INCLUDE_CDS
   1.203  
   1.204    // Set flags based on ergonomics.
   1.205    set_ergonomics_flags();
   1.206 @@ -3180,9 +3215,10 @@
   1.207      }
   1.208    }
   1.209  
   1.210 -#ifndef KERNEL
   1.211    // Set heap size based on available physical memory
   1.212    set_heap_size();
   1.213 +
   1.214 +#if INCLUDE_ALTERNATE_GCS
   1.215    // Set per-collector flags
   1.216    if (UseParallelGC || UseParallelOldGC) {
   1.217      set_parallel_gc_flags();
   1.218 @@ -3193,7 +3229,7 @@
   1.219    } else if (UseG1GC) {
   1.220      set_g1_gc_flags();
   1.221    }
   1.222 -#endif // KERNEL
   1.223 +#endif // INCLUDE_ALTERNATE_GCS
   1.224  
   1.225  #ifdef SERIALGC
   1.226    assert(verify_serial_gc_flags(), "SerialGC unset");

mercurial