177 if (failure_message != NULL) {
178 const char* failure_reason = java_lang_String::as_utf8_string(failure_message);
179 env->set_failure(failure_reason, HotSpotCompilationRequestResult::retry(result_object) != 0);
180 } else {
181 if (env->task()->code() == NULL) {
182 env->set_failure("no nmethod produced", true);
183 } else {
184 env->task()->set_num_inlined_bytecodes(HotSpotCompilationRequestResult::inlinedBytecodes(result_object));
185 Atomic::inc(&_methods_compiled);
186 }
187 }
188 } else {
189 assert(false, "JVMCICompiler.compileMethod should always return non-null");
190 }
191 }
192 if (_bootstrapping) {
193 _bootstrap_compilation_request_handled = true;
194 }
195 }
196
197 CompLevel JVMCIRuntime::adjust_comp_level(methodHandle method, bool is_osr, CompLevel level, JavaThread* thread) {
198 if (!thread->adjusting_comp_level()) {
199 thread->set_adjusting_comp_level(true);
200 level = adjust_comp_level_inner(method, is_osr, level, thread);
201 thread->set_adjusting_comp_level(false);
202 }
203 return level;
204 }
205
206 void JVMCICompiler::exit_on_pending_exception(oop exception, const char* message) {
207 JavaThread* THREAD = JavaThread::current();
208 CLEAR_PENDING_EXCEPTION;
209
210 static volatile int report_error = 0;
211 if (!report_error && Atomic::cmpxchg(1, &report_error, 0) == 0) {
212 // Only report an error once
213 tty->print_raw_cr(message);
214 Handle ex(THREAD, exception);
215 java_lang_Throwable::java_printStackTrace(ex, THREAD);
216 } else {
217 // Allow error reporting thread to print the stack trace.
|
177 if (failure_message != NULL) {
178 const char* failure_reason = java_lang_String::as_utf8_string(failure_message);
179 env->set_failure(failure_reason, HotSpotCompilationRequestResult::retry(result_object) != 0);
180 } else {
181 if (env->task()->code() == NULL) {
182 env->set_failure("no nmethod produced", true);
183 } else {
184 env->task()->set_num_inlined_bytecodes(HotSpotCompilationRequestResult::inlinedBytecodes(result_object));
185 Atomic::inc(&_methods_compiled);
186 }
187 }
188 } else {
189 assert(false, "JVMCICompiler.compileMethod should always return non-null");
190 }
191 }
192 if (_bootstrapping) {
193 _bootstrap_compilation_request_handled = true;
194 }
195 }
196
197 CompLevel JVMCIRuntime::adjust_comp_level(const methodHandle& method, bool is_osr, CompLevel level, JavaThread* thread) {
198 if (!thread->adjusting_comp_level()) {
199 thread->set_adjusting_comp_level(true);
200 level = adjust_comp_level_inner(method, is_osr, level, thread);
201 thread->set_adjusting_comp_level(false);
202 }
203 return level;
204 }
205
206 void JVMCICompiler::exit_on_pending_exception(oop exception, const char* message) {
207 JavaThread* THREAD = JavaThread::current();
208 CLEAR_PENDING_EXCEPTION;
209
210 static volatile int report_error = 0;
211 if (!report_error && Atomic::cmpxchg(1, &report_error, 0) == 0) {
212 // Only report an error once
213 tty->print_raw_cr(message);
214 Handle ex(THREAD, exception);
215 java_lang_Throwable::java_printStackTrace(ex, THREAD);
216 } else {
217 // Allow error reporting thread to print the stack trace.
|