src/hotspot/share/jvmci/jvmciRuntime.cpp
changeset 47785 5692c538ecef
parent 47765 b7c7428eaab9
child 47796 47629b00daa9
equal deleted inserted replaced
47784:1360c7949d2f 47785:5692c538ecef
   823 CompLevel JVMCIRuntime::adjust_comp_level_inner(const methodHandle& method, bool is_osr, CompLevel level, JavaThread* thread) {
   823 CompLevel JVMCIRuntime::adjust_comp_level_inner(const methodHandle& method, bool is_osr, CompLevel level, JavaThread* thread) {
   824   JVMCICompiler* compiler = JVMCICompiler::instance(thread);
   824   JVMCICompiler* compiler = JVMCICompiler::instance(thread);
   825   if (compiler != NULL && compiler->is_bootstrapping()) {
   825   if (compiler != NULL && compiler->is_bootstrapping()) {
   826     return level;
   826     return level;
   827   }
   827   }
   828   if (!is_HotSpotJVMCIRuntime_initialized() || !_comp_level_adjustment) {
   828   if (!is_HotSpotJVMCIRuntime_initialized() || _comp_level_adjustment == JVMCIRuntime::none) {
   829     // JVMCI cannot participate in compilation scheduling until
   829     // JVMCI cannot participate in compilation scheduling until
   830     // JVMCI is initialized and indicates it wants to participate.
   830     // JVMCI is initialized and indicates it wants to participate.
   831     return level;
   831     return level;
   832   }
   832   }
   833 
   833 
   834 #define CHECK_RETURN THREAD); \
   834 #define CHECK_RETURN THREAD); \
   835 if (HAS_PENDING_EXCEPTION) { \
       
   836   Handle exception(THREAD, PENDING_EXCEPTION); \
       
   837   CLEAR_PENDING_EXCEPTION; \
       
   838 \
       
   839   java_lang_Throwable::java_printStackTrace(exception, THREAD); \
       
   840   if (HAS_PENDING_EXCEPTION) { \
   835   if (HAS_PENDING_EXCEPTION) { \
       
   836     Handle exception(THREAD, PENDING_EXCEPTION); \
   841     CLEAR_PENDING_EXCEPTION; \
   837     CLEAR_PENDING_EXCEPTION; \
       
   838   \
       
   839     if (exception->is_a(SystemDictionary::ThreadDeath_klass())) { \
       
   840       /* In the special case of ThreadDeath, we need to reset the */ \
       
   841       /* pending async exception so that it is propagated.        */ \
       
   842       thread->set_pending_async_exception(exception()); \
       
   843       return level; \
       
   844     } \
       
   845     tty->print("Uncaught exception while adjusting compilation level: "); \
       
   846     java_lang_Throwable::print(exception(), tty); \
       
   847     tty->cr(); \
       
   848     java_lang_Throwable::print_stack_trace(exception, tty); \
       
   849     if (HAS_PENDING_EXCEPTION) { \
       
   850       CLEAR_PENDING_EXCEPTION; \
       
   851     } \
       
   852     return level; \
   842   } \
   853   } \
   843   return level; \
   854   (void)(0
   844 } \
       
   845 (void)(0
       
   846 
   855 
   847 
   856 
   848   Thread* THREAD = thread;
   857   Thread* THREAD = thread;
   849   HandleMark hm;
   858   HandleMark hm;
   850   Handle receiver = JVMCIRuntime::get_HotSpotJVMCIRuntime(CHECK_RETURN);
   859   Handle receiver = JVMCIRuntime::get_HotSpotJVMCIRuntime(CHECK_RETURN);