# HG changeset patch # User Thomas Wuerthinger # Date 1291046306 -3600 # Node ID ba37b9335e1e0f09ae00cede25108a521c06b9b0 # Parent 2bae90a3deb9a0be2cd46a2c79ff0373dd680d0d 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. diff -r 2bae90a3deb9 -r ba37b9335e1e c1x4hotspotsrc/hotspot/.cproject --- 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 @@ - + @@ -66,11 +64,7 @@ - - - - - + diff -r 2bae90a3deb9 -r ba37b9335e1e src/share/vm/c1x/c1x_Compiler.cpp --- 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()); { diff -r 2bae90a3deb9 -r ba37b9335e1e src/share/vm/runtime/arguments.cpp --- 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) {