changeset 1483:ba37b9335e1e

New option "-graal" that sets up the correct boot class path and C1X options using only the two environment variables MAXINE and GRAAL. This greatly simplifies command line arguments necessary to start the Graal VM.
author Thomas Wuerthinger <wuerthinger@ssw.jku.at>
date Mon, 29 Nov 2010 16:58:26 +0100
parents 2bae90a3deb9
children 6b7001391c97
files c1x4hotspotsrc/hotspot/.cproject src/share/vm/c1x/c1x_Compiler.cpp src/share/vm/runtime/arguments.cpp
diffstat 3 files changed, 47 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/c1x4hotspotsrc/hotspot/.cproject	Mon Nov 29 12:02:16 2010 +0100
+++ b/c1x4hotspotsrc/hotspot/.cproject	Mon Nov 29 16:58:26 2010 +0100
@@ -27,29 +27,27 @@
 							</builder>
 							<tool id="cdt.managedbuild.tool.gnu.archiver.base.1094883386" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
 							<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.1342888057" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
-								<option id="gnu.cpp.compiler.option.include.paths.801956928" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
-									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/hotspot/generated}&quot;"/>
-								</option>
+								<option id="gnu.cpp.compiler.option.include.paths.801956928" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"/>
 								<option id="gnu.cpp.compiler.option.preprocessor.def.634868600" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
-									<listOptionValue builtIn="false" value="_LP64"/>
-									<listOptionValue builtIn="false" value="_REENTRANT"/>
-									<listOptionValue builtIn="false" value="AMD64"/>
-									<listOptionValue builtIn="false" value="ASSERT"/>
-									<listOptionValue builtIn="false" value="COMPILER1"/>
-									<listOptionValue builtIn="false" value="DEBUG"/>
-									<listOptionValue builtIn="false" value="VM_LITTLE_ENDIAN"/>
+									<listOptionValue builtIn="false" value="_LP64=1"/>
+									<listOptionValue builtIn="false" value="COMPILER1=1"/>
+									<listOptionValue builtIn="false" value="VM_LITTLE_ENDIAN=1"/>
+									<listOptionValue builtIn="false" value="ASSERT=1"/>
+									<listOptionValue builtIn="false" value="_REENTRANT=1"/>
+									<listOptionValue builtIn="false" value="DEBUG=1"/>
+									<listOptionValue builtIn="false" value="AMD64=1"/>
 								</option>
 								<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.866181452" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
 							</tool>
 							<tool id="cdt.managedbuild.tool.gnu.c.compiler.base.1535888880" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base">
 								<option id="gnu.c.compiler.option.preprocessor.def.symbols.825962493" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
-									<listOptionValue builtIn="false" value="AMD64"/>
-									<listOptionValue builtIn="false" value="ASSERT"/>
-									<listOptionValue builtIn="false" value="DEBUG"/>
-									<listOptionValue builtIn="false" value="COMPILER1"/>
-									<listOptionValue builtIn="false" value="_REENTRANT"/>
-									<listOptionValue builtIn="false" value="VM_LITTLE_ENDIAN"/>
 									<listOptionValue builtIn="false" value="_LP64=1"/>
+									<listOptionValue builtIn="false" value="COMPILER1=1"/>
+									<listOptionValue builtIn="false" value="VM_LITTLE_ENDIAN=1"/>
+									<listOptionValue builtIn="false" value="ASSERT=1"/>
+									<listOptionValue builtIn="false" value="_REENTRANT=1"/>
+									<listOptionValue builtIn="false" value="DEBUG=1"/>
+									<listOptionValue builtIn="false" value="AMD64=1"/>
 								</option>
 								<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.906671119" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
 							</tool>
@@ -66,11 +64,7 @@
 						</toolChain>
 					</folderInfo>
 					<sourceEntries>
-						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="vm"/>
-						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="os"/>
-						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="cpu"/>
-						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="os_cpu"/>
-						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="generated"/>
+						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
 					</sourceEntries>
 				</configuration>
 			</storageModule>
--- a/src/share/vm/c1x/c1x_Compiler.cpp	Mon Nov 29 12:02:16 2010 +0100
+++ b/src/share/vm/c1x/c1x_Compiler.cpp	Mon Nov 29 16:58:26 2010 +0100
@@ -42,7 +42,9 @@
 
   JNIEnv *env = ((JavaThread *) Thread::current())->jni_environment();
   jclass klass = env->FindClass("com/sun/hotspot/c1x/VMEntriesNative");
-  assert(klass != NULL, "c1x VMEntries class not found");
+  if (klass == NULL) {
+    fatal("c1x VMEntries class not found");
+  }
   env->RegisterNatives(klass, VMEntries_methods, VMEntries_methods_count());
 
   {
--- a/src/share/vm/runtime/arguments.cpp	Mon Nov 29 12:02:16 2010 +0100
+++ b/src/share/vm/runtime/arguments.cpp	Mon Nov 29 16:58:26 2010 +0100
@@ -2549,6 +2549,35 @@
           return JNI_EINVAL;
         }
       }
+    } else if (match_option(option, "-graal", &tail)) {
+      if (PrintVMOptions) {
+        tty->print("Running Graal VM... ");
+      }
+      UseC1X = true;
+      BootstrapC1X = true;
+      const int BUFFER_SIZE = 1024;
+      char maxine_dir[BUFFER_SIZE];
+      char graal_dir[BUFFER_SIZE];
+      char temp[BUFFER_SIZE];
+      if (!os::getenv("MAXINE", maxine_dir, sizeof(maxine_dir))) {
+        fatal("Must set MAXINE environment variable to a Maxine project directory.");
+      }
+      if (PrintVMOptions) tty->print("MAXINE=%s", maxine_dir);
+      if (!os::getenv("GRAAL", graal_dir, sizeof(graal_dir))) {
+        fatal("Must set GRAAL environment variable to a Graal project directory.");
+      }
+      if (PrintVMOptions) tty->print_cr(" GRAAL=%s", graal_dir);
+      sprintf(temp, "%s/C1X/bin", maxine_dir);
+      scp_p->add_prefix(temp);
+      sprintf(temp, "%s/CRI/bin", maxine_dir);
+      scp_p->add_prefix(temp);
+      sprintf(temp, "%s/Base/bin", maxine_dir);
+      scp_p->add_prefix(temp);
+      sprintf(temp, "%s/Assembler/bin", maxine_dir);
+      scp_p->add_prefix(temp);
+      sprintf(temp, "%s/c1x4hotspotsrc/HotSpotVM/bin", graal_dir);
+      scp_p->add_prefix(temp);
+      *scp_assembly_required_p = true;
     } else if (match_option(option, "-C1X:", &tail)) { // -C1X:xxxx
       // Option for the C1X compiler.
       if (PrintVMOptions) {