changeset 3476:65981c23c1d6

Fixed bootstrap (lowered compilation threshold and register more methods for compilation)
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 03 Aug 2011 11:35:30 -0700
parents 0da7f6b247c9
children ce737132129b
files src/cpu/x86/vm/c1_globals_x86.hpp src/share/vm/classfile/vmSymbols.hpp src/share/vm/compiler/compileBroker.cpp src/share/vm/compiler/compileBroker.hpp
diffstat 4 files changed, 18 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/x86/vm/c1_globals_x86.hpp	Wed Aug 03 16:28:19 2011 +0200
+++ b/src/cpu/x86/vm/c1_globals_x86.hpp	Wed Aug 03 11:35:30 2011 -0700
@@ -40,7 +40,7 @@
 define_pd_global(bool, ProfileTraps,                 true );
 define_pd_global(bool, UseOnStackReplacement,        true );
 define_pd_global(bool, TieredCompilation,            false);
-define_pd_global(intx, CompileThreshold,             5000 );   // changed for GRAAL
+define_pd_global(intx, CompileThreshold,             4500 );   // changed for GRAAL
 define_pd_global(intx, BackEdgeThreshold,            100000);
 
 define_pd_global(intx, OnStackReplacePercentage,     933  );
--- a/src/share/vm/classfile/vmSymbols.hpp	Wed Aug 03 16:28:19 2011 +0200
+++ b/src/share/vm/classfile/vmSymbols.hpp	Wed Aug 03 11:35:30 2011 -0700
@@ -413,6 +413,7 @@
   template(bitCount_name,                             "bitCount")                                 \
   template(profile_name,                              "profile")                                  \
   template(equals_name,                               "equals")                                   \
+  template(length_name,                               "length")                                   \
   template(target_name,                               "target")                                   \
   template(toString_name,                             "toString")                                 \
   template(values_name,                               "values")                                   \
--- a/src/share/vm/compiler/compileBroker.cpp	Wed Aug 03 16:28:19 2011 +0200
+++ b/src/share/vm/compiler/compileBroker.cpp	Wed Aug 03 11:35:30 2011 -0700
@@ -642,6 +642,17 @@
   }
 }
 
+void CompileBroker::add_method_to_queue(klassOop k, Symbol* name, Symbol* signature) {
+  Thread* THREAD = Thread::current();
+  instanceKlass* klass = instanceKlass::cast(k);
+  methodOop method = klass->find_method(name, signature);
+  CompileBroker::compile_method(method, -1, 0, method, 0, "initial compile of object initializer", THREAD);
+  if (HAS_PENDING_EXCEPTION) {
+    CLEAR_PENDING_EXCEPTION;
+    fatal("error inserting method into compile queue");
+  }
+}
+
 // Bootstrap the graal compiler. Compiles all methods until compile queue is empty and no compilation is active.
 void CompileBroker::bootstrap_graal() {
   HandleMark hm;
@@ -652,14 +663,10 @@
   if (compiler == NULL) fatal("must use flag -XX:+UseGraal");
 
   jlong start = os::javaTimeMillis();
-
-  instanceKlass* klass = (instanceKlass*)SystemDictionary::Object_klass()->klass_part();
-  methodOop method = klass->find_method(vmSymbols::object_initializer_name(), vmSymbols::void_method_signature());
-  CompileBroker::compile_method(method, -1, 0, method, 0, "initial compile of object initializer", THREAD);
-  if (HAS_PENDING_EXCEPTION) {
-    CLEAR_PENDING_EXCEPTION;
-    fatal("error inserting object initializer into compile queue");
-  }
+  add_method_to_queue(SystemDictionary::Object_klass(), vmSymbols::object_initializer_name(), vmSymbols::void_method_signature());
+  add_method_to_queue(SystemDictionary::Object_klass(), vmSymbols::equals_name(), vmSymbols::object_boolean_signature());
+  add_method_to_queue(SystemDictionary::String_klass(), vmSymbols::length_name(), vmSymbols::void_int_signature());
+  add_method_to_queue(SystemDictionary::String_klass(), vmSymbols::object_initializer_name(), vmSymbols::void_method_signature());
 
   int z = 0;
   while (true) {
--- a/src/share/vm/compiler/compileBroker.hpp	Wed Aug 03 16:28:19 2011 +0200
+++ b/src/share/vm/compiler/compileBroker.hpp	Wed Aug 03 11:35:30 2011 -0700
@@ -403,6 +403,7 @@
   static void print_compiler_threads_on(outputStream* st);
 
   static void bootstrap_graal();
+  static void add_method_to_queue(klassOop k, Symbol* name, Symbol* signature);
 };
 
 #endif // SHARE_VM_COMPILER_COMPILEBROKER_HPP