# HG changeset patch # User Thomas Wuerthinger # Date 1312396530 25200 # Node ID 65981c23c1d657289cde1a703fc1f24bae34f365 # Parent 0da7f6b247c987cf3fde1e4e691a9d2edd6e97b2 Fixed bootstrap (lowered compilation threshold and register more methods for compilation) diff -r 0da7f6b247c9 -r 65981c23c1d6 src/cpu/x86/vm/c1_globals_x86.hpp --- 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 ); diff -r 0da7f6b247c9 -r 65981c23c1d6 src/share/vm/classfile/vmSymbols.hpp --- 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") \ diff -r 0da7f6b247c9 -r 65981c23c1d6 src/share/vm/compiler/compileBroker.cpp --- 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) { diff -r 0da7f6b247c9 -r 65981c23c1d6 src/share/vm/compiler/compileBroker.hpp --- 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