3082 } |
3082 } |
3083 return JNI_OK; |
3083 return JNI_OK; |
3084 } |
3084 } |
3085 |
3085 |
3086 void Arguments::set_shared_spaces_flags() { |
3086 void Arguments::set_shared_spaces_flags() { |
3087 const bool must_share = DumpSharedSpaces || RequireSharedSpaces; |
3087 #ifdef _LP64 |
3088 const bool might_share = must_share || UseSharedSpaces; |
3088 const bool must_share = DumpSharedSpaces || RequireSharedSpaces; |
3089 |
3089 |
3090 // CompressedOops cannot be used with CDS. The offsets of oopmaps and |
3090 // CompressedOops cannot be used with CDS. The offsets of oopmaps and |
3091 // static fields are incorrect in the archive. With some more clever |
3091 // static fields are incorrect in the archive. With some more clever |
3092 // initialization, this restriction can probably be lifted. |
3092 // initialization, this restriction can probably be lifted. |
3093 // ??? UseLargePages might be okay now |
3093 if (UseCompressedOops) { |
3094 const bool cannot_share = UseCompressedOops || |
3094 if (must_share) { |
3095 (UseLargePages && FLAG_IS_CMDLINE(UseLargePages)); |
3095 warning("disabling compressed oops because of %s", |
3096 if (cannot_share) { |
3096 DumpSharedSpaces ? "-Xshare:dump" : "-Xshare:on"); |
3097 if (must_share) { |
3097 FLAG_SET_CMDLINE(bool, UseCompressedOops, false); |
3098 warning("disabling large pages %s" |
3098 FLAG_SET_CMDLINE(bool, UseCompressedKlassPointers, false); |
3099 "because of %s", "" LP64_ONLY("and compressed oops "), |
3099 } else { |
3100 DumpSharedSpaces ? "-Xshare:dump" : "-Xshare:on"); |
3100 // Prefer compressed oops to class data sharing |
3101 FLAG_SET_CMDLINE(bool, UseLargePages, false); |
3101 if (UseSharedSpaces && Verbose) { |
3102 LP64_ONLY(FLAG_SET_CMDLINE(bool, UseCompressedOops, false)); |
3102 warning("turning off use of shared archive because of compressed oops"); |
3103 LP64_ONLY(FLAG_SET_CMDLINE(bool, UseCompressedKlassPointers, false)); |
3103 } |
3104 } else { |
3104 no_shared_spaces(); |
3105 // Prefer compressed oops and large pages to class data sharing |
3105 } |
3106 if (UseSharedSpaces && Verbose) { |
3106 } |
3107 warning("turning off use of shared archive because of large pages%s", |
3107 #endif |
3108 "" LP64_ONLY(" and/or compressed oops")); |
|
3109 } |
|
3110 no_shared_spaces(); |
|
3111 } |
|
3112 } else if (UseLargePages && might_share) { |
|
3113 // Disable large pages to allow shared spaces. This is sub-optimal, since |
|
3114 // there may not even be a shared archive to use. |
|
3115 FLAG_SET_DEFAULT(UseLargePages, false); |
|
3116 } |
|
3117 |
3108 |
3118 if (DumpSharedSpaces) { |
3109 if (DumpSharedSpaces) { |
3119 if (RequireSharedSpaces) { |
3110 if (RequireSharedSpaces) { |
3120 warning("cannot dump shared archive while using shared archive"); |
3111 warning("cannot dump shared archive while using shared archive"); |
3121 } |
3112 } |