changeset 3546:4aa80ca3dbec

Separate compiler bootstrappath from application bootstrappath.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Sun, 14 Aug 2011 00:55:28 +0200
parents d8c27956ec6e
children 44da449fc29c
files runpmd.sh src/share/vm/classfile/classLoader.cpp src/share/vm/classfile/classLoader.hpp src/share/vm/runtime/arguments.cpp src/share/vm/runtime/arguments.hpp
diffstat 5 files changed, 45 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/runpmd.sh	Sat Aug 13 18:21:33 2011 +0200
+++ b/runpmd.sh	Sun Aug 14 00:55:28 2011 +0200
@@ -15,7 +15,7 @@
   echo "DACAPO is not defined. It must point to a Dacapo benchmark directory."
   exit 1;
 fi
-COMMAND="${JDK7}/bin/java -graal -Xms1g -Xmx2g -esa -classpath ${DACAPO}/dacapo-9.12-bach.jar -XX:-GraalBailoutIsFatal -G:-QuietBailout $* Harness --preserve -n 5 pmd"
+COMMAND="${JDK7}/bin/java -graal -Xms1g -Xmx2g -classpath ${DACAPO}/dacapo-9.12-bach.jar -XX:-GraalBailoutIsFatal -G:-QuietBailout $* Harness --preserve -n 10 pmd"
 echo $COMMAND
 $COMMAND
 echo $COMMAND
--- a/src/share/vm/classfile/classLoader.cpp	Sat Aug 13 18:21:33 2011 +0200
+++ b/src/share/vm/classfile/classLoader.cpp	Sun Aug 14 00:55:28 2011 +0200
@@ -181,6 +181,7 @@
 
 ClassPathEntry::ClassPathEntry() {
   set_next(NULL);
+  _compiler_thread_only = false;
 }
 
 
@@ -439,10 +440,17 @@
 void ClassLoader::setup_bootstrap_search_path() {
   assert(_first_entry == NULL, "should not setup bootstrap class search path twice");
   char* sys_class_path = os::strdup(Arguments::get_sysclasspath());
+  char* compiler_class_path = os::strdup(Arguments::get_compilerclasspath());
   if (TraceClassLoading && Verbose) {
     tty->print_cr("[Bootstrap loader class path=%s]", sys_class_path);
+    tty->print_cr("[Compiler loader class path=%s]", compiler_class_path);
   }
 
+  setup_bootstrap_search_path(sys_class_path, false);
+  setup_bootstrap_search_path(compiler_class_path, true);
+}
+
+void ClassLoader::setup_bootstrap_search_path(char* sys_class_path, bool compiler_cp) {
   int len = (int)strlen(sys_class_path);
   int end = 0;
 
@@ -454,7 +462,7 @@
     char* path = NEW_C_HEAP_ARRAY(char, end-start+1);
     strncpy(path, &sys_class_path[start], end-start);
     path[end-start] = '\0';
-    update_class_path_entry_list(path, false);
+    update_class_path_entry_list(path, false, compiler_cp);
     FREE_C_HEAP_ARRAY(char, path);
     while (sys_class_path[end] == os::path_separator()[0]) {
       end++;
@@ -550,7 +558,7 @@
   ClassPathEntry* e = _first_entry;
   while (e != NULL) {
     // assume zip entries have been canonicalized
-    if (strcmp(entry->name(), e->name()) == 0) {
+	if (e->compiler_thread_only() == entry->compiler_thread_only() && strcmp(entry->name(), e->name()) == 0) {
       return true;
     }
     e = e->next();
@@ -570,12 +578,14 @@
 }
 
 void ClassLoader::update_class_path_entry_list(const char *path,
-                                               bool check_for_duplicates) {
+                                               bool check_for_duplicates,
+											   bool compiler_cp) {
   struct stat st;
   if (os::stat((char *)path, &st) == 0) {
     // File or directory found
     ClassPathEntry* new_entry = NULL;
     create_class_path_entry((char *)path, st, &new_entry, LazyBootClassLoader);
+	new_entry->set_compiler_thread_only(compiler_cp);
     // The kernel VM adds dynamically to the end of the classloader path and
     // doesn't reorder the bootclasspath which would break java.lang.Package
     // (see PackageInfo).
@@ -890,9 +900,11 @@
     PerfClassTraceTime vmtimer(perf_sys_class_lookup_time(),
                                ((JavaThread*) THREAD)->get_thread_stat()->perf_timers_addr(),
                                PerfClassTraceTime::CLASS_LOAD);
-    ClassPathEntry* e = _first_entry;
+    ClassPathEntry* e = _first_entry; 
     while (e != NULL) {
-      stream = e->open_stream(name);
+      if (THREAD->is_Compiler_thread() || !Universe::_fully_initialized || !e->compiler_thread_only()) {
+        stream = e->open_stream(name);
+      }
       if (stream != NULL) {
         break;
       }
--- a/src/share/vm/classfile/classLoader.hpp	Sat Aug 13 18:21:33 2011 +0200
+++ b/src/share/vm/classfile/classLoader.hpp	Sun Aug 14 00:55:28 2011 +0200
@@ -49,6 +49,7 @@
 class ClassPathEntry: public CHeapObj {
  private:
   ClassPathEntry* _next;
+  bool _compiler_thread_only;
  public:
   // Next entry in class path
   ClassPathEntry* next()              { return _next; }
@@ -59,6 +60,8 @@
   virtual bool is_jar_file() = 0;
   virtual const char* name() = 0;
   virtual bool is_lazy();
+  bool compiler_thread_only() const { return _compiler_thread_only; }
+  void set_compiler_thread_only(bool b) { _compiler_thread_only = b; }
   // Constructor
   ClassPathEntry();
   // Attempt to locate file_name through this class path entry.
@@ -206,6 +209,7 @@
   // Initialization
   static void setup_meta_index();
   static void setup_bootstrap_search_path();
+  static void setup_bootstrap_search_path(char* sys_class_path, bool compiler_cp);
   static void load_zip_library();
   static void create_class_path_entry(char *path, struct stat st, ClassPathEntry **new_entry, bool lazy);
 
@@ -215,7 +219,8 @@
  public:
   // Used by the kernel jvm.
   static void update_class_path_entry_list(const char *path,
-                                           bool check_for_duplicates);
+                                           bool check_for_duplicates,
+										   bool compiler_cp);
   static void print_bootclasspath();
 
   // Timing
--- a/src/share/vm/runtime/arguments.cpp	Sat Aug 13 18:21:33 2011 +0200
+++ b/src/share/vm/runtime/arguments.cpp	Sun Aug 14 00:55:28 2011 +0200
@@ -106,6 +106,7 @@
 SystemProperty *Arguments::_java_home = NULL;
 SystemProperty *Arguments::_java_class_path = NULL;
 SystemProperty *Arguments::_sun_boot_class_path = NULL;
+SystemProperty *Arguments::_compiler_class_path = NULL;
 
 char* Arguments::_meta_index_path = NULL;
 char* Arguments::_meta_index_dir = NULL;
@@ -169,6 +170,7 @@
   _java_library_path = new SystemProperty("java.library.path", NULL,  true);
   _java_home =  new SystemProperty("java.home", NULL,  true);
   _sun_boot_class_path = new SystemProperty("sun.boot.class.path", NULL,  true);
+  _compiler_class_path = new SystemProperty("compiler.class.path", NULL,  true);
 
   _java_class_path = new SystemProperty("java.class.path", "",  true);
 
@@ -180,6 +182,7 @@
   PropertyList_add(&_system_properties, _java_home);
   PropertyList_add(&_system_properties, _java_class_path);
   PropertyList_add(&_system_properties, _sun_boot_class_path);
+  PropertyList_add(&_system_properties, _compiler_class_path);
 
   // Set OS specific system properties values
   os::init_system_properties_values();
@@ -2015,36 +2018,38 @@
 
   if (UseGraal) {
     if (PrintVMOptions) {
-    tty->print("Running Graal VM... ");
+      tty->print("Running Graal VM... ");
     }
     const int BUFFER_SIZE = 1024;
     char maxine_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.");
+	  fatal("Must set MAXINE environment variable to a Maxine project directory.");
     }
     if (PrintVMOptions) tty->print("MAXINE=%s", maxine_dir);
+	SysClassPath scp_compiler(Arguments::get_sysclasspath());
     sprintf(temp, "%s/com.oracle.max.cri/bin", maxine_dir);
-    scp.add_prefix(temp);
+    scp_compiler.add_prefix(temp);
     sprintf(temp, "%s/com.oracle.max.base/bin", maxine_dir);
-    scp.add_prefix(temp);
+    scp_compiler.add_prefix(temp);
     sprintf(temp, "%s/com.oracle.max.asmdis/bin", maxine_dir);
-    scp.add_prefix(temp);
+    scp_compiler.add_prefix(temp);
     sprintf(temp, "%s/com.oracle.max.asm/bin", maxine_dir);
-    scp.add_prefix(temp);
+    scp_compiler.add_prefix(temp);
     sprintf(temp, "%s/com.oracle.max.graal.graph/bin", maxine_dir);
-    scp.add_prefix(temp);
+    scp_compiler.add_prefix(temp);
     sprintf(temp, "%s/com.oracle.max.graal.compiler/bin", maxine_dir);
-    scp.add_prefix(temp);
+    scp_compiler.add_prefix(temp);
     sprintf(temp, "%s/com.oracle.max.graal.nodes/bin", maxine_dir);
-    scp.add_prefix(temp);
+    scp_compiler.add_prefix(temp);
     sprintf(temp, "%s/com.oracle.max.graal.extensions/bin", maxine_dir);
-    scp.add_prefix(temp);
+    scp_compiler.add_prefix(temp);
     sprintf(temp, "%s/com.oracle.max.graal.runtime/bin", maxine_dir);
-    scp.add_prefix(temp);
+    scp_compiler.add_prefix(temp);
     sprintf(temp, "%s/com.oracle.max.graal.graphviz/bin", maxine_dir);
-    scp.add_prefix(temp);
-    scp_assembly_required = true;
+    scp_compiler.add_prefix(temp);
+	scp_compiler.expand_endorsed();
+	Arguments::set_compilerclasspath(scp_compiler.combined_path());
   }
 
   if (AggressiveOpts) {
--- a/src/share/vm/runtime/arguments.hpp	Sat Aug 13 18:21:33 2011 +0200
+++ b/src/share/vm/runtime/arguments.hpp	Sun Aug 14 00:55:28 2011 +0200
@@ -245,6 +245,7 @@
   static SystemProperty *_java_home;
   static SystemProperty *_java_class_path;
   static SystemProperty *_sun_boot_class_path;
+  static SystemProperty *_compiler_class_path;
 
   // Meta-index for knowing what packages are in the boot class path
   static char* _meta_index_path;
@@ -525,6 +526,7 @@
   static void set_ext_dirs(char *value) { _java_ext_dirs->set_value(value); }
   static void set_endorsed_dirs(char *value) { _java_endorsed_dirs->set_value(value); }
   static void set_sysclasspath(char *value) { _sun_boot_class_path->set_value(value); }
+  static void set_compilerclasspath(char *value) { _compiler_class_path->set_value(value); }
   static void append_sysclasspath(const char *value) { _sun_boot_class_path->append_value(value); }
   static void set_meta_index_path(char* meta_index_path, char* meta_index_dir) {
     _meta_index_path = meta_index_path;
@@ -535,6 +537,7 @@
   static char *get_dll_dir() { return _sun_boot_library_path->value(); }
   static char *get_endorsed_dir() { return _java_endorsed_dirs->value(); }
   static char *get_sysclasspath() { return _sun_boot_class_path->value(); }
+  static char *get_compilerclasspath() { return _compiler_class_path->value(); }
   static char* get_meta_index_path() { return _meta_index_path; }
   static char* get_meta_index_dir()  { return _meta_index_dir;  }