comparison src/share/vm/runtime/arguments.cpp @ 7062:8c5333c80cfd

increased CompileThreshold to increase reliability of profiling information increased InitialCodeCacheSize to fit the bootstrapping added flag -XX:GraalClassPath to allow providing a .jar or .zip file that contains all Graal classes added support for the flag -XX:TraceCompilationPolicy to the Graal-specific compilation policy
author Christian Haeubl <haeubl@ssw.jku.at>
date Thu, 15 Nov 2012 11:40:50 +0100
parents c38f13903fdf
children 7d815d842ee0
comparison
equal deleted inserted replaced
6717:5bbe9618118e 7062:8c5333c80cfd
2055 return check_memory_size(*long_arg, min_size); 2055 return check_memory_size(*long_arg, min_size);
2056 } 2056 }
2057 2057
2058 // Parse JavaVMInitArgs structure 2058 // Parse JavaVMInitArgs structure
2059 #ifdef GRAAL 2059 #ifdef GRAAL
2060 static void prepend_to_graal_classpath(SysClassPath &cp, const char* path) {
2061 cp.add_prefix(path);
2062 }
2063
2060 static void prepend_to_graal_classpath(SysClassPath &cp, const char* graal_dir, const char* project) { 2064 static void prepend_to_graal_classpath(SysClassPath &cp, const char* graal_dir, const char* project) {
2061 const int BUFFER_SIZE = 1024; 2065 const int BUFFER_SIZE = 1024;
2062 char path[BUFFER_SIZE]; 2066 char path[BUFFER_SIZE];
2063 2067
2064 const char fileSep = *os::file_separator(); 2068 const char fileSep = *os::file_separator();
2065 sprintf(path, "%s%c%s%cbin", graal_dir, fileSep, project, fileSep); 2069 sprintf(path, "%s%c%s%cbin", graal_dir, fileSep, project, fileSep);
2070
2066 DIR* dir = os::opendir(path); 2071 DIR* dir = os::opendir(path);
2067 if (dir == NULL) { 2072 if (dir == NULL) {
2068 jio_fprintf(defaultStream::output_stream(), "Error while starting Graal VM: The Graal class directory %s could not be opened.\n", path); 2073 jio_fprintf(defaultStream::output_stream(), "Error while starting Graal VM: The Graal class directory %s could not be opened.\n", path);
2069 vm_exit(1); 2074 vm_exit(1);
2070 } 2075 }
2071 os::closedir(dir); 2076 os::closedir(dir);
2072 cp.add_prefix(path); 2077 prepend_to_graal_classpath(cp, path);
2073 } 2078 }
2074 2079
2075 // Walk up the directory hierarchy starting from JAVA_HOME looking 2080 // Walk up the directory hierarchy starting from JAVA_HOME looking
2076 // for a directory named "graal". If found, then the full path to 2081 // for a directory named "graal". If found, then the full path to
2077 // this directory is returned in graal_dir. 2082 // this directory is returned in graal_dir.
2132 2137
2133 #ifdef GRAAL 2138 #ifdef GRAAL
2134 if (PrintVMOptions) { 2139 if (PrintVMOptions) {
2135 tty->print_cr("Running Graal VM... "); 2140 tty->print_cr("Running Graal VM... ");
2136 } 2141 }
2137 const int BUFFER_SIZE = 1024; 2142
2138 char graal_dir[BUFFER_SIZE]; 2143 SysClassPath scp_compiler("");
2139 if (!os::getenv("GRAAL", graal_dir, sizeof(graal_dir))) { 2144
2140 if (find_graal_dir(graal_dir) == false) { 2145 if (GraalClassPath != NULL) {
2141 jio_fprintf(defaultStream::output_stream(), "Error while starting Graal VM: The GRAAL environment variable needs to point to the directory containing the Graal projects.\n"); 2146 prepend_to_graal_classpath(scp_compiler, GraalClassPath);
2142 vm_exit(0); 2147 } else {
2143 } 2148 const int BUFFER_SIZE = 1024;
2144 } 2149 char graal_dir[BUFFER_SIZE];
2145 if (PrintVMOptions) tty->print_cr("GRAAL=%s", graal_dir); 2150 if (!os::getenv("GRAAL", graal_dir, sizeof(graal_dir))) {
2151 if (find_graal_dir(graal_dir) == false) {
2152 jio_fprintf(defaultStream::output_stream(), "Error while starting Graal VM: The GRAAL environment variable needs to point to the directory containing the Graal projects.\n");
2153 vm_exit(0);
2154 }
2155 }
2156 if (PrintVMOptions) tty->print_cr("GRAAL=%s", graal_dir);
2146 2157
2147 // this declaration is checked for correctness by 'mx build' - only 2158 // this declaration is checked for correctness by 'mx build' - only
2148 // modify its entries, not its name or shape 2159 // modify its entries, not its name or shape
2149 const char* graal_projects[] = { 2160 const char* graal_projects[] = {
2150 #ifdef AMD64 2161 #ifdef AMD64
2151 "com.oracle.graal.amd64", 2162 "com.oracle.graal.amd64",
2152 "com.oracle.graal.asm.amd64", 2163 "com.oracle.graal.asm.amd64",
2153 "com.oracle.graal.lir.amd64", 2164 "com.oracle.graal.lir.amd64",
2154 "com.oracle.graal.compiler.amd64", 2165 "com.oracle.graal.compiler.amd64",
2155 "com.oracle.graal.hotspot.amd64", 2166 "com.oracle.graal.hotspot.amd64",
2156 #endif 2167 #endif
2157 "com.oracle.graal.api.runtime", 2168 "com.oracle.graal.api.runtime",
2158 "com.oracle.graal.api.meta", 2169 "com.oracle.graal.api.meta",
2159 "com.oracle.graal.api.code", 2170 "com.oracle.graal.api.code",
2160 "com.oracle.graal.api.interpreter", 2171 "com.oracle.graal.api.interpreter",
2161 "com.oracle.graal.hotspot", 2172 "com.oracle.graal.hotspot",
2162 "com.oracle.graal.asm", 2173 "com.oracle.graal.asm",
2163 "com.oracle.graal.alloc", 2174 "com.oracle.graal.alloc",
2164 "com.oracle.graal.snippets", 2175 "com.oracle.graal.snippets",
2165 "com.oracle.graal.compiler", 2176 "com.oracle.graal.compiler",
2166 "com.oracle.graal.loop", 2177 "com.oracle.graal.loop",
2167 "com.oracle.graal.phases", 2178 "com.oracle.graal.phases",
2168 "com.oracle.graal.phases.common", 2179 "com.oracle.graal.phases.common",
2169 "com.oracle.graal.virtual", 2180 "com.oracle.graal.virtual",
2170 "com.oracle.graal.nodes", 2181 "com.oracle.graal.nodes",
2171 "com.oracle.graal.printer", 2182 "com.oracle.graal.printer",
2172 "com.oracle.graal.debug", 2183 "com.oracle.graal.debug",
2173 "com.oracle.graal.graph", 2184 "com.oracle.graal.graph",
2174 "com.oracle.graal.lir", 2185 "com.oracle.graal.lir",
2175 "com.oracle.graal.bytecode", 2186 "com.oracle.graal.bytecode",
2176 "com.oracle.graal.java" 2187 "com.oracle.graal.java"
2177 }; 2188 };
2178 2189
2179 SysClassPath scp_compiler(""); 2190 const int len = sizeof(graal_projects) / sizeof(char*);
2180 const int len = sizeof(graal_projects) / sizeof(char*); 2191 for (int i = 0; i < len; i++) {
2181 for (int i = 0; i < len; i++) { 2192 if (PrintVMOptions) {
2182 if (PrintVMOptions) { 2193 tty->print_cr("Adding project directory %s to bootclasspath", graal_projects[i]);
2183 tty->print_cr("Adding project directory %s to bootclasspath", graal_projects[i]); 2194 }
2184 } 2195 prepend_to_graal_classpath(scp_compiler, graal_dir, graal_projects[i]);
2185 prepend_to_graal_classpath(scp_compiler, graal_dir, graal_projects[i]); 2196 }
2186 } 2197 }
2198
2187 scp_compiler.expand_endorsed(); 2199 scp_compiler.expand_endorsed();
2188
2189 Arguments::set_compilerclasspath(scp_compiler.combined_path()); 2200 Arguments::set_compilerclasspath(scp_compiler.combined_path());
2201
2190 #endif 2202 #endif
2191 2203
2192 if (AggressiveOpts) { 2204 if (AggressiveOpts) {
2193 // Insert alt-rt.jar between user-specified bootclasspath 2205 // Insert alt-rt.jar between user-specified bootclasspath
2194 // prefix and the default bootclasspath. os::set_boot_path() 2206 // prefix and the default bootclasspath. os::set_boot_path()