hotspot/src/share/vm/runtime/arguments.cpp
changeset 5694 1e0532a6abff
parent 5419 f2e8cc8c12ea
child 5702 201c5cde25bb
equal deleted inserted replaced
5693:3015c564fcbc 5694:1e0532a6abff
  1209     tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
  1209     tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
  1210   }
  1210   }
  1211 }
  1211 }
  1212 #endif // KERNEL
  1212 #endif // KERNEL
  1213 
  1213 
       
  1214 void set_object_alignment() {
       
  1215   // Object alignment.
       
  1216   assert(is_power_of_2(ObjectAlignmentInBytes), "ObjectAlignmentInBytes must be power of 2");
       
  1217   MinObjAlignmentInBytes     = ObjectAlignmentInBytes;
       
  1218   assert(MinObjAlignmentInBytes >= HeapWordsPerLong * HeapWordSize, "ObjectAlignmentInBytes value is too small");
       
  1219   MinObjAlignment            = MinObjAlignmentInBytes / HeapWordSize;
       
  1220   assert(MinObjAlignmentInBytes == MinObjAlignment * HeapWordSize, "ObjectAlignmentInBytes value is incorrect");
       
  1221   MinObjAlignmentInBytesMask = MinObjAlignmentInBytes - 1;
       
  1222 
       
  1223   LogMinObjAlignmentInBytes  = exact_log2(ObjectAlignmentInBytes);
       
  1224   LogMinObjAlignment         = LogMinObjAlignmentInBytes - LogHeapWordSize;
       
  1225 
       
  1226   // Oop encoding heap max
       
  1227   OopEncodingHeapMax = (uint64_t(max_juint) + 1) << LogMinObjAlignmentInBytes;
       
  1228 
       
  1229 #ifndef KERNEL
       
  1230   // Set CMS global values
       
  1231   CompactibleFreeListSpace::set_cms_values();
       
  1232 #endif // KERNEL
       
  1233 }
       
  1234 
       
  1235 bool verify_object_alignment() {
       
  1236   // Object alignment.
       
  1237   if (!is_power_of_2(ObjectAlignmentInBytes)) {
       
  1238     jio_fprintf(defaultStream::error_stream(),
       
  1239                 "error: ObjectAlignmentInBytes=%d must be power of 2", (int)ObjectAlignmentInBytes);
       
  1240     return false;
       
  1241   }
       
  1242   if ((int)ObjectAlignmentInBytes < BytesPerLong) {
       
  1243     jio_fprintf(defaultStream::error_stream(),
       
  1244                 "error: ObjectAlignmentInBytes=%d must be greater or equal %d", (int)ObjectAlignmentInBytes, BytesPerLong);
       
  1245     return false;
       
  1246   }
       
  1247   return true;
       
  1248 }
       
  1249 
  1214 inline uintx max_heap_for_compressed_oops() {
  1250 inline uintx max_heap_for_compressed_oops() {
  1215   LP64_ONLY(return oopDesc::OopEncodingHeapMax - MaxPermSize - os::vm_page_size());
  1251   LP64_ONLY(return OopEncodingHeapMax - MaxPermSize - os::vm_page_size());
  1216   NOT_LP64(ShouldNotReachHere(); return 0);
  1252   NOT_LP64(ShouldNotReachHere(); return 0);
  1217 }
  1253 }
  1218 
  1254 
  1219 bool Arguments::should_auto_select_low_pause_collector() {
  1255 bool Arguments::should_auto_select_low_pause_collector() {
  1220   if (UseAutoGCSelectPolicy &&
  1256   if (UseAutoGCSelectPolicy &&
  1773 
  1809 
  1774   // Limit the lower bound of this flag to 1 as it is used in a division
  1810   // Limit the lower bound of this flag to 1 as it is used in a division
  1775   // expression.
  1811   // expression.
  1776   status = status && verify_interval(TLABWasteTargetPercent,
  1812   status = status && verify_interval(TLABWasteTargetPercent,
  1777                                      1, 100, "TLABWasteTargetPercent");
  1813                                      1, 100, "TLABWasteTargetPercent");
       
  1814 
       
  1815   status = status && verify_object_alignment();
  1778 
  1816 
  1779   return status;
  1817   return status;
  1780 }
  1818 }
  1781 
  1819 
  1782 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
  1820 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
  2846 
  2884 
  2847 #if defined(_LP64) && defined(COMPILER1)
  2885 #if defined(_LP64) && defined(COMPILER1)
  2848   UseCompressedOops = false;
  2886   UseCompressedOops = false;
  2849 #endif
  2887 #endif
  2850 
  2888 
       
  2889   // Set object alignment values.
       
  2890   set_object_alignment();
       
  2891 
  2851 #ifdef SERIALGC
  2892 #ifdef SERIALGC
  2852   force_serial_gc();
  2893   force_serial_gc();
  2853 #endif // SERIALGC
  2894 #endif // SERIALGC
  2854 #ifdef KERNEL
  2895 #ifdef KERNEL
  2855   no_shared_spaces();
  2896   no_shared_spaces();