src/hotspot/share/jvmci/jvmciRuntime.cpp
changeset 55206 2fe2063fe567
parent 54973 0927d8c7296f
child 55273 64b76867851b
equal deleted inserted replaced
55205:ef23ea332077 55206:2fe2063fe567
   936     int exception_line = THREAD->exception_line();
   936     int exception_line = THREAD->exception_line();
   937     CLEAR_PENDING_EXCEPTION;
   937     CLEAR_PENDING_EXCEPTION;
   938     if (exception->is_a(SystemDictionary::ThreadDeath_klass())) {
   938     if (exception->is_a(SystemDictionary::ThreadDeath_klass())) {
   939       // Don't print anything if we are being killed.
   939       // Don't print anything if we are being killed.
   940     } else {
   940     } else {
   941       java_lang_Throwable::print(exception(), tty);
       
   942       tty->cr();
       
   943       java_lang_Throwable::print_stack_trace(exception, tty);
   941       java_lang_Throwable::print_stack_trace(exception, tty);
   944 
   942 
   945       // Clear and ignore any exceptions raised during printing
   943       // Clear and ignore any exceptions raised during printing
   946       CLEAR_PENDING_EXCEPTION;
   944       CLEAR_PENDING_EXCEPTION;
   947     }
   945     }
  1395       }
  1393       }
  1396     } else {
  1394     } else {
  1397       assert(false, "JVMCICompiler.compileMethod should always return non-null");
  1395       assert(false, "JVMCICompiler.compileMethod should always return non-null");
  1398     }
  1396     }
  1399   } else {
  1397   } else {
  1400     // An uncaught exception was thrown during compilation. Generally these
  1398     // An uncaught exception here implies failure during compiler initialization.
  1401     // should be handled by the Java code in some useful way but if they leak
  1399     // The only sensible thing to do here is to exit the VM.
  1402     // through to here report them instead of dying or silently ignoring them.
  1400 
  1403     JVMCIENV->describe_pending_exception(true);
  1401     // Only report initialization failure once
  1404     compile_state->set_failure(false, "unexpected exception thrown");
  1402     static volatile int report_init_failure = 0;
       
  1403     if (!report_init_failure && Atomic::cmpxchg(1, &report_init_failure, 0) == 0) {
       
  1404         tty->print_cr("Exception during JVMCI compiler initialization:");
       
  1405         JVMCIENV->describe_pending_exception(true);
       
  1406     }
       
  1407     JVMCIENV->clear_pending_exception();
       
  1408     before_exit((JavaThread*) THREAD);
       
  1409     vm_exit(-1);
  1405   }
  1410   }
  1406   if (compiler->is_bootstrapping()) {
  1411   if (compiler->is_bootstrapping()) {
  1407     compiler->set_bootstrap_compilation_request_handled();
  1412     compiler->set_bootstrap_compilation_request_handled();
  1408   }
  1413   }
  1409 }
  1414 }