< prev index next >

src/share/vm/runtime/arguments.cpp

Print this page
rev 7386 : 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) {


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




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




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) {


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


< prev index next >