76 void C2Compiler::initialize() {
77 assert(!is_c1_or_interpreter_only(), "C2 compiler is launched, it's not c1/interpreter only mode");
78 // The first compiler thread that gets here will initialize the
79 // small amount of global state (and runtime stubs) that C2 needs.
80
81 // There is a race possible once at startup and then we're fine
82
83 // Note that this is being called from a compiler thread not the
84 // main startup thread.
85 if (should_perform_init()) {
86 bool successful = C2Compiler::init_c2_runtime();
87 int new_state = (successful) ? initialized : failed;
88 set_state(new_state);
89 }
90 }
91
92 void C2Compiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci, bool install_code, DirectiveSet* directive) {
93 assert(is_initialized(), "Compiler thread must be initialized");
94
95 bool subsume_loads = SubsumeLoads;
96 bool do_escape_analysis = DoEscapeAnalysis && !env->should_retain_local_variables()
97 && !env->jvmti_can_get_owned_monitor_info();
98 bool eliminate_boxing = EliminateAutoBox;
99
100 while (!env->failing()) {
101 // Attempt to compile while subsuming loads into machine instructions.
102 Compile C(env, target, entry_bci, subsume_loads, do_escape_analysis, eliminate_boxing, install_code, directive);
103
104 // Check result and retry if appropriate.
105 if (C.failure_reason() != NULL) {
106 if (C.failure_reason_is(retry_class_loading_during_parsing())) {
107 env->report_failure(C.failure_reason());
108 continue; // retry
109 }
110 if (C.failure_reason_is(retry_no_subsuming_loads())) {
111 assert(subsume_loads, "must make progress");
112 subsume_loads = false;
113 env->report_failure(C.failure_reason());
114 continue; // retry
115 }
116 if (C.failure_reason_is(retry_no_escape_analysis())) {
117 assert(do_escape_analysis, "must make progress");
|
76 void C2Compiler::initialize() {
77 assert(!is_c1_or_interpreter_only(), "C2 compiler is launched, it's not c1/interpreter only mode");
78 // The first compiler thread that gets here will initialize the
79 // small amount of global state (and runtime stubs) that C2 needs.
80
81 // There is a race possible once at startup and then we're fine
82
83 // Note that this is being called from a compiler thread not the
84 // main startup thread.
85 if (should_perform_init()) {
86 bool successful = C2Compiler::init_c2_runtime();
87 int new_state = (successful) ? initialized : failed;
88 set_state(new_state);
89 }
90 }
91
92 void C2Compiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci, bool install_code, DirectiveSet* directive) {
93 assert(is_initialized(), "Compiler thread must be initialized");
94
95 bool subsume_loads = SubsumeLoads;
96 bool do_escape_analysis = DoEscapeAnalysis;
97 bool eliminate_boxing = EliminateAutoBox;
98
99 while (!env->failing()) {
100 // Attempt to compile while subsuming loads into machine instructions.
101 Compile C(env, target, entry_bci, subsume_loads, do_escape_analysis, eliminate_boxing, install_code, directive);
102
103 // Check result and retry if appropriate.
104 if (C.failure_reason() != NULL) {
105 if (C.failure_reason_is(retry_class_loading_during_parsing())) {
106 env->report_failure(C.failure_reason());
107 continue; // retry
108 }
109 if (C.failure_reason_is(retry_no_subsuming_loads())) {
110 assert(subsume_loads, "must make progress");
111 subsume_loads = false;
112 env->report_failure(C.failure_reason());
113 continue; // retry
114 }
115 if (C.failure_reason_is(retry_no_escape_analysis())) {
116 assert(do_escape_analysis, "must make progress");
|