Mercurial > hg > graal-jvmci-8
comparison src/share/vm/compiler/compileBroker.cpp @ 2891:75a99b4f1c98
Rebranded C++ part from C1X to Graal.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 08 Jun 2011 14:01:51 +0200 |
parents | e88293edf07c |
children | d577d07cedec |
comparison
equal
deleted
inserted
replaced
2890:c23d45daff9b | 2891:75a99b4f1c98 |
---|---|
42 #include "runtime/javaCalls.hpp" | 42 #include "runtime/javaCalls.hpp" |
43 #include "runtime/os.hpp" | 43 #include "runtime/os.hpp" |
44 #include "runtime/sharedRuntime.hpp" | 44 #include "runtime/sharedRuntime.hpp" |
45 #include "runtime/sweeper.hpp" | 45 #include "runtime/sweeper.hpp" |
46 #include "utilities/dtrace.hpp" | 46 #include "utilities/dtrace.hpp" |
47 #include "c1x/c1x_Compiler.hpp" | 47 #include "graal/graalCompiler.hpp" |
48 #ifdef COMPILER1 | 48 #ifdef COMPILER1 |
49 #include "c1/c1_Compiler.hpp" | 49 #include "c1/c1_Compiler.hpp" |
50 #endif | 50 #endif |
51 #ifdef COMPILER2 | 51 #ifdef COMPILER2 |
52 #include "opto/c2compiler.hpp" | 52 #include "opto/c2compiler.hpp" |
625 _perf_compiles = PerfDataManager::create_counter(SUN_CI, name, | 625 _perf_compiles = PerfDataManager::create_counter(SUN_CI, name, |
626 PerfData::U_Events, CHECK); | 626 PerfData::U_Events, CHECK); |
627 } | 627 } |
628 } | 628 } |
629 | 629 |
630 // Bootstrap the C1X compiler. Compiles all methods until compile queue is empty and no compilation is active. | 630 // Bootstrap the graal compiler. Compiles all methods until compile queue is empty and no compilation is active. |
631 void CompileBroker::bootstrap_c1x() { | 631 void CompileBroker::bootstrap_graal() { |
632 HandleMark hm; | 632 HandleMark hm; |
633 Thread* THREAD = Thread::current(); | 633 Thread* THREAD = Thread::current(); |
634 tty->print_cr("Bootstrapping C1X...."); | 634 tty->print_cr("Bootstrapping graal...."); |
635 | 635 |
636 C1XCompiler* compiler = C1XCompiler::instance(); | 636 GraalCompiler* compiler = GraalCompiler::instance(); |
637 if (compiler == NULL) fatal("must use flag -XX:+UseC1X"); | 637 if (compiler == NULL) fatal("must use flag -XX:+UseGraal"); |
638 | 638 |
639 jlong start = os::javaTimeMillis(); | 639 jlong start = os::javaTimeMillis(); |
640 | 640 |
641 instanceKlass* klass = (instanceKlass*)SystemDictionary::Object_klass()->klass_part(); | 641 instanceKlass* klass = (instanceKlass*)SystemDictionary::Object_klass()->klass_part(); |
642 methodOop method = klass->find_method(vmSymbols::object_initializer_name(), vmSymbols::void_method_signature()); | 642 methodOop method = klass->find_method(vmSymbols::object_initializer_name(), vmSymbols::void_method_signature()); |
658 bool compiling = false; | 658 bool compiling = false; |
659 while (current != NULL) { | 659 while (current != NULL) { |
660 if (current->is_Compiler_thread()) { | 660 if (current->is_Compiler_thread()) { |
661 CompilerThread* comp_thread = current->as_CompilerThread(); | 661 CompilerThread* comp_thread = current->as_CompilerThread(); |
662 if (comp_thread->is_compiling()) { | 662 if (comp_thread->is_compiling()) { |
663 if (TraceC1X >= 4) { | 663 if (Tracegraal >= 4) { |
664 tty->print_cr("Compile queue empty, but following thread is still compiling:"); | 664 tty->print_cr("Compile queue empty, but following thread is still compiling:"); |
665 comp_thread->print(); | 665 comp_thread->print(); |
666 } | 666 } |
667 compiling = true; | 667 compiling = true; |
668 } | 668 } |
671 } | 671 } |
672 if (!compiling) { | 672 if (!compiling) { |
673 break; | 673 break; |
674 } | 674 } |
675 } | 675 } |
676 if (TraceC1X >= 5) { | 676 if (Tracegraal >= 5) { |
677 _c1_method_queue->print(); | 677 _c1_method_queue->print(); |
678 } | 678 } |
679 } | 679 } |
680 | 680 |
681 { | 681 { |
705 #ifndef SHARK | 705 #ifndef SHARK |
706 // Set the interface to the current compiler(s). | 706 // Set the interface to the current compiler(s). |
707 int c1_count = CompilationPolicy::policy()->compiler_count(CompLevel_simple); | 707 int c1_count = CompilationPolicy::policy()->compiler_count(CompLevel_simple); |
708 int c2_count = CompilationPolicy::policy()->compiler_count(CompLevel_full_optimization); | 708 int c2_count = CompilationPolicy::policy()->compiler_count(CompLevel_full_optimization); |
709 #ifdef COMPILER1 | 709 #ifdef COMPILER1 |
710 if (UseC1X) { | 710 if (UseGraal) { |
711 _compilers[0] = new C1XCompiler(); | 711 _compilers[0] = new GraalCompiler(); |
712 } else if (c1_count > 0) { | 712 } else if (c1_count > 0) { |
713 _compilers[0] = new Compiler(); | 713 _compilers[0] = new Compiler(); |
714 } | 714 } |
715 #ifndef COMPILER2 | 715 #ifndef COMPILER2 |
716 _compilers[1] = _compilers[0]; | 716 _compilers[1] = _compilers[0]; |
1062 { | 1062 { |
1063 MutexLocker locker(queue->lock(), THREAD); | 1063 MutexLocker locker(queue->lock(), THREAD); |
1064 | 1064 |
1065 if (Thread::current()->is_Compiler_thread() && CompilerThread::current()->is_compiling() && !BackgroundCompilation) { | 1065 if (Thread::current()->is_Compiler_thread() && CompilerThread::current()->is_compiling() && !BackgroundCompilation) { |
1066 | 1066 |
1067 TRACE_C1X_1("Recursive compile %s!", method->name_and_sig_as_C_string()); | 1067 TRACE_graal_1("Recursive compile %s!", method->name_and_sig_as_C_string()); |
1068 method->set_not_compilable(); | 1068 method->set_not_compilable(); |
1069 return; | 1069 return; |
1070 } | 1070 } |
1071 | 1071 |
1072 // Make sure the method has not slipped into the queues since | 1072 // Make sure the method has not slipped into the queues since |