comparison src/share/vm/jvmci/jvmciRuntime.cpp @ 21875:431b127fc0d1

Renaming of classes around jvmciOptions for clarity
author Gilles Duboscq <gilles.m.duboscq@oracle.com>
date Tue, 09 Jun 2015 13:06:37 +0200
parents 9966b358bc2b
children d358434dd6b7
comparison
equal deleted inserted replaced
21874:f79218584d37 21875:431b127fc0d1
727 _FactoryKlass = klass(); 727 _FactoryKlass = klass();
728 assert(!UseJVMCIClassLoader || SystemDictionary::jvmci_loader() != NULL, "JVMCI classloader should have been initialized"); 728 assert(!UseJVMCIClassLoader || SystemDictionary::jvmci_loader() != NULL, "JVMCI classloader should have been initialized");
729 } 729 }
730 } 730 }
731 731
732 OptionsValueTable* JVMCIRuntime::parse_arguments() { 732 OptionValuesTable* JVMCIRuntime::parse_arguments() {
733 OptionsTable* table = OptionsTable::load_options(); 733 OptionDescsTable* table = OptionDescsTable::load_options();
734 if (table == NULL) { 734 if (table == NULL) {
735 return NULL; 735 return NULL;
736 } 736 }
737 737
738 OptionsValueTable* options = new OptionsValueTable(table); 738 OptionValuesTable* options = new OptionValuesTable(table);
739 739
740 // Process option overrides from jvmci.options first 740 // Process option overrides from jvmci.options first
741 parse_jvmci_options_file(options); 741 parse_jvmci_options_file(options);
742 742
743 // Now process options on the command line 743 // Now process options on the command line
750 } 750 }
751 } 751 }
752 return options; 752 return options;
753 } 753 }
754 754
755 void not_found(OptionsTable* table, const char* argname, size_t namelen) { 755 void not_found(OptionDescsTable* table, const char* argname, size_t namelen) {
756 jio_fprintf(defaultStream::error_stream(),"Unrecognized VM option '%.*s'\n", namelen, argname); 756 jio_fprintf(defaultStream::error_stream(),"Unrecognized VM option '%.*s'\n", namelen, argname);
757 OptionDesc* fuzzy_matched = table->fuzzy_match(argname, strlen(argname)); 757 OptionDesc* fuzzy_matched = table->fuzzy_match(argname, strlen(argname));
758 if (fuzzy_matched != NULL) { 758 if (fuzzy_matched != NULL) {
759 jio_fprintf(defaultStream::error_stream(), 759 jio_fprintf(defaultStream::error_stream(),
760 "Did you mean '%s%s%s'?\n", 760 "Did you mean '%s%s%s'?\n",
762 fuzzy_matched->name, 762 fuzzy_matched->name,
763 (fuzzy_matched->type == _boolean) ? "" : "=<value>"); 763 (fuzzy_matched->type == _boolean) ? "" : "=<value>");
764 } 764 }
765 } 765 }
766 766
767 bool JVMCIRuntime::parse_argument(OptionsValueTable* options, const char* arg) { 767 bool JVMCIRuntime::parse_argument(OptionValuesTable* options, const char* arg) {
768 OptionsTable* table = options->options_table(); 768 OptionDescsTable* table = options->options_table();
769 char first = arg[0]; 769 char first = arg[0];
770 const char* name; 770 const char* name;
771 size_t name_len; 771 size_t name_len;
772 if (first == '+' || first == '-') { 772 if (first == '+' || first == '-') {
773 name = arg + 1; 773 name = arg + 1;
860 return true; 860 return true;
861 } 861 }
862 } 862 }
863 863
864 class JVMCIOptionParseClosure : public ParseClosure { 864 class JVMCIOptionParseClosure : public ParseClosure {
865 OptionsValueTable* _options; 865 OptionValuesTable* _options;
866 public: 866 public:
867 JVMCIOptionParseClosure(OptionsValueTable* options) : _options(options) {} 867 JVMCIOptionParseClosure(OptionValuesTable* options) : _options(options) {}
868 void do_line(char* line) { 868 void do_line(char* line) {
869 if (!JVMCIRuntime::parse_argument(_options, line)) { 869 if (!JVMCIRuntime::parse_argument(_options, line)) {
870 warn("There was an error parsing an argument. Skipping it."); 870 warn("There was an error parsing an argument. Skipping it.");
871 } 871 }
872 } 872 }
873 }; 873 };
874 874
875 void JVMCIRuntime::parse_jvmci_options_file(OptionsValueTable* options) { 875 void JVMCIRuntime::parse_jvmci_options_file(OptionValuesTable* options) {
876 const char* home = Arguments::get_java_home(); 876 const char* home = Arguments::get_java_home();
877 size_t path_len = strlen(home) + strlen("/lib/jvmci.options") + 1; 877 size_t path_len = strlen(home) + strlen("/lib/jvmci.options") + 1;
878 char path[JVM_MAXPATHLEN]; 878 char path[JVM_MAXPATHLEN];
879 char sep = os::file_separator()[0]; 879 char sep = os::file_separator()[0];
880 jio_snprintf(path, JVM_MAXPATHLEN, "%s%clib%cjvmci.options", home, sep, sep); 880 jio_snprintf(path, JVM_MAXPATHLEN, "%s%clib%cjvmci.options", home, sep, sep);
1008 1008
1009 optionValueOop->obj_field_put(fd.offset(), value); 1009 optionValueOop->obj_field_put(fd.offset(), value);
1010 } 1010 }
1011 }; 1011 };
1012 1012
1013 void JVMCIRuntime::set_options(OptionsValueTable* options, TRAPS) { 1013 void JVMCIRuntime::set_options(OptionValuesTable* options, TRAPS) {
1014 ensure_jvmci_class_loader_is_initialized(); 1014 ensure_jvmci_class_loader_is_initialized();
1015 { 1015 {
1016 ResourceMark rm; 1016 ResourceMark rm;
1017 SetOptionClosure closure(THREAD); 1017 SetOptionClosure closure(THREAD);
1018 options->for_each(&closure); 1018 options->for_each(&closure);