Mercurial > hg > graal-jvmci-8
comparison src/share/vm/jvmci/jvmciRuntime.cpp @ 22614:0851eafff5c9
Minor -G option parsing fixes
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Thu, 24 Sep 2015 20:51:57 -0700 |
parents | c42b12eb270a |
children | e96c6a52aff2 |
comparison
equal
deleted
inserted
replaced
22613:9409f7cec59a | 22614:0851eafff5c9 |
---|---|
696 if (_options != NULL) { | 696 if (_options != NULL) { |
697 options = oopFactory::new_objArray(SystemDictionary::String_klass(), _options_count * 2, CHECK); | 697 options = oopFactory::new_objArray(SystemDictionary::String_klass(), _options_count * 2, CHECK); |
698 for (int i = 0; i < _options_count; i++) { | 698 for (int i = 0; i < _options_count; i++) { |
699 SystemProperty* prop = _options[i]; | 699 SystemProperty* prop = _options[i]; |
700 oop name = java_lang_String::create_oop_from_str(prop->key() + OPTION_PREFIX_LEN, CHECK); | 700 oop name = java_lang_String::create_oop_from_str(prop->key() + OPTION_PREFIX_LEN, CHECK); |
701 oop value = java_lang_String::create_oop_from_str(prop->value(), CHECK); | 701 const char* prop_value = prop->value() != NULL ? prop->value() : ""; |
702 oop value = java_lang_String::create_oop_from_str(prop_value, CHECK); | |
702 options->obj_at_put(i * 2, name); | 703 options->obj_at_put(i * 2, name); |
703 options->obj_at_put((i * 2) + 1, value); | 704 options->obj_at_put((i * 2) + 1, value); |
704 } | 705 } |
705 } else { | 706 } else { |
706 options = NULL; | 707 options = NULL; |
946 jint JVMCIRuntime::save_options(SystemProperty* props) { | 947 jint JVMCIRuntime::save_options(SystemProperty* props) { |
947 int count = 0; | 948 int count = 0; |
948 SystemProperty* first = NULL; | 949 SystemProperty* first = NULL; |
949 for (SystemProperty* p = props; p != NULL; p = p->next()) { | 950 for (SystemProperty* p = props; p != NULL; p = p->next()) { |
950 if (strncmp(p->key(), OPTION_PREFIX, OPTION_PREFIX_LEN) == 0) { | 951 if (strncmp(p->key(), OPTION_PREFIX, OPTION_PREFIX_LEN) == 0) { |
951 if (p->value() == NULL || strlen(p->value()) == 0) { | |
952 jio_fprintf(defaultStream::output_stream(), "JVMCI option %s must have non-zero length value\n", p->key()); | |
953 return JNI_ERR; | |
954 } | |
955 if (first == NULL) { | 952 if (first == NULL) { |
956 first = p; | 953 first = p; |
957 } | 954 } |
958 count++; | 955 count++; |
959 } | 956 } |