8153039: Command line processing should use mtCommand or mtArguments rather than mtInternal for NMT

Added mtArguments and replaced argument related usages of mtInternal with the new flag.

Reviewed-by: coleenp, gtriantafill
This commit is contained in:
Gerard Ziemski 2016-04-13 15:53:46 -05:00
parent 8423e2c392
commit f474e970ba
9 changed files with 46 additions and 44 deletions

View File

@ -143,8 +143,9 @@ enum MemoryType {
mtTest = 0x0D, // Test type for verifying NMT mtTest = 0x0D, // Test type for verifying NMT
mtTracing = 0x0E, // memory used for Tracing mtTracing = 0x0E, // memory used for Tracing
mtLogging = 0x0F, // memory for logging mtLogging = 0x0F, // memory for logging
mtNone = 0x10, // undefined mtArguments = 0x10, // memory for argument processing
mt_number_of_types = 0x11 // number of memory types (mtDontTrack mtNone = 0x11, // undefined
mt_number_of_types = 0x12 // number of memory types (mtDontTrack
// is not included as validate type) // is not included as validate type)
}; };

View File

@ -698,7 +698,7 @@ char* ArgumentBootClassPath::combined_path() {
assert(total_len > 0, "empty sysclasspath not allowed"); assert(total_len > 0, "empty sysclasspath not allowed");
// Copy the _items to a single string. // Copy the _items to a single string.
char* cp = NEW_C_HEAP_ARRAY(char, total_len, mtInternal); char* cp = NEW_C_HEAP_ARRAY(char, total_len, mtArguments);
char* cp_tmp = cp; char* cp_tmp = cp;
for (i = 0; i < _bcp_nitems; ++i) { for (i = 0; i < _bcp_nitems; ++i) {
if (_items[i] != NULL) { if (_items[i] != NULL) {
@ -719,7 +719,7 @@ ArgumentBootClassPath::add_to_path(const char* path, const char* str, bool prepe
assert(str != NULL, "just checking"); assert(str != NULL, "just checking");
if (path == NULL) { if (path == NULL) {
size_t len = strlen(str) + 1; size_t len = strlen(str) + 1;
cp = NEW_C_HEAP_ARRAY(char, len, mtInternal); cp = NEW_C_HEAP_ARRAY(char, len, mtArguments);
memcpy(cp, str, len); // copy the trailing null memcpy(cp, str, len); // copy the trailing null
} else { } else {
const char separator = *os::path_separator(); const char separator = *os::path_separator();
@ -728,7 +728,7 @@ ArgumentBootClassPath::add_to_path(const char* path, const char* str, bool prepe
size_t len = old_len + str_len + 2; size_t len = old_len + str_len + 2;
if (prepend) { if (prepend) {
cp = NEW_C_HEAP_ARRAY(char, len, mtInternal); cp = NEW_C_HEAP_ARRAY(char, len, mtArguments);
char* cp_tmp = cp; char* cp_tmp = cp;
memcpy(cp_tmp, str, str_len); memcpy(cp_tmp, str, str_len);
cp_tmp += str_len; cp_tmp += str_len;
@ -736,7 +736,7 @@ ArgumentBootClassPath::add_to_path(const char* path, const char* str, bool prepe
memcpy(++cp_tmp, path, old_len + 1); // copy the trailing null memcpy(++cp_tmp, path, old_len + 1); // copy the trailing null
FREE_C_HEAP_ARRAY(char, path); FREE_C_HEAP_ARRAY(char, path);
} else { } else {
cp = REALLOC_C_HEAP_ARRAY(char, path, len, mtInternal); cp = REALLOC_C_HEAP_ARRAY(char, path, len, mtArguments);
char* cp_tmp = cp + old_len; char* cp_tmp = cp + old_len;
*cp_tmp = separator; *cp_tmp = separator;
memcpy(++cp_tmp, str, str_len + 1); // copy the trailing null memcpy(++cp_tmp, str, str_len + 1); // copy the trailing null
@ -758,7 +758,7 @@ char* ArgumentBootClassPath::add_jars_to_path(char* path, const char* directory)
/* Scan the directory for jars/zips, appending them to path. */ /* Scan the directory for jars/zips, appending them to path. */
struct dirent *entry; struct dirent *entry;
char *dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(directory), mtInternal); char *dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(directory), mtArguments);
while ((entry = os::readdir(dir, (dirent *) dbuf)) != NULL) { while ((entry = os::readdir(dir, (dirent *) dbuf)) != NULL) {
const char* name = entry->d_name; const char* name = entry->d_name;
const char* ext = name + strlen(name) - 4; const char* ext = name + strlen(name) - 4;
@ -766,7 +766,7 @@ char* ArgumentBootClassPath::add_jars_to_path(char* path, const char* directory)
(os::file_name_strcmp(ext, ".jar") == 0 || (os::file_name_strcmp(ext, ".jar") == 0 ||
os::file_name_strcmp(ext, ".zip") == 0); os::file_name_strcmp(ext, ".zip") == 0);
if (isJarOrZip) { if (isJarOrZip) {
char* jarpath = NEW_C_HEAP_ARRAY(char, directory_len + 2 + strlen(name), mtInternal); char* jarpath = NEW_C_HEAP_ARRAY(char, directory_len + 2 + strlen(name), mtArguments);
sprintf(jarpath, "%s%s%s", directory, dir_sep, name); sprintf(jarpath, "%s%s%s", directory, dir_sep, name);
path = add_to_path(path, jarpath, false); path = add_to_path(path, jarpath, false);
FREE_C_HEAP_ARRAY(char, jarpath); FREE_C_HEAP_ARRAY(char, jarpath);
@ -943,7 +943,7 @@ static bool append_to_string_flag(const char* name, const char* new_value, Flag:
} else if (new_len == 0) { } else if (new_len == 0) {
value = old_value; value = old_value;
} else { } else {
char* buf = NEW_C_HEAP_ARRAY(char, old_len + 1 + new_len + 1, mtInternal); char* buf = NEW_C_HEAP_ARRAY(char, old_len + 1 + new_len + 1, mtArguments);
// each new setting adds another LINE to the switch: // each new setting adds another LINE to the switch:
sprintf(buf, "%s\n%s", old_value, new_value); sprintf(buf, "%s\n%s", old_value, new_value);
value = buf; value = buf;
@ -1134,9 +1134,9 @@ void Arguments::add_string(char*** bldarray, int* count, const char* arg) {
// expand the array and add arg to the last element // expand the array and add arg to the last element
if (*bldarray == NULL) { if (*bldarray == NULL) {
*bldarray = NEW_C_HEAP_ARRAY(char*, new_count, mtInternal); *bldarray = NEW_C_HEAP_ARRAY(char*, new_count, mtArguments);
} else { } else {
*bldarray = REALLOC_C_HEAP_ARRAY(char*, *bldarray, new_count, mtInternal); *bldarray = REALLOC_C_HEAP_ARRAY(char*, *bldarray, new_count, mtArguments);
} }
(*bldarray)[*count] = os::strdup_check_oom(arg); (*bldarray)[*count] = os::strdup_check_oom(arg);
*count = new_count; *count = new_count;
@ -1400,7 +1400,7 @@ bool Arguments::add_property(const char* prop) {
// property have a value, thus extract it and save to the // property have a value, thus extract it and save to the
// allocated string // allocated string
size_t key_len = eq - prop; size_t key_len = eq - prop;
char* tmp_key = AllocateHeap(key_len + 1, mtInternal); char* tmp_key = AllocateHeap(key_len + 1, mtArguments);
strncpy(tmp_key, prop, key_len); strncpy(tmp_key, prop, key_len);
tmp_key[key_len] = '\0'; tmp_key[key_len] = '\0';
@ -1422,7 +1422,7 @@ bool Arguments::add_property(const char* prop) {
} else { } else {
if (strcmp(key, "sun.java.command") == 0) { if (strcmp(key, "sun.java.command") == 0) {
char *old_java_command = _java_command; char *old_java_command = _java_command;
_java_command = os::strdup_check_oom(value, mtInternal); _java_command = os::strdup_check_oom(value, mtArguments);
if (old_java_command != NULL) { if (old_java_command != NULL) {
os::free(old_java_command); os::free(old_java_command);
} }
@ -1430,7 +1430,7 @@ bool Arguments::add_property(const char* prop) {
const char* old_java_vendor_url_bug = _java_vendor_url_bug; const char* old_java_vendor_url_bug = _java_vendor_url_bug;
// save it in _java_vendor_url_bug, so JVM fatal error handler can access // save it in _java_vendor_url_bug, so JVM fatal error handler can access
// its value without going through the property list or making a Java call. // its value without going through the property list or making a Java call.
_java_vendor_url_bug = os::strdup_check_oom(value, mtInternal); _java_vendor_url_bug = os::strdup_check_oom(value, mtArguments);
if (old_java_vendor_url_bug != DEFAULT_VENDOR_URL_BUG) { if (old_java_vendor_url_bug != DEFAULT_VENDOR_URL_BUG) {
assert(old_java_vendor_url_bug != NULL, "_java_vendor_url_bug is NULL"); assert(old_java_vendor_url_bug != NULL, "_java_vendor_url_bug is NULL");
os::free((void *)old_java_vendor_url_bug); os::free((void *)old_java_vendor_url_bug);
@ -1458,7 +1458,7 @@ bool Arguments::append_to_addmods_property(const char* module_name) {
if (old_value != NULL) { if (old_value != NULL) {
buf_len += strlen(old_value) + 1; buf_len += strlen(old_value) + 1;
} }
char* new_value = AllocateHeap(buf_len, mtInternal); char* new_value = AllocateHeap(buf_len, mtArguments);
if (new_value == NULL) { if (new_value == NULL) {
return false; return false;
} }
@ -2852,13 +2852,13 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
if (tail != NULL) { if (tail != NULL) {
const char* pos = strchr(tail, ':'); const char* pos = strchr(tail, ':');
size_t len = (pos == NULL) ? strlen(tail) : pos - tail; size_t len = (pos == NULL) ? strlen(tail) : pos - tail;
char* name = (char*)memcpy(NEW_C_HEAP_ARRAY(char, len + 1, mtInternal), tail, len); char* name = (char*)memcpy(NEW_C_HEAP_ARRAY(char, len + 1, mtArguments), tail, len);
name[len] = '\0'; name[len] = '\0';
char *options = NULL; char *options = NULL;
if(pos != NULL) { if(pos != NULL) {
size_t len2 = strlen(pos+1) + 1; // options start after ':'. Final zero must be copied. size_t len2 = strlen(pos+1) + 1; // options start after ':'. Final zero must be copied.
options = (char*)memcpy(NEW_C_HEAP_ARRAY(char, len2, mtInternal), pos+1, len2); options = (char*)memcpy(NEW_C_HEAP_ARRAY(char, len2, mtArguments), pos+1, len2);
} }
#if !INCLUDE_JVMTI #if !INCLUDE_JVMTI
if (strcmp(name, "jdwp") == 0) { if (strcmp(name, "jdwp") == 0) {
@ -2875,12 +2875,12 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
if(tail != NULL) { if(tail != NULL) {
const char* pos = strchr(tail, '='); const char* pos = strchr(tail, '=');
size_t len = (pos == NULL) ? strlen(tail) : pos - tail; size_t len = (pos == NULL) ? strlen(tail) : pos - tail;
char* name = strncpy(NEW_C_HEAP_ARRAY(char, len + 1, mtInternal), tail, len); char* name = strncpy(NEW_C_HEAP_ARRAY(char, len + 1, mtArguments), tail, len);
name[len] = '\0'; name[len] = '\0';
char *options = NULL; char *options = NULL;
if(pos != NULL) { if(pos != NULL) {
options = os::strdup_check_oom(pos + 1, mtInternal); options = os::strdup_check_oom(pos + 1, mtArguments);
} }
#if !INCLUDE_JVMTI #if !INCLUDE_JVMTI
if (valid_jdwp_agent(name, is_absolute_path)) { if (valid_jdwp_agent(name, is_absolute_path)) {
@ -2899,7 +2899,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
return JNI_ERR; return JNI_ERR;
#else #else
if (tail != NULL) { if (tail != NULL) {
char *options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(tail) + 1, mtInternal), tail); char *options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(tail) + 1, mtArguments), tail);
add_init_agent("instrument", options, false); add_init_agent("instrument", options, false);
// java agents need module java.instrument. Also -addmods ALL-SYSTEM because // java agents need module java.instrument. Also -addmods ALL-SYSTEM because
// the java agent is in the unmamed module of the application class loader // the java agent is in the unmamed module of the application class loader
@ -3201,7 +3201,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
size_t len = strlen(patch_dirs[x]); size_t len = strlen(patch_dirs[x]);
if (len != 0) { // Ignore empty strings. if (len != 0) { // Ignore empty strings.
len += 11; // file_sep + "java.base" + null terminator. len += 11; // file_sep + "java.base" + null terminator.
char* dir = NEW_C_HEAP_ARRAY(char, len, mtInternal); char* dir = NEW_C_HEAP_ARRAY(char, len, mtArguments);
jio_snprintf(dir, len, "%s%cjava.base", patch_dirs[x], file_sep); jio_snprintf(dir, len, "%s%cjava.base", patch_dirs[x], file_sep);
// See if Xpatch module path exists. // See if Xpatch module path exists.
@ -3507,7 +3507,7 @@ void Arguments::fix_appclasspath() {
src ++; src ++;
} }
char* copy = os::strdup_check_oom(src, mtInternal); char* copy = os::strdup_check_oom(src, mtArguments);
// trim all trailing empty paths // trim all trailing empty paths
for (char* tail = copy + strlen(copy) - 1; tail >= copy && *tail == separator; tail--) { for (char* tail = copy + strlen(copy) - 1; tail >= copy && *tail == separator; tail--) {
@ -3531,7 +3531,7 @@ static bool has_jar_files(const char* directory) {
if (dir == NULL) return false; if (dir == NULL) return false;
struct dirent *entry; struct dirent *entry;
char *dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(directory), mtInternal); char *dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(directory), mtArguments);
bool hasJarFile = false; bool hasJarFile = false;
while (!hasJarFile && (entry = os::readdir(dir, (dirent *) dbuf)) != NULL) { while (!hasJarFile && (entry = os::readdir(dir, (dirent *) dbuf)) != NULL) {
const char* name = entry->d_name; const char* name = entry->d_name;
@ -3557,7 +3557,7 @@ static int check_non_empty_dirs(const char* path) {
} }
path = end; path = end;
} else { } else {
char* dirpath = NEW_C_HEAP_ARRAY(char, tmp_end - path + 1, mtInternal); char* dirpath = NEW_C_HEAP_ARRAY(char, tmp_end - path + 1, mtArguments);
memcpy(dirpath, path, tmp_end - path); memcpy(dirpath, path, tmp_end - path);
dirpath[tmp_end - path] = '\0'; dirpath[tmp_end - path] = '\0';
if (has_jar_files(dirpath)) { if (has_jar_files(dirpath)) {
@ -3729,7 +3729,7 @@ class ScopedVMInitArgs : public StackObj {
jint set_args(GrowableArray<JavaVMOption>* options) { jint set_args(GrowableArray<JavaVMOption>* options) {
_is_set = true; _is_set = true;
JavaVMOption* options_arr = NEW_C_HEAP_ARRAY_RETURN_NULL( JavaVMOption* options_arr = NEW_C_HEAP_ARRAY_RETURN_NULL(
JavaVMOption, options->length(), mtInternal); JavaVMOption, options->length(), mtArguments);
if (options_arr == NULL) { if (options_arr == NULL) {
return JNI_ENOMEM; return JNI_ENOMEM;
} }
@ -3784,7 +3784,7 @@ class ScopedVMInitArgs : public StackObj {
assert(vm_options_file_pos != -1, "vm_options_file_pos should be set"); assert(vm_options_file_pos != -1, "vm_options_file_pos should be set");
int length = args->nOptions + args_to_insert->nOptions - 1; int length = args->nOptions + args_to_insert->nOptions - 1;
GrowableArray<JavaVMOption> *options = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<JavaVMOption> *options = new (ResourceObj::C_HEAP, mtArguments)
GrowableArray<JavaVMOption>(length, true); // Construct new option array GrowableArray<JavaVMOption>(length, true); // Construct new option array
for (int i = 0; i < args->nOptions; i++) { for (int i = 0; i < args->nOptions; i++) {
if (i == vm_options_file_pos) { if (i == vm_options_file_pos) {
@ -3861,7 +3861,7 @@ jint Arguments::parse_vm_options_file(const char* file_name, ScopedVMInitArgs* v
// '+ 1' for NULL termination even with max bytes // '+ 1' for NULL termination even with max bytes
size_t bytes_alloc = stbuf.st_size + 1; size_t bytes_alloc = stbuf.st_size + 1;
char *buf = NEW_C_HEAP_ARRAY_RETURN_NULL(char, bytes_alloc, mtInternal); char *buf = NEW_C_HEAP_ARRAY_RETURN_NULL(char, bytes_alloc, mtArguments);
if (NULL == buf) { if (NULL == buf) {
jio_fprintf(defaultStream::error_stream(), jio_fprintf(defaultStream::error_stream(),
"Could not allocate read buffer for options file parse\n"); "Could not allocate read buffer for options file parse\n");
@ -3898,7 +3898,7 @@ jint Arguments::parse_vm_options_file(const char* file_name, ScopedVMInitArgs* v
} }
jint Arguments::parse_options_buffer(const char* name, char* buffer, const size_t buf_len, ScopedVMInitArgs* vm_args) { jint Arguments::parse_options_buffer(const char* name, char* buffer, const size_t buf_len, ScopedVMInitArgs* vm_args) {
GrowableArray<JavaVMOption> *options = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<JavaVMOption>(2, true); // Construct option array GrowableArray<JavaVMOption> *options = new (ResourceObj::C_HEAP, mtArguments) GrowableArray<JavaVMOption>(2, true); // Construct option array
// some pointers to help with parsing // some pointers to help with parsing
char *buffer_end = buffer + buf_len; char *buffer_end = buffer + buf_len;
@ -4002,13 +4002,13 @@ static char* get_shared_archive_path() {
size_t jvm_path_len = strlen(jvm_path); size_t jvm_path_len = strlen(jvm_path);
size_t file_sep_len = strlen(os::file_separator()); size_t file_sep_len = strlen(os::file_separator());
const size_t len = jvm_path_len + file_sep_len + 20; const size_t len = jvm_path_len + file_sep_len + 20;
shared_archive_path = NEW_C_HEAP_ARRAY(char, len, mtInternal); shared_archive_path = NEW_C_HEAP_ARRAY(char, len, mtArguments);
if (shared_archive_path != NULL) { if (shared_archive_path != NULL) {
jio_snprintf(shared_archive_path, len, "%s%sclasses.jsa", jio_snprintf(shared_archive_path, len, "%s%sclasses.jsa",
jvm_path, os::file_separator()); jvm_path, os::file_separator());
} }
} else { } else {
shared_archive_path = os::strdup_check_oom(SharedArchiveFile, mtInternal); shared_archive_path = os::strdup_check_oom(SharedArchiveFile, mtArguments);
} }
return shared_archive_path; return shared_archive_path;
} }

View File

@ -47,7 +47,7 @@ class ArgumentBootClassPath;
// PathString is used as the underlying value container for a // PathString is used as the underlying value container for a
// SystemProperty and for the string that represents the system // SystemProperty and for the string that represents the system
// boot class path, Arguments::_system_boot_class_path. // boot class path, Arguments::_system_boot_class_path.
class PathString : public CHeapObj<mtInternal> { class PathString : public CHeapObj<mtArguments> {
protected: protected:
char* _value; char* _value;
public: public:
@ -57,7 +57,7 @@ class PathString : public CHeapObj<mtInternal> {
if (_value != NULL) { if (_value != NULL) {
FreeHeap(_value); FreeHeap(_value);
} }
_value = AllocateHeap(strlen(value)+1, mtInternal); _value = AllocateHeap(strlen(value)+1, mtArguments);
assert(_value != NULL, "Unable to allocate space for new path value"); assert(_value != NULL, "Unable to allocate space for new path value");
if (_value != NULL) { if (_value != NULL) {
strcpy(_value, value); strcpy(_value, value);
@ -76,7 +76,7 @@ class PathString : public CHeapObj<mtInternal> {
if (_value != NULL) { if (_value != NULL) {
len += strlen(_value); len += strlen(_value);
} }
sp = AllocateHeap(len+2, mtInternal); sp = AllocateHeap(len+2, mtArguments);
assert(sp != NULL, "Unable to allocate space for new append path value"); assert(sp != NULL, "Unable to allocate space for new append path value");
if (sp != NULL) { if (sp != NULL) {
if (_value != NULL) { if (_value != NULL) {
@ -97,7 +97,7 @@ class PathString : public CHeapObj<mtInternal> {
if (value == NULL) { if (value == NULL) {
_value = NULL; _value = NULL;
} else { } else {
_value = AllocateHeap(strlen(value)+1, mtInternal); _value = AllocateHeap(strlen(value)+1, mtArguments);
strcpy(_value, value); strcpy(_value, value);
} }
} }
@ -143,7 +143,7 @@ class SystemProperty : public PathString {
if (key == NULL) { if (key == NULL) {
_key = NULL; _key = NULL;
} else { } else {
_key = AllocateHeap(strlen(key)+1, mtInternal); _key = AllocateHeap(strlen(key)+1, mtArguments);
strcpy(_key, key); strcpy(_key, key);
} }
_next = NULL; _next = NULL;
@ -154,7 +154,7 @@ class SystemProperty : public PathString {
// For use by -agentlib, -agentpath and -Xrun // For use by -agentlib, -agentpath and -Xrun
class AgentLibrary : public CHeapObj<mtInternal> { class AgentLibrary : public CHeapObj<mtArguments> {
friend class AgentLibraryList; friend class AgentLibraryList;
public: public:
// Is this library valid or not. Don't rely on os_lib == NULL as statically // Is this library valid or not. Don't rely on os_lib == NULL as statically
@ -189,12 +189,12 @@ public:
// Constructor // Constructor
AgentLibrary(const char* name, const char* options, bool is_absolute_path, void* os_lib) { AgentLibrary(const char* name, const char* options, bool is_absolute_path, void* os_lib) {
_name = AllocateHeap(strlen(name)+1, mtInternal); _name = AllocateHeap(strlen(name)+1, mtArguments);
strcpy(_name, name); strcpy(_name, name);
if (options == NULL) { if (options == NULL) {
_options = NULL; _options = NULL;
} else { } else {
_options = AllocateHeap(strlen(options)+1, mtInternal); _options = AllocateHeap(strlen(options)+1, mtArguments);
strcpy(_options, options); strcpy(_options, options);
} }
_is_absolute_path = is_absolute_path; _is_absolute_path = is_absolute_path;

View File

@ -226,7 +226,7 @@ CommandLineFlagConstraint::ConstraintType CommandLineFlagConstraintList::_valida
// Check the ranges of all flags that have them or print them out and exit if requested // Check the ranges of all flags that have them or print them out and exit if requested
void CommandLineFlagConstraintList::init(void) { void CommandLineFlagConstraintList::init(void) {
_constraints = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<CommandLineFlagConstraint*>(INITIAL_CONSTRAINTS_SIZE, true); _constraints = new (ResourceObj::C_HEAP, mtArguments) GrowableArray<CommandLineFlagConstraint*>(INITIAL_CONSTRAINTS_SIZE, true);
emit_constraint_no(NULL RUNTIME_FLAGS(EMIT_CONSTRAINT_DEVELOPER_FLAG, emit_constraint_no(NULL RUNTIME_FLAGS(EMIT_CONSTRAINT_DEVELOPER_FLAG,
EMIT_CONSTRAINT_PD_DEVELOPER_FLAG, EMIT_CONSTRAINT_PD_DEVELOPER_FLAG,

View File

@ -48,7 +48,7 @@ typedef Flag::Error (*CommandLineFlagConstraintFunc_uint64_t)(uint64_t value, bo
typedef Flag::Error (*CommandLineFlagConstraintFunc_size_t)(size_t value, bool verbose); typedef Flag::Error (*CommandLineFlagConstraintFunc_size_t)(size_t value, bool verbose);
typedef Flag::Error (*CommandLineFlagConstraintFunc_double)(double value, bool verbose); typedef Flag::Error (*CommandLineFlagConstraintFunc_double)(double value, bool verbose);
class CommandLineFlagConstraint : public CHeapObj<mtInternal> { class CommandLineFlagConstraint : public CHeapObj<mtArguments> {
public: public:
// During VM initialization, constraint validation will be done order of ConstraintType. // During VM initialization, constraint validation will be done order of ConstraintType.
enum ConstraintType { enum ConstraintType {

View File

@ -292,7 +292,7 @@ GrowableArray<CommandLineFlagRange*>* CommandLineFlagRangeList::_ranges = NULL;
// Check the ranges of all flags that have them // Check the ranges of all flags that have them
void CommandLineFlagRangeList::init(void) { void CommandLineFlagRangeList::init(void) {
_ranges = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<CommandLineFlagRange*>(INITIAL_RANGES_SIZE, true); _ranges = new (ResourceObj::C_HEAP, mtArguments) GrowableArray<CommandLineFlagRange*>(INITIAL_RANGES_SIZE, true);
emit_range_no(NULL RUNTIME_FLAGS(EMIT_RANGE_DEVELOPER_FLAG, emit_range_no(NULL RUNTIME_FLAGS(EMIT_RANGE_DEVELOPER_FLAG,
EMIT_RANGE_PD_DEVELOPER_FLAG, EMIT_RANGE_PD_DEVELOPER_FLAG,

View File

@ -44,7 +44,7 @@ public:
static void print(bool verbose, const char* msg, ...); static void print(bool verbose, const char* msg, ...);
}; };
class CommandLineFlagRange : public CHeapObj<mtInternal> { class CommandLineFlagRange : public CHeapObj<mtArguments> {
private: private:
const char* _name; const char* _name;
public: public:

View File

@ -1292,7 +1292,7 @@ void CommandLineFlags::printSetFlags(outputStream* out) {
const size_t length = Flag::numFlags - 1; const size_t length = Flag::numFlags - 1;
// Sort // Sort
Flag** array = NEW_C_HEAP_ARRAY(Flag*, length, mtInternal); Flag** array = NEW_C_HEAP_ARRAY(Flag*, length, mtArguments);
for (size_t i = 0; i < length; i++) { for (size_t i = 0; i < length; i++) {
array[i] = &flagTable[i]; array[i] = &flagTable[i];
} }
@ -1326,7 +1326,7 @@ void CommandLineFlags::printFlags(outputStream* out, bool withComments, bool pri
const size_t length = Flag::numFlags - 1; const size_t length = Flag::numFlags - 1;
// Sort // Sort
Flag** array = NEW_C_HEAP_ARRAY(Flag*, length, mtInternal); Flag** array = NEW_C_HEAP_ARRAY(Flag*, length, mtArguments);
for (size_t i = 0; i < length; i++) { for (size_t i = 0; i < length; i++) {
array[i] = &flagTable[i]; array[i] = &flagTable[i];
} }

View File

@ -41,6 +41,7 @@ const char* NMTUtil::_memory_type_names[] = {
"Test", "Test",
"Tracing", "Tracing",
"Logging", "Logging",
"Arguments",
"Unknown" "Unknown"
}; };