src/share/vm/runtime/arguments.cpp

changeset 2660
924777755fad
parent 2658
c7f3d0b4570f
child 2698
38fea01eb669
child 2756
1dac0f3af89f
child 2782
9c4f56ff88e9
     1.1 --- a/src/share/vm/runtime/arguments.cpp	Mon Mar 21 14:06:50 2011 -0700
     1.2 +++ b/src/share/vm/runtime/arguments.cpp	Mon Mar 21 18:38:00 2011 -0700
     1.3 @@ -2819,22 +2819,38 @@
     1.4  }
     1.5  
     1.6  void Arguments::set_shared_spaces_flags() {
     1.7 +  const bool must_share = DumpSharedSpaces || RequireSharedSpaces;
     1.8 +  const bool might_share = must_share || UseSharedSpaces;
     1.9 +
    1.10 +  // The string table is part of the shared archive so the size must match.
    1.11 +  if (!FLAG_IS_DEFAULT(StringTableSize)) {
    1.12 +    // Disable sharing.
    1.13 +    if (must_share) {
    1.14 +      warning("disabling shared archive %s because of non-default "
    1.15 +              "StringTableSize", DumpSharedSpaces ? "creation" : "use");
    1.16 +    }
    1.17 +    if (might_share) {
    1.18 +      FLAG_SET_DEFAULT(DumpSharedSpaces, false);
    1.19 +      FLAG_SET_DEFAULT(RequireSharedSpaces, false);
    1.20 +      FLAG_SET_DEFAULT(UseSharedSpaces, false);
    1.21 +    }
    1.22 +    return;
    1.23 +  }
    1.24 +
    1.25    // Check whether class data sharing settings conflict with GC, compressed oops
    1.26    // or page size, and fix them up.  Explicit sharing options override other
    1.27    // settings.
    1.28    const bool cannot_share = UseConcMarkSweepGC || CMSIncrementalMode ||
    1.29      UseG1GC || UseParNewGC || UseParallelGC || UseParallelOldGC ||
    1.30      UseCompressedOops || UseLargePages && FLAG_IS_CMDLINE(UseLargePages);
    1.31 -  const bool must_share = DumpSharedSpaces || RequireSharedSpaces;
    1.32 -  const bool might_share = must_share || UseSharedSpaces;
    1.33    if (cannot_share) {
    1.34      if (must_share) {
    1.35 -      warning("selecting serial gc and disabling large pages %s"
    1.36 -              "because of %s", "" LP64_ONLY("and compressed oops "),
    1.37 -              DumpSharedSpaces ? "-Xshare:dump" : "-Xshare:on");
    1.38 -      force_serial_gc();
    1.39 -      FLAG_SET_CMDLINE(bool, UseLargePages, false);
    1.40 -      LP64_ONLY(FLAG_SET_CMDLINE(bool, UseCompressedOops, false));
    1.41 +        warning("selecting serial gc and disabling large pages %s"
    1.42 +                "because of %s", "" LP64_ONLY("and compressed oops "),
    1.43 +                DumpSharedSpaces ? "-Xshare:dump" : "-Xshare:on");
    1.44 +        force_serial_gc();
    1.45 +        FLAG_SET_CMDLINE(bool, UseLargePages, false);
    1.46 +        LP64_ONLY(FLAG_SET_CMDLINE(bool, UseCompressedOops, false));
    1.47      } else {
    1.48        if (UseSharedSpaces && Verbose) {
    1.49          warning("turning off use of shared archive because of "

mercurial