comparison src/share/vm/compiler/compileBroker.cpp @ 2044:06f017f7daa7

Merge.
author Thomas Wuerthinger <wuerthinger@ssw.jku.at>
date Fri, 07 Jan 2011 18:18:08 +0100
parents b7fb5f1e0747 f95d63e2154a
children 9c96c873c42b
comparison
equal deleted inserted replaced
1942:00bc9eaf0e24 2044:06f017f7daa7
20 * or visit www.oracle.com if you need additional information or have any 20 * or visit www.oracle.com if you need additional information or have any
21 * questions. 21 * questions.
22 * 22 *
23 */ 23 */
24 24
25 #include "incls/_precompiled.incl" 25 #include "precompiled.hpp"
26 #include "incls/_compileBroker.cpp.incl" 26 #include "classfile/systemDictionary.hpp"
27 #include "classfile/vmSymbols.hpp"
28 #include "code/codeCache.hpp"
29 #include "compiler/compileBroker.hpp"
30 #include "compiler/compileLog.hpp"
31 #include "compiler/compilerOracle.hpp"
32 #include "interpreter/linkResolver.hpp"
33 #include "memory/allocation.inline.hpp"
34 #include "oops/methodDataOop.hpp"
35 #include "oops/methodOop.hpp"
36 #include "oops/oop.inline.hpp"
37 #include "prims/nativeLookup.hpp"
38 #include "runtime/arguments.hpp"
39 #include "runtime/compilationPolicy.hpp"
40 #include "runtime/init.hpp"
41 #include "runtime/interfaceSupport.hpp"
42 #include "runtime/javaCalls.hpp"
43 #include "runtime/os.hpp"
44 #include "runtime/sharedRuntime.hpp"
45 #include "runtime/sweeper.hpp"
46 #include "utilities/dtrace.hpp"
47 #ifdef COMPILER1
48 #include "c1/c1_Compiler.hpp"
49 #endif
50 #ifdef COMPILER2
51 #include "opto/c2compiler.hpp"
52 #endif
53 #ifdef SHARK
54 #include "shark/sharkCompiler.hpp"
55 #endif
27 56
28 #ifdef DTRACE_ENABLED 57 #ifdef DTRACE_ENABLED
29 58
30 // Only bother with this argument setup if dtrace is available 59 // Only bother with this argument setup if dtrace is available
31 60
591 // 620 //
592 // Initialize the Compilation object 621 // Initialize the Compilation object
593 void CompileBroker::compilation_init() { 622 void CompileBroker::compilation_init() {
594 _last_method_compiled[0] = '\0'; 623 _last_method_compiled[0] = '\0';
595 624
625 #ifndef SHARK
596 // Set the interface to the current compiler(s). 626 // Set the interface to the current compiler(s).
597 int c1_count = CompilationPolicy::policy()->compiler_count(CompLevel_simple); 627 int c1_count = CompilationPolicy::policy()->compiler_count(CompLevel_simple);
598 int c2_count = CompilationPolicy::policy()->compiler_count(CompLevel_full_optimization); 628 int c2_count = CompilationPolicy::policy()->compiler_count(CompLevel_full_optimization);
599 #ifdef COMPILER1 629 #ifdef COMPILER1
600 if (UseC1X) { 630 if (UseC1X) {
611 if (c2_count > 0) { 641 if (c2_count > 0) {
612 _compilers[1] = new C2Compiler(); 642 _compilers[1] = new C2Compiler();
613 } 643 }
614 #endif // COMPILER2 644 #endif // COMPILER2
615 645
616 #ifdef SHARK 646 #else // SHARK
617 #if defined(COMPILER1) || defined(COMPILER2) 647 int c1_count = 0;
618 #error "Can't use COMPILER1 or COMPILER2 with shark" 648 int c2_count = 1;
619 #endif 649
620 _compilers[0] = new SharkCompiler(); 650 _compilers[1] = new SharkCompiler();
621 _compilers[1] = _compilers[0]; 651 #endif // SHARK
622 #endif
623 652
624 // Initialize the CompileTask free list 653 // Initialize the CompileTask free list
625 _task_free_list = NULL; 654 _task_free_list = NULL;
626 655
627 // Start the CompilerThreads 656 // Start the CompilerThreads
1622 1651
1623 if (!ci_env.failing() && task->code() == NULL) { 1652 if (!ci_env.failing() && task->code() == NULL) {
1624 //assert(false, "compiler should always document failure"); 1653 //assert(false, "compiler should always document failure");
1625 // The compiler elected, without comment, not to register a result. 1654 // The compiler elected, without comment, not to register a result.
1626 // Do not attempt further compilations of this method. 1655 // Do not attempt further compilations of this method.
1627 ci_env.record_method_not_compilable("compile failed"); 1656 ci_env.record_method_not_compilable("compile failed", !TieredCompilation);
1628 } 1657 }
1629 1658
1630 if (ci_env.failing()) { 1659 if (ci_env.failing()) {
1631 // Copy this bit to the enclosing block: 1660 // Copy this bit to the enclosing block:
1632 compilable = ci_env.compilable(); 1661 compilable = ci_env.compilable();
1633 if (PrintCompilation) { 1662 if (PrintCompilation) {
1634 const char* reason = ci_env.failure_reason(); 1663 const char* reason = ci_env.failure_reason();
1635 if (compilable == ciEnv::MethodCompilable_not_at_tier) { 1664 if (compilable == ciEnv::MethodCompilable_not_at_tier) {
1636 if (is_highest_tier_compile(ci_env.comp_level())) {
1637 // Already at highest tier, promote to not compilable.
1638 compilable = ciEnv::MethodCompilable_never;
1639 } else {
1640 tty->print_cr("%3d COMPILE SKIPPED: %s (retry at different tier)", compile_id, reason); 1665 tty->print_cr("%3d COMPILE SKIPPED: %s (retry at different tier)", compile_id, reason);
1641 } 1666 } else if (compilable == ciEnv::MethodCompilable_never) {
1642 }
1643
1644 if (compilable == ciEnv::MethodCompilable_never) {
1645 tty->print_cr("%3d COMPILE SKIPPED: %s (not retryable)", compile_id, reason); 1667 tty->print_cr("%3d COMPILE SKIPPED: %s (not retryable)", compile_id, reason);
1646 } else if (compilable == ciEnv::MethodCompilable) { 1668 } else if (compilable == ciEnv::MethodCompilable) {
1647 tty->print_cr("%3d COMPILE SKIPPED: %s", compile_id, reason); 1669 tty->print_cr("%3d COMPILE SKIPPED: %s", compile_id, reason);
1648 } 1670 }
1649 } 1671 }