< prev index next >

src/share/vm/runtime/arguments.cpp

Print this page
rev 7462 : 8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.


1557     }
1558     return true;
1559   }
1560   return false;
1561 }
1562 
1563 void Arguments::set_use_compressed_oops() {
1564 #ifndef ZERO
1565 #ifdef _LP64
1566   // MaxHeapSize is not set up properly at this point, but
1567   // the only value that can override MaxHeapSize if we are
1568   // to use UseCompressedOops is InitialHeapSize.
1569   size_t max_heap_size = MAX2(MaxHeapSize, InitialHeapSize);
1570 
1571   if (max_heap_size <= max_heap_for_compressed_oops()) {
1572 #if !defined(COMPILER1) || defined(TIERED)
1573     if (FLAG_IS_DEFAULT(UseCompressedOops)) {
1574       FLAG_SET_ERGO(bool, UseCompressedOops, true);
1575     }
1576 #endif
1577 #ifdef _WIN64
1578     if (UseLargePages && UseCompressedOops) {
1579       // Cannot allocate guard pages for implicit checks in indexed addressing
1580       // mode, when large pages are specified on windows.
1581       // This flag could be switched ON if narrow oop base address is set to 0,
1582       // see code in Universe::initialize_heap().
1583       Universe::set_narrow_oop_use_implicit_null_checks(false);
1584     }
1585 #endif //  _WIN64
1586   } else {
1587     if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) {
1588       warning("Max heap size too large for Compressed Oops");
1589       FLAG_SET_DEFAULT(UseCompressedOops, false);
1590       FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
1591     }
1592   }
1593 #endif // _LP64
1594 #endif // ZERO
1595 }
1596 
1597 
1598 // NOTE: set_use_compressed_klass_ptrs() must be called after calling
1599 // set_use_compressed_oops().
1600 void Arguments::set_use_compressed_klass_ptrs() {
1601 #ifndef ZERO
1602 #ifdef _LP64
1603   // UseCompressedOops must be on for UseCompressedClassPointers to be on.
1604   if (!UseCompressedOops) {
1605     if (UseCompressedClassPointers) {


4132 void Arguments::PropertyList_add(SystemProperty** plist, SystemProperty *new_p) {
4133   SystemProperty* p = *plist;
4134   if (p == NULL) {
4135     *plist = new_p;
4136   } else {
4137     while (p->next() != NULL) {
4138       p = p->next();
4139     }
4140     p->set_next(new_p);
4141   }
4142 }
4143 
4144 void Arguments::PropertyList_add(SystemProperty** plist, const char* k, char* v) {
4145   if (plist == NULL)
4146     return;
4147 
4148   SystemProperty* new_p = new SystemProperty(k, v, true);
4149   PropertyList_add(plist, new_p);
4150 }
4151 




4152 // This add maintains unique property key in the list.
4153 void Arguments::PropertyList_unique_add(SystemProperty** plist, const char* k, char* v, jboolean append) {
4154   if (plist == NULL)
4155     return;
4156 
4157   // If property key exist then update with new value.
4158   SystemProperty* prop;
4159   for (prop = *plist; prop != NULL; prop = prop->next()) {
4160     if (strcmp(k, prop->key()) == 0) {
4161       if (append) {
4162         prop->append_value(v);
4163       } else {
4164         prop->set_value(v);
4165       }
4166       return;
4167     }
4168   }
4169 
4170   PropertyList_add(plist, k, v);
4171 }




1557     }
1558     return true;
1559   }
1560   return false;
1561 }
1562 
1563 void Arguments::set_use_compressed_oops() {
1564 #ifndef ZERO
1565 #ifdef _LP64
1566   // MaxHeapSize is not set up properly at this point, but
1567   // the only value that can override MaxHeapSize if we are
1568   // to use UseCompressedOops is InitialHeapSize.
1569   size_t max_heap_size = MAX2(MaxHeapSize, InitialHeapSize);
1570 
1571   if (max_heap_size <= max_heap_for_compressed_oops()) {
1572 #if !defined(COMPILER1) || defined(TIERED)
1573     if (FLAG_IS_DEFAULT(UseCompressedOops)) {
1574       FLAG_SET_ERGO(bool, UseCompressedOops, true);
1575     }
1576 #endif









1577   } else {
1578     if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) {
1579       warning("Max heap size too large for Compressed Oops");
1580       FLAG_SET_DEFAULT(UseCompressedOops, false);
1581       FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
1582     }
1583   }
1584 #endif // _LP64
1585 #endif // ZERO
1586 }
1587 
1588 
1589 // NOTE: set_use_compressed_klass_ptrs() must be called after calling
1590 // set_use_compressed_oops().
1591 void Arguments::set_use_compressed_klass_ptrs() {
1592 #ifndef ZERO
1593 #ifdef _LP64
1594   // UseCompressedOops must be on for UseCompressedClassPointers to be on.
1595   if (!UseCompressedOops) {
1596     if (UseCompressedClassPointers) {


4123 void Arguments::PropertyList_add(SystemProperty** plist, SystemProperty *new_p) {
4124   SystemProperty* p = *plist;
4125   if (p == NULL) {
4126     *plist = new_p;
4127   } else {
4128     while (p->next() != NULL) {
4129       p = p->next();
4130     }
4131     p->set_next(new_p);
4132   }
4133 }
4134 
4135 void Arguments::PropertyList_add(SystemProperty** plist, const char* k, char* v) {
4136   if (plist == NULL)
4137     return;
4138 
4139   SystemProperty* new_p = new SystemProperty(k, v, true);
4140   PropertyList_add(plist, new_p);
4141 }
4142 
4143 void Arguments::PropertyList_add(SystemProperty *element) {
4144   PropertyList_add(&_system_properties, element);
4145 }
4146 
4147 // This add maintains unique property key in the list.
4148 void Arguments::PropertyList_unique_add(SystemProperty** plist, const char* k, char* v, jboolean append) {
4149   if (plist == NULL)
4150     return;
4151 
4152   // If property key exist then update with new value.
4153   SystemProperty* prop;
4154   for (prop = *plist; prop != NULL; prop = prop->next()) {
4155     if (strcmp(k, prop->key()) == 0) {
4156       if (append) {
4157         prop->append_value(v);
4158       } else {
4159         prop->set_value(v);
4160       }
4161       return;
4162     }
4163   }
4164 
4165   PropertyList_add(plist, k, v);
4166 }


< prev index next >