Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/hotspot/cpu/x86/vm_version_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1913,9 +1913,9 @@ void VM_Version::get_processor_features() {
}
}
if (AllocatePrefetchLines > 1) {
log->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize);
log->print_cr(" at distance %d, %d lines of %d bytes", AllocatePrefetchDistance, AllocatePrefetchLines, AllocatePrefetchStepSize);
} else {
log->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize);
log->print_cr(" at distance %d, one line of %d bytes", AllocatePrefetchDistance, AllocatePrefetchStepSize);
}
}

Expand Down Expand Up @@ -3169,7 +3169,7 @@ bool VM_Version::is_intel_tsc_synched_at_init() {
return false;
}

intx VM_Version::allocate_prefetch_distance(bool use_watermark_prefetch) {
int VM_Version::allocate_prefetch_distance(bool use_watermark_prefetch) {
// Hardware prefetching (distance/size in bytes):
// Pentium 3 - 64 / 32
// Pentium 4 - 256 / 128
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/x86/vm_version_x86.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ class VM_Version : public Abstract_VM_Version {

static bool supports_compare_and_exchange() { return true; }

static intx allocate_prefetch_distance(bool use_watermark_prefetch);
static int allocate_prefetch_distance(bool use_watermark_prefetch);

// SSE2 and later processors implement a 'pause' instruction
// that can be used for efficient implementation of
Expand Down
10 changes: 5 additions & 5 deletions src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,12 @@ JVMCIObjectArray CompilerToVM::initialize_intrinsics(JVMCI_TRAPS) {
}

#define PREDEFINED_CONFIG_FLAGS(do_bool_flag, do_int_flag, do_intx_flag, do_uintx_flag) \
do_intx_flag(AllocateInstancePrefetchLines) \
do_intx_flag(AllocatePrefetchDistance) \
do_int_flag(AllocateInstancePrefetchLines) \
do_int_flag(AllocatePrefetchDistance) \
do_intx_flag(AllocatePrefetchInstr) \
do_intx_flag(AllocatePrefetchLines) \
do_intx_flag(AllocatePrefetchStepSize) \
do_intx_flag(AllocatePrefetchStyle) \
do_int_flag(AllocatePrefetchLines) \
do_int_flag(AllocatePrefetchStepSize) \
do_int_flag(AllocatePrefetchStyle) \
Comment on lines +256 to +261
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is AllocatePrefetchInstr not changed? It seems to use 0-3 only.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like from the constraints, it's allowed to be max_intx on some platforms, so changing this would be a functional change.

JVMFlag::Error AllocatePrefetchInstrConstraintFunc(intx value, bool verbose) {
  intx max_value = max_intx;
#if defined(X86)
  max_value = 3;
#endif

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, that sounds reasonable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fwiw, only x86 uses AllocatePrefetchInstr. Other platforms never use it, so its value for those is meaningless.

do_intx_flag(BciProfileWidth) \
do_bool_flag(BootstrapJVMCI) \
do_bool_flag(CITime) \
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ JVMFlag::Error ContendedPaddingWidthConstraintFunc(int value, bool verbose) {
}
}

JVMFlag::Error PerfDataSamplingIntervalFunc(intx value, bool verbose) {
JVMFlag::Error PerfDataSamplingIntervalFunc(int value, bool verbose) {
if ((value % PeriodicTask::interval_gran != 0)) {
JVMFlag::printError(verbose,
"PerfDataSamplingInterval (" INTX_FORMAT ") must be "
"PerfDataSamplingInterval (%d) must be "
"evenly divisible by PeriodicTask::interval_gran (%d)\n",
value, PeriodicTask::interval_gran);
return JVMFlag::VIOLATES_CONSTRAINT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#define RUNTIME_CONSTRAINTS(f) \
f(int, ObjectAlignmentInBytesConstraintFunc) \
f(int, ContendedPaddingWidthConstraintFunc) \
f(intx, PerfDataSamplingIntervalFunc) \
f(int, PerfDataSamplingIntervalFunc) \
f(uintx, VMPageSizeConstraintFunc) \
f(size_t, NUMAInterleaveGranularityConstraintFunc)

Expand Down
18 changes: 9 additions & 9 deletions src/hotspot/share/runtime/globals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ const int ObjectAlignmentInBytes = 8;
product(bool, LogEvents, true, DIAGNOSTIC, \
"Enable the various ring buffer event logs") \
\
product(uintx, LogEventsBufferEntries, 20, DIAGNOSTIC, \
product(int, LogEventsBufferEntries, 20, DIAGNOSTIC, \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to say this should keep its unsignedness but it is treated as an int everywhere anyway.

"Number of ring buffer event logs") \
range(1, NOT_LP64(1*K) LP64_ONLY(1*M)) \
\
Expand Down Expand Up @@ -1101,7 +1101,7 @@ const int ObjectAlignmentInBytes = 8;
notproduct(bool, CollectIndexSetStatistics, false, \
"Collect information about IndexSets") \
\
develop(intx, FastAllocateSizeLimit, 128*K, \
develop(int, FastAllocateSizeLimit, 128*K, \
/* Note: This value is zero mod 1<<13 for a cheap sparc set. */ \
"Inline allocations larger than this in doublewords must go slow")\
\
Expand Down Expand Up @@ -1234,28 +1234,28 @@ const int ObjectAlignmentInBytes = 8;
"When using recompilation, never interpret methods " \
"containing loops") \
\
product(intx, AllocatePrefetchStyle, 1, \
product(int, AllocatePrefetchStyle, 1, \
"0 = no prefetch, " \
"1 = generate prefetch instructions for each allocation, " \
"2 = use TLAB watermark to gate allocation prefetch, " \
"3 = generate one prefetch instruction per cache line") \
range(0, 3) \
\
product(intx, AllocatePrefetchDistance, -1, \
product(int, AllocatePrefetchDistance, -1, \
"Distance to prefetch ahead of allocation pointer. " \
"-1: use system-specific value (automatically determined") \
range(-1, 512) \
\
product(intx, AllocatePrefetchLines, 3, \
product(int, AllocatePrefetchLines, 3, \
"Number of lines to prefetch ahead of array allocation pointer") \
range(1, 64) \
\
product(intx, AllocateInstancePrefetchLines, 1, \
product(int, AllocateInstancePrefetchLines, 1, \
"Number of lines to prefetch ahead of instance allocation " \
"pointer") \
range(1, 64) \
\
product(intx, AllocatePrefetchStepSize, 16, \
product(int, AllocatePrefetchStepSize, 16, \
"Step size in bytes of sequential prefetch instructions") \
range(1, 512) \
constraint(AllocatePrefetchStepSizeConstraintFunc,AfterMemoryInit)\
Expand Down Expand Up @@ -1308,7 +1308,7 @@ const int ObjectAlignmentInBytes = 8;
develop(intx, MallocCatchPtr, -1, \
"Hit breakpoint when mallocing/freeing this pointer") \
\
develop(intx, StackPrintLimit, 100, \
develop(int, StackPrintLimit, 100, \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this cast now:

./share/utilities/vmError.cpp:    const int limit = max_frames == -1 ? StackPrintLimit : MIN2(max_frames, (int)StackPrintLimit);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

"number of stack frames to print in VM-level stack dump") \
\
product(int, ErrorLogPrintCodeLimit, 3, DIAGNOSTIC, \
Expand Down Expand Up @@ -1742,7 +1742,7 @@ const int ObjectAlignmentInBytes = 8;
"The string %p in the file name (if present) " \
"will be replaced by pid") \
\
product(intx, PerfDataSamplingInterval, 50, \
product(int, PerfDataSamplingInterval, 50, \
"Data sampling interval (in milliseconds)") \
range(PeriodicTask::min_interval, max_jint) \
constraint(PerfDataSamplingIntervalFunc, AfterErgo) \
Comment on lines +1745 to 1748
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to change the type of the PerfDataSamplingIntervalFunc as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this and checked for the other options I changed.

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/utilities/vmError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ void VMError::print_native_stack(outputStream* st, frame fr, Thread* t, bool pri
// see if it's a valid frame
if (fr.pc()) {
st->print_cr("Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)");
const int limit = max_frames == -1 ? StackPrintLimit : MIN2(max_frames, (int)StackPrintLimit);
const int limit = max_frames == -1 ? StackPrintLimit : MIN2(max_frames, StackPrintLimit);
int count = 0;
while (count++ < limit) {
fr.print_on_error(st, buf, buf_size);
Expand Down