108 // Note that this is being called from a compiler thread not the
109 // main startup thread.
110
111 if (_runtimes != initialized) {
112 initialize_runtimes( initialize_runtime, &_runtimes);
113 }
114
115 // Mark this compiler object as ready to roll
116 mark_initialized();
117 }
118
119 void C2Compiler::compile_method(ciEnv* env,
120 ciMethod* target,
121 int entry_bci) {
122 if (!is_initialized()) {
123 initialize();
124 }
125 bool subsume_loads = SubsumeLoads;
126 bool do_escape_analysis = DoEscapeAnalysis &&
127 !env->jvmti_can_access_local_variables();
128 while (!env->failing()) {
129 // Attempt to compile while subsuming loads into machine instructions.
130 Compile C(env, this, target, entry_bci, subsume_loads, do_escape_analysis);
131
132
133 // Check result and retry if appropriate.
134 if (C.failure_reason() != NULL) {
135 if (C.failure_reason_is(retry_no_subsuming_loads())) {
136 assert(subsume_loads, "must make progress");
137 subsume_loads = false;
138 continue; // retry
139 }
140 if (C.failure_reason_is(retry_no_escape_analysis())) {
141 assert(do_escape_analysis, "must make progress");
142 do_escape_analysis = false;
143 continue; // retry
144 }
145 // Pass any other failure reason up to the ciEnv.
146 // Note that serious, irreversible failures are already logged
147 // on the ciEnv via env->record_method_not_compilable().
148 env->record_failure(C.failure_reason());
149 }
150 if (StressRecompilation) {
151 if (subsume_loads) {
152 subsume_loads = false;
153 continue; // retry
154 }
155 if (do_escape_analysis) {
156 do_escape_analysis = false;
157 continue; // retry
158 }
159 }
160
161 // No retry; just break the loop.
162 break;
163 }
164 }
|
108 // Note that this is being called from a compiler thread not the
109 // main startup thread.
110
111 if (_runtimes != initialized) {
112 initialize_runtimes( initialize_runtime, &_runtimes);
113 }
114
115 // Mark this compiler object as ready to roll
116 mark_initialized();
117 }
118
119 void C2Compiler::compile_method(ciEnv* env,
120 ciMethod* target,
121 int entry_bci) {
122 if (!is_initialized()) {
123 initialize();
124 }
125 bool subsume_loads = SubsumeLoads;
126 bool do_escape_analysis = DoEscapeAnalysis &&
127 !env->jvmti_can_access_local_variables();
128 bool eliminate_boxing = EliminateAutoBox;
129 while (!env->failing()) {
130 // Attempt to compile while subsuming loads into machine instructions.
131 Compile C(env, this, target, entry_bci, subsume_loads, do_escape_analysis, eliminate_boxing);
132
133
134 // Check result and retry if appropriate.
135 if (C.failure_reason() != NULL) {
136 if (C.failure_reason_is(retry_no_subsuming_loads())) {
137 assert(subsume_loads, "must make progress");
138 subsume_loads = false;
139 continue; // retry
140 }
141 if (C.failure_reason_is(retry_no_escape_analysis())) {
142 assert(do_escape_analysis, "must make progress");
143 do_escape_analysis = false;
144 continue; // retry
145 }
146 if (C.has_boxed_value()) {
147 // Recompile without boxing elimination regardless failure reason.
148 assert(eliminate_boxing, "must make progress");
149 eliminate_boxing = false;
150 continue; // retry
151 }
152 // Pass any other failure reason up to the ciEnv.
153 // Note that serious, irreversible failures are already logged
154 // on the ciEnv via env->record_method_not_compilable().
155 env->record_failure(C.failure_reason());
156 }
157 if (StressRecompilation) {
158 if (subsume_loads) {
159 subsume_loads = false;
160 continue; // retry
161 }
162 if (do_escape_analysis) {
163 do_escape_analysis = false;
164 continue; // retry
165 }
166 }
167
168 // No retry; just break the loop.
169 break;
170 }
171 }
|