< prev index next >

src/share/vm/runtime/arguments.cpp

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


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


4165 void Arguments::PropertyList_add(SystemProperty** plist, SystemProperty *new_p) {
4166   SystemProperty* p = *plist;
4167   if (p == NULL) {
4168     *plist = new_p;
4169   } else {
4170     while (p->next() != NULL) {
4171       p = p->next();
4172     }
4173     p->set_next(new_p);
4174   }
4175 }
4176 
4177 void Arguments::PropertyList_add(SystemProperty** plist, const char* k, char* v) {
4178   if (plist == NULL)
4179     return;
4180 
4181   SystemProperty* new_p = new SystemProperty(k, v, true);
4182   PropertyList_add(plist, new_p);
4183 }
4184 




4185 // This add maintains unique property key in the list.
4186 void Arguments::PropertyList_unique_add(SystemProperty** plist, const char* k, char* v, jboolean append) {
4187   if (plist == NULL)
4188     return;
4189 
4190   // If property key exist then update with new value.
4191   SystemProperty* prop;
4192   for (prop = *plist; prop != NULL; prop = prop->next()) {
4193     if (strcmp(k, prop->key()) == 0) {
4194       if (append) {
4195         prop->append_value(v);
4196       } else {
4197         prop->set_value(v);
4198       }
4199       return;
4200     }
4201   }
4202 
4203   PropertyList_add(plist, k, v);
4204 }




1545     }
1546     return true;
1547   }
1548   return false;
1549 }
1550 
1551 void Arguments::set_use_compressed_oops() {
1552 #ifndef ZERO
1553 #ifdef _LP64
1554   // MaxHeapSize is not set up properly at this point, but
1555   // the only value that can override MaxHeapSize if we are
1556   // to use UseCompressedOops is InitialHeapSize.
1557   size_t max_heap_size = MAX2(MaxHeapSize, InitialHeapSize);
1558 
1559   if (max_heap_size <= max_heap_for_compressed_oops()) {
1560 #if !defined(COMPILER1) || defined(TIERED)
1561     if (FLAG_IS_DEFAULT(UseCompressedOops)) {
1562       FLAG_SET_ERGO(bool, UseCompressedOops, true);
1563     }
1564 #endif









1565   } else {
1566     if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) {
1567       warning("Max heap size too large for Compressed Oops");
1568       FLAG_SET_DEFAULT(UseCompressedOops, false);
1569       FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
1570     }
1571   }
1572 #endif // _LP64
1573 #endif // ZERO
1574 }
1575 
1576 
1577 // NOTE: set_use_compressed_klass_ptrs() must be called after calling
1578 // set_use_compressed_oops().
1579 void Arguments::set_use_compressed_klass_ptrs() {
1580 #ifndef ZERO
1581 #ifdef _LP64
1582   // UseCompressedOops must be on for UseCompressedClassPointers to be on.
1583   if (!UseCompressedOops) {
1584     if (UseCompressedClassPointers) {


4156 void Arguments::PropertyList_add(SystemProperty** plist, SystemProperty *new_p) {
4157   SystemProperty* p = *plist;
4158   if (p == NULL) {
4159     *plist = new_p;
4160   } else {
4161     while (p->next() != NULL) {
4162       p = p->next();
4163     }
4164     p->set_next(new_p);
4165   }
4166 }
4167 
4168 void Arguments::PropertyList_add(SystemProperty** plist, const char* k, char* v) {
4169   if (plist == NULL)
4170     return;
4171 
4172   SystemProperty* new_p = new SystemProperty(k, v, true);
4173   PropertyList_add(plist, new_p);
4174 }
4175 
4176 void Arguments::PropertyList_add(SystemProperty *element) {
4177   PropertyList_add(&_system_properties, element);
4178 }
4179 
4180 // This add maintains unique property key in the list.
4181 void Arguments::PropertyList_unique_add(SystemProperty** plist, const char* k, char* v, jboolean append) {
4182   if (plist == NULL)
4183     return;
4184 
4185   // If property key exist then update with new value.
4186   SystemProperty* prop;
4187   for (prop = *plist; prop != NULL; prop = prop->next()) {
4188     if (strcmp(k, prop->key()) == 0) {
4189       if (append) {
4190         prop->append_value(v);
4191       } else {
4192         prop->set_value(v);
4193       }
4194       return;
4195     }
4196   }
4197 
4198   PropertyList_add(plist, k, v);
4199 }


< prev index next >