< prev index next >

src/share/vm/jvmci/jvmciCompiler.cpp

Print this page




 172     oop result_object = (oop) result.get_jobject();
 173     if (result_object != NULL) {
 174       oop failure_message = CompilationRequestResult::failureMessage(result_object);
 175       if (failure_message != NULL) {
 176         const char* failure_reason = java_lang_String::as_utf8_string(failure_message);
 177         env->set_failure(failure_reason, CompilationRequestResult::retry(result_object) != 0);
 178       } else {
 179         if (env->task()->code() == NULL) {
 180           env->set_failure("no nmethod produced", true);
 181         } else {
 182           env->task()->set_num_inlined_bytecodes(CompilationRequestResult::inlinedBytecodes(result_object));
 183           Atomic::inc(&_methods_compiled);
 184         }
 185       }
 186     } else {
 187       assert(false, "JVMCICompiler.compileMethod should always return non-null");
 188     }
 189   }
 190 }
 191 









 192 /**
 193  * Aborts the VM due to an unexpected exception.
 194  */
 195 void JVMCICompiler::abort_on_pending_exception(Handle exception, const char* message, bool dump_core) {
 196   Thread* THREAD = Thread::current();
 197   CLEAR_PENDING_EXCEPTION;
 198 
 199   java_lang_Throwable::java_printStackTrace(exception, THREAD);
 200 
 201   // Give other aborting threads to also print their stack traces.
 202   // This can be very useful when debugging class initialization
 203   // failures.
 204   assert(THREAD->is_Java_thread(), "compiler threads should be Java threads");
 205   const bool interruptible = true;
 206   os::sleep(THREAD, 200, interruptible);
 207 
 208   vm_abort(dump_core);
 209 }
 210 
 211 // Compilation entry point for methods




 172     oop result_object = (oop) result.get_jobject();
 173     if (result_object != NULL) {
 174       oop failure_message = CompilationRequestResult::failureMessage(result_object);
 175       if (failure_message != NULL) {
 176         const char* failure_reason = java_lang_String::as_utf8_string(failure_message);
 177         env->set_failure(failure_reason, CompilationRequestResult::retry(result_object) != 0);
 178       } else {
 179         if (env->task()->code() == NULL) {
 180           env->set_failure("no nmethod produced", true);
 181         } else {
 182           env->task()->set_num_inlined_bytecodes(CompilationRequestResult::inlinedBytecodes(result_object));
 183           Atomic::inc(&_methods_compiled);
 184         }
 185       }
 186     } else {
 187       assert(false, "JVMCICompiler.compileMethod should always return non-null");
 188     }
 189   }
 190 }
 191 
 192 CompLevel JVMCIRuntime::adjust_comp_level(methodHandle method, bool is_osr, CompLevel level, JavaThread* thread) {
 193   if (!thread->adjusting_comp_level()) {
 194     thread->set_adjusting_comp_level(true);
 195     level = adjust_comp_level_inner(method, is_osr, level, thread);
 196     thread->set_adjusting_comp_level(false);
 197   }
 198   return level;
 199 }
 200 
 201 /**
 202  * Aborts the VM due to an unexpected exception.
 203  */
 204 void JVMCICompiler::abort_on_pending_exception(Handle exception, const char* message, bool dump_core) {
 205   Thread* THREAD = Thread::current();
 206   CLEAR_PENDING_EXCEPTION;
 207 
 208   java_lang_Throwable::java_printStackTrace(exception, THREAD);
 209 
 210   // Give other aborting threads to also print their stack traces.
 211   // This can be very useful when debugging class initialization
 212   // failures.
 213   assert(THREAD->is_Java_thread(), "compiler threads should be Java threads");
 214   const bool interruptible = true;
 215   os::sleep(THREAD, 200, interruptible);
 216 
 217   vm_abort(dump_core);
 218 }
 219 
 220 // Compilation entry point for methods


< prev index next >