Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
14 changes: 7 additions & 7 deletions src/hotspot/share/runtime/arguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1965,15 +1965,15 @@ static const char* system_assertion_options[] = {
"-dsa", "-esa", "-disablesystemassertions", "-enablesystemassertions", 0
};

bool Arguments::parse_uintx(const char* value,
uintx* uintx_arg,
uintx min_size) {
uintx n;
bool Arguments::parse_uint(const char* value,
uint* uint_arg,
uint min_size) {
uint n;
if (!parse_integer(value, &n)) {
return false;
}
if (n >= min_size) {
*uintx_arg = n;
*uint_arg = n;
return true;
} else {
return false;
Expand Down Expand Up @@ -2728,8 +2728,8 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_m
return JNI_EINVAL;
}
} else if (match_option(option, "-XX:MaxTenuringThreshold=", &tail)) {
uintx max_tenuring_thresh = 0;
if (!parse_uintx(tail, &max_tenuring_thresh, 0)) {
uint max_tenuring_thresh = 0;
if (!parse_uint(tail, &max_tenuring_thresh, 0)) {
jio_fprintf(defaultStream::error_stream(),
"Improperly specified VM option \'MaxTenuringThreshold=%s\'\n", tail);
return JNI_EINVAL;
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/share/runtime/arguments.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,10 @@ class Arguments : AllStatic {
static jint parse(const JavaVMInitArgs* args);
// Parse a string for a unsigned integer. Returns true if value
// is an unsigned integer greater than or equal to the minimum
// parameter passed and returns the value in uintx_arg. Returns
// false otherwise, with uintx_arg undefined.
static bool parse_uintx(const char* value, uintx* uintx_arg,
uintx min_size);
// parameter passed and returns the value in uint_arg. Returns
// false otherwise, with uint_arg undefined.
static bool parse_uint(const char* value, uint* uintx_arg,
uint min_size);
// Apply ergonomics
static jint apply_ergo();
// Adjusts the arguments after the OS have adjusted the arguments
Expand Down
14 changes: 7 additions & 7 deletions src/hotspot/share/services/attachListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,13 @@ jint dump_heap(AttachOperation* op, outputStream* out) {
}

const char* num_str = op->arg(2);
uintx level = 0;
uint level = 0;
if (num_str != nullptr && num_str[0] != '\0') {
if (!Arguments::parse_uintx(num_str, &level, 0)) {
if (!Arguments::parse_uint(num_str, &level, 0)) {
out->print_cr("Invalid compress level: [%s]", num_str);
return JNI_ERR;
} else if (level < 1 || level > 9) {
out->print_cr("Compression level out of range (1-9): " UINTX_FORMAT, level);
out->print_cr("Compression level out of range (1-9): %u", level);
return JNI_ERR;
}
}
Expand All @@ -249,7 +249,7 @@ jint dump_heap(AttachOperation* op, outputStream* out) {
// This helps reduces the amount of unreachable objects in the dump
// and makes it easier to browse.
HeapDumper dumper(live_objects_only /* request GC */);
dumper.dump(path, out, (int)level, false, HeapDumper::default_num_of_dump_threads());
dumper.dump(path, out, level, false, HeapDumper::default_num_of_dump_threads());
}
return JNI_OK;
}
Expand Down Expand Up @@ -287,13 +287,13 @@ static jint heap_inspection(AttachOperation* op, outputStream* out) {

const char* num_str = op->arg(2);
if (num_str != nullptr && num_str[0] != '\0') {
uintx num;
if (!Arguments::parse_uintx(num_str, &num, 0)) {
uint num;
if (!Arguments::parse_uint(num_str, &num, 0)) {
out->print_cr("Invalid parallel thread number: [%s]", num_str);
delete fs;
return JNI_ERR;
}
parallel_thread_num = num == 0 ? parallel_thread_num : (uint)num;
parallel_thread_num = num == 0 ? parallel_thread_num : num;
}

VM_GC_HeapInspection heapop(os, live_objects_only /* request full gc */, parallel_thread_num);
Expand Down