src/share/vm/runtime/commandLineFlagConstraintsRuntime.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 8112746 Cdiff src/share/vm/runtime/commandLineFlagConstraintsRuntime.cpp

src/share/vm/runtime/commandLineFlagConstraintsRuntime.cpp

Print this page

        

*** 26,65 **** #include "runtime/arguments.hpp" #include "runtime/commandLineFlagConstraintsRuntime.hpp" #include "runtime/globals.hpp" #include "utilities/defaultStream.hpp" ! Flag::Error ObjectAlignmentInBytesConstraintFunc(bool verbose, intx* value) { ! if (!is_power_of_2(*value)) { ! if (verbose == true) { ! jio_fprintf(defaultStream::error_stream(), ! "ObjectAlignmentInBytes=" INTX_FORMAT " must be power of 2\n", ! *value); } return Flag::VIOLATES_CONSTRAINT; } // In case page size is very small. ! if (*value >= (intx)os::vm_page_size()) { ! if (verbose == true) { ! jio_fprintf(defaultStream::error_stream(), ! "ObjectAlignmentInBytes=" INTX_FORMAT " must be less than page size " INTX_FORMAT "\n", ! *value, (intx)os::vm_page_size()); ! } return Flag::VIOLATES_CONSTRAINT; } return Flag::SUCCESS; } // Need to enforce the padding not to break the existing field alignments. // It is sufficient to check against the largest type size. ! Flag::Error ContendedPaddingWidthConstraintFunc(bool verbose, intx* value) { ! if ((*value != 0) && ((*value % BytesPerLong) != 0)) { ! if (verbose == true) { ! jio_fprintf(defaultStream::error_stream(), ! "ContendedPaddingWidth=" INTX_FORMAT " must be a multiple of %d\n", ! *value, BytesPerLong); ! } return Flag::VIOLATES_CONSTRAINT; } else { return Flag::SUCCESS; } } --- 26,71 ---- #include "runtime/arguments.hpp" #include "runtime/commandLineFlagConstraintsRuntime.hpp" #include "runtime/globals.hpp" #include "utilities/defaultStream.hpp" ! static void print_error_if_needed(bool verbose, const char* msg, ...) { ! if (verbose) { ! va_list listPointer; ! va_start(listPointer, msg); ! jio_vfprintf(defaultStream::error_stream(), msg, listPointer); ! va_end(listPointer); } + } + + Flag::Error ObjectAlignmentInBytesConstraintFunc(bool verbose, intx value) { + if (!is_power_of_2(value)) { + print_error_if_needed(verbose, + "ObjectAlignmentInBytes=" INTX_FORMAT " must be " + "power of 2\n", + value); return Flag::VIOLATES_CONSTRAINT; } // In case page size is very small. ! if (value >= (intx)os::vm_page_size()) { ! print_error_if_needed(verbose, ! "ObjectAlignmentInBytes=" INTX_FORMAT " must be " ! "less than page size " INTX_FORMAT "\n", ! value, (intx)os::vm_page_size()); return Flag::VIOLATES_CONSTRAINT; } return Flag::SUCCESS; } // Need to enforce the padding not to break the existing field alignments. // It is sufficient to check against the largest type size. ! Flag::Error ContendedPaddingWidthConstraintFunc(bool verbose, intx value) { ! if ((value != 0) && ((value % BytesPerLong) != 0)) { ! print_error_if_needed(verbose, ! "ContendedPaddingWidth=" INTX_FORMAT " must be " ! "a multiple of %d\n", ! value, BytesPerLong); return Flag::VIOLATES_CONSTRAINT; } else { return Flag::SUCCESS; } }
src/share/vm/runtime/commandLineFlagConstraintsRuntime.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File