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