< prev index next >

src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp

Print this page

 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #include "precompiled.hpp"
 26 #include "runtime/flags/jvmFlag.hpp"
 27 #include "runtime/flags/jvmFlagLimit.hpp"
 28 #include "runtime/flags/jvmFlagConstraintsRuntime.hpp"
 29 #include "runtime/globals.hpp"
 30 #include "runtime/os.hpp"
 31 #include "runtime/safepointMechanism.hpp"
 32 #include "runtime/task.hpp"
 33 #include "utilities/powerOfTwo.hpp"
 34 















 35 JVMFlag::Error ObjectAlignmentInBytesConstraintFunc(int value, bool verbose) {
 36   if (!is_power_of_2(value)) {
 37     JVMFlag::printError(verbose,
 38                         "ObjectAlignmentInBytes (%d) must be "
 39                         "power of 2\n",
 40                         value);
 41     return JVMFlag::VIOLATES_CONSTRAINT;
 42   }
 43   // In case page size is very small.
 44   if (value >= (intx)os::vm_page_size()) {
 45     JVMFlag::printError(verbose,
 46                         "ObjectAlignmentInBytes (%d) must be "
 47                         "less than page size (" SIZE_FORMAT ")\n",
 48                         value, os::vm_page_size());
 49     return JVMFlag::VIOLATES_CONSTRAINT;
 50   }
 51   return JVMFlag::SUCCESS;
 52 }
 53 
 54 // Need to enforce the padding not to break the existing field alignments.

 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #include "precompiled.hpp"
 26 #include "runtime/flags/jvmFlag.hpp"
 27 #include "runtime/flags/jvmFlagLimit.hpp"
 28 #include "runtime/flags/jvmFlagConstraintsRuntime.hpp"
 29 #include "runtime/globals.hpp"
 30 #include "runtime/os.hpp"
 31 #include "runtime/safepointMechanism.hpp"
 32 #include "runtime/task.hpp"
 33 #include "utilities/powerOfTwo.hpp"
 34 
 35 JVMFlag::Error AOTModeConstraintFunc(ccstr value, bool verbose) {
 36   if (strcmp(value, "off") != 0 && 
 37       strcmp(value, "record") != 0 && 
 38       strcmp(value, "create") != 0 && 
 39       strcmp(value, "auto") != 0 && 
 40       strcmp(value, "on")) {
 41     JVMFlag::printError(verbose,
 42                         "Unrecognized value %s for AOTMode. Must be one of the following: "
 43                         "off, record, create, auto, on\n",
 44                         value);
 45     return JVMFlag::VIOLATES_CONSTRAINT;
 46   }
 47 
 48   return JVMFlag::SUCCESS;
 49 }
 50 JVMFlag::Error ObjectAlignmentInBytesConstraintFunc(int value, bool verbose) {
 51   if (!is_power_of_2(value)) {
 52     JVMFlag::printError(verbose,
 53                         "ObjectAlignmentInBytes (%d) must be "
 54                         "power of 2\n",
 55                         value);
 56     return JVMFlag::VIOLATES_CONSTRAINT;
 57   }
 58   // In case page size is very small.
 59   if (value >= (intx)os::vm_page_size()) {
 60     JVMFlag::printError(verbose,
 61                         "ObjectAlignmentInBytes (%d) must be "
 62                         "less than page size (" SIZE_FORMAT ")\n",
 63                         value, os::vm_page_size());
 64     return JVMFlag::VIOLATES_CONSTRAINT;
 65   }
 66   return JVMFlag::SUCCESS;
 67 }
 68 
 69 // Need to enforce the padding not to break the existing field alignments.
< prev index next >