Mercurial > hg > truffle
comparison src/share/vm/runtime/arguments.cpp @ 4559:723df37192d6
Make it possible again to build a real client libjvm, drop the UseGraal flag.
Use the --vm option instead of a special -vm option in the bench command
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Fri, 10 Feb 2012 17:04:03 +0100 |
parents | 685cbfb8e08e |
children | e43d36482d12 |
comparison
equal
deleted
inserted
replaced
4558:3706975946e4 | 4559:723df37192d6 |
---|---|
59 | 59 |
60 char** Arguments::_jvm_flags_array = NULL; | 60 char** Arguments::_jvm_flags_array = NULL; |
61 int Arguments::_num_jvm_flags = 0; | 61 int Arguments::_num_jvm_flags = 0; |
62 char** Arguments::_jvm_args_array = NULL; | 62 char** Arguments::_jvm_args_array = NULL; |
63 int Arguments::_num_jvm_args = 0; | 63 int Arguments::_num_jvm_args = 0; |
64 #ifdef GRAAL | |
64 char** Arguments::_graal_args_array = NULL; | 65 char** Arguments::_graal_args_array = NULL; |
65 int Arguments::_num_graal_args = 0; | 66 int Arguments::_num_graal_args = 0; |
67 #endif | |
66 char* Arguments::_java_command = NULL; | 68 char* Arguments::_java_command = NULL; |
67 SystemProperty* Arguments::_system_properties = NULL; | 69 SystemProperty* Arguments::_system_properties = NULL; |
68 const char* Arguments::_gc_log_filename = NULL; | 70 const char* Arguments::_gc_log_filename = NULL; |
69 bool Arguments::_has_profile = false; | 71 bool Arguments::_has_profile = false; |
70 bool Arguments::_has_alloc_profile = false; | 72 bool Arguments::_has_alloc_profile = false; |
98 SystemProperty *Arguments::_sun_boot_library_path = NULL; | 100 SystemProperty *Arguments::_sun_boot_library_path = NULL; |
99 SystemProperty *Arguments::_java_library_path = NULL; | 101 SystemProperty *Arguments::_java_library_path = NULL; |
100 SystemProperty *Arguments::_java_home = NULL; | 102 SystemProperty *Arguments::_java_home = NULL; |
101 SystemProperty *Arguments::_java_class_path = NULL; | 103 SystemProperty *Arguments::_java_class_path = NULL; |
102 SystemProperty *Arguments::_sun_boot_class_path = NULL; | 104 SystemProperty *Arguments::_sun_boot_class_path = NULL; |
105 #ifdef GRAAL | |
103 SystemProperty *Arguments::_compiler_class_path = NULL; | 106 SystemProperty *Arguments::_compiler_class_path = NULL; |
107 #endif | |
104 | 108 |
105 char* Arguments::_meta_index_path = NULL; | 109 char* Arguments::_meta_index_path = NULL; |
106 char* Arguments::_meta_index_dir = NULL; | 110 char* Arguments::_meta_index_dir = NULL; |
107 | 111 |
108 static bool force_client_mode = false; | 112 static bool force_client_mode = false; |
162 _java_endorsed_dirs = new SystemProperty("java.endorsed.dirs", NULL, true); | 166 _java_endorsed_dirs = new SystemProperty("java.endorsed.dirs", NULL, true); |
163 _sun_boot_library_path = new SystemProperty("sun.boot.library.path", NULL, true); | 167 _sun_boot_library_path = new SystemProperty("sun.boot.library.path", NULL, true); |
164 _java_library_path = new SystemProperty("java.library.path", NULL, true); | 168 _java_library_path = new SystemProperty("java.library.path", NULL, true); |
165 _java_home = new SystemProperty("java.home", NULL, true); | 169 _java_home = new SystemProperty("java.home", NULL, true); |
166 _sun_boot_class_path = new SystemProperty("sun.boot.class.path", NULL, true); | 170 _sun_boot_class_path = new SystemProperty("sun.boot.class.path", NULL, true); |
171 #ifdef GRAAL | |
167 _compiler_class_path = new SystemProperty("compiler.class.path", NULL, true); | 172 _compiler_class_path = new SystemProperty("compiler.class.path", NULL, true); |
173 #endif | |
168 | 174 |
169 _java_class_path = new SystemProperty("java.class.path", "", true); | 175 _java_class_path = new SystemProperty("java.class.path", "", true); |
170 | 176 |
171 // Add to System Property list. | 177 // Add to System Property list. |
172 PropertyList_add(&_system_properties, _java_ext_dirs); | 178 PropertyList_add(&_system_properties, _java_ext_dirs); |
174 PropertyList_add(&_system_properties, _sun_boot_library_path); | 180 PropertyList_add(&_system_properties, _sun_boot_library_path); |
175 PropertyList_add(&_system_properties, _java_library_path); | 181 PropertyList_add(&_system_properties, _java_library_path); |
176 PropertyList_add(&_system_properties, _java_home); | 182 PropertyList_add(&_system_properties, _java_home); |
177 PropertyList_add(&_system_properties, _java_class_path); | 183 PropertyList_add(&_system_properties, _java_class_path); |
178 PropertyList_add(&_system_properties, _sun_boot_class_path); | 184 PropertyList_add(&_system_properties, _sun_boot_class_path); |
185 #ifdef GRAAL | |
179 PropertyList_add(&_system_properties, _compiler_class_path); | 186 PropertyList_add(&_system_properties, _compiler_class_path); |
187 #endif | |
180 | 188 |
181 // Set OS specific system properties values | 189 // Set OS specific system properties values |
182 os::init_system_properties_values(); | 190 os::init_system_properties_values(); |
183 } | 191 } |
184 | 192 |
754 } | 762 } |
755 | 763 |
756 void Arguments::build_jvm_flags(const char* arg) { | 764 void Arguments::build_jvm_flags(const char* arg) { |
757 add_string(&_jvm_flags_array, &_num_jvm_flags, arg); | 765 add_string(&_jvm_flags_array, &_num_jvm_flags, arg); |
758 } | 766 } |
759 | 767 #ifdef GRAAL |
760 void Arguments::add_graal_arg(const char* arg) { | 768 void Arguments::add_graal_arg(const char* arg) { |
761 add_string(&_graal_args_array, &_num_graal_args, arg); | 769 add_string(&_graal_args_array, &_num_graal_args, arg); |
762 } | 770 } |
771 #endif | |
763 | 772 |
764 // utility function to return a string that concatenates all | 773 // utility function to return a string that concatenates all |
765 // strings in a given char** array | 774 // strings in a given char** array |
766 const char* Arguments::build_resource_string(char** args, int count) { | 775 const char* Arguments::build_resource_string(char** args, int count) { |
767 if (args == NULL || count == 0) { | 776 if (args == NULL || count == 0) { |
1929 status = status && verify_interval(TLABWasteTargetPercent, | 1938 status = status && verify_interval(TLABWasteTargetPercent, |
1930 1, 100, "TLABWasteTargetPercent"); | 1939 1, 100, "TLABWasteTargetPercent"); |
1931 | 1940 |
1932 status = status && verify_object_alignment(); | 1941 status = status && verify_object_alignment(); |
1933 | 1942 |
1943 #ifdef GRAAL | |
1944 if (UseCompressedOops) { | |
1945 jio_fprintf(defaultStream::error_stream(), | |
1946 "CompressedOops are not supported in Graal at the moment\n"); | |
1947 status = false; | |
1948 } | |
1949 if (UseG1GC) { | |
1950 jio_fprintf(defaultStream::error_stream(), | |
1951 "G1 is not supported in Graal at the moment\n"); | |
1952 status = false; | |
1953 } | |
1954 #endif | |
1955 | |
1934 return status; | 1956 return status; |
1935 } | 1957 } |
1936 | 1958 |
1937 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore, | 1959 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore, |
1938 const char* option_type) { | 1960 const char* option_type) { |
2008 if (!atomull(s, long_arg)) return arg_unreadable; | 2030 if (!atomull(s, long_arg)) return arg_unreadable; |
2009 return check_memory_size(*long_arg, min_size); | 2031 return check_memory_size(*long_arg, min_size); |
2010 } | 2032 } |
2011 | 2033 |
2012 // Parse JavaVMInitArgs structure | 2034 // Parse JavaVMInitArgs structure |
2013 | 2035 #ifdef GRAAL |
2014 static void prepend_to_graal_classpath(SysClassPath &cp, const char* graal_dir, const char* project) { | 2036 static void prepend_to_graal_classpath(SysClassPath &cp, const char* graal_dir, const char* project) { |
2015 const int BUFFER_SIZE = 1024; | 2037 const int BUFFER_SIZE = 1024; |
2016 char path[BUFFER_SIZE]; | 2038 char path[BUFFER_SIZE]; |
2017 | 2039 |
2018 const char fileSep = *os::file_separator(); | 2040 const char fileSep = *os::file_separator(); |
2054 end--; | 2076 end--; |
2055 } | 2077 } |
2056 } | 2078 } |
2057 return false; | 2079 return false; |
2058 } | 2080 } |
2081 #endif | |
2059 | 2082 |
2060 jint Arguments::parse_vm_init_args(const JavaVMInitArgs* args) { | 2083 jint Arguments::parse_vm_init_args(const JavaVMInitArgs* args) { |
2061 // For components of the system classpath. | 2084 // For components of the system classpath. |
2062 SysClassPath scp(Arguments::get_sysclasspath()); | 2085 SysClassPath scp(Arguments::get_sysclasspath()); |
2063 bool scp_assembly_required = false; | 2086 bool scp_assembly_required = false; |
2081 result = parse_each_vm_init_arg(args, &scp, &scp_assembly_required, COMMAND_LINE); | 2104 result = parse_each_vm_init_arg(args, &scp, &scp_assembly_required, COMMAND_LINE); |
2082 if (result != JNI_OK) { | 2105 if (result != JNI_OK) { |
2083 return result; | 2106 return result; |
2084 } | 2107 } |
2085 | 2108 |
2086 if (UseGraal) { | 2109 #ifdef GRAAL |
2087 if (PrintVMOptions) { | 2110 if (PrintVMOptions) { |
2088 tty->print_cr("Running Graal VM... "); | 2111 tty->print_cr("Running Graal VM... "); |
2089 } | 2112 } |
2090 const int BUFFER_SIZE = 1024; | 2113 const int BUFFER_SIZE = 1024; |
2091 char graal_dir[BUFFER_SIZE]; | 2114 char graal_dir[BUFFER_SIZE]; |
2113 os::closedir(graal_dir_handle); | 2136 os::closedir(graal_dir_handle); |
2114 FREE_C_HEAP_ARRAY(char, tdbuf); | 2137 FREE_C_HEAP_ARRAY(char, tdbuf); |
2115 scp_compiler.expand_endorsed(); | 2138 scp_compiler.expand_endorsed(); |
2116 | 2139 |
2117 Arguments::set_compilerclasspath(scp_compiler.combined_path()); | 2140 Arguments::set_compilerclasspath(scp_compiler.combined_path()); |
2118 } | 2141 #endif |
2119 | 2142 |
2120 if (AggressiveOpts) { | 2143 if (AggressiveOpts) { |
2121 // Insert alt-rt.jar between user-specified bootclasspath | 2144 // Insert alt-rt.jar between user-specified bootclasspath |
2122 // prefix and the default bootclasspath. os::set_boot_path() | 2145 // prefix and the default bootclasspath. os::set_boot_path() |
2123 // uses meta_index_dir as the default bootclasspath directory. | 2146 // uses meta_index_dir as the default bootclasspath directory. |
2775 if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) { | 2798 if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) { |
2776 if (!process_argument(tail, args->ignoreUnrecognized, origin)) { | 2799 if (!process_argument(tail, args->ignoreUnrecognized, origin)) { |
2777 return JNI_EINVAL; | 2800 return JNI_EINVAL; |
2778 } | 2801 } |
2779 } | 2802 } |
2780 } else if (match_option(option, "-G:", &tail)) { // -G:XXX | 2803 } |
2804 #ifdef GRAAL | |
2805 else if (match_option(option, "-G:", &tail)) { // -G:XXX | |
2781 // Option for the graal compiler. | 2806 // Option for the graal compiler. |
2782 if (PrintVMOptions) { | 2807 if (PrintVMOptions) { |
2783 tty->print_cr("graal option %s", tail); | 2808 tty->print_cr("graal option %s", tail); |
2784 } | 2809 } |
2785 Arguments::add_graal_arg(tail); | 2810 Arguments::add_graal_arg(tail); |
2786 | 2811 |
2787 // Unknown option | 2812 // Unknown option |
2788 } else if (is_bad_option(option, args->ignoreUnrecognized)) { | 2813 } |
2814 #endif | |
2815 else if (is_bad_option(option, args->ignoreUnrecognized)) { | |
2789 return JNI_ERR; | 2816 return JNI_ERR; |
2790 } | 2817 } |
2791 } | 2818 } |
2792 | 2819 |
2793 // Change the default value for flags which have different default values | 2820 // Change the default value for flags which have different default values |