hotspot/src/share/vm/jvmci/jvmciRuntime.cpp
changeset 35143 33daaea9d5c2
parent 35135 dd2ce9021031
child 35160 acae4975b367
equal deleted inserted replaced
35142:11e71310edae 35143:33daaea9d5c2
   933     }
   933     }
   934     assert (insert_pos - _options == count, "must be");
   934     assert (insert_pos - _options == count, "must be");
   935   }
   935   }
   936 }
   936 }
   937 
   937 
   938 void JVMCIRuntime::shutdown() {
   938 void JVMCIRuntime::shutdown(TRAPS) {
   939   if (_HotSpotJVMCIRuntime_instance != NULL) {
   939   if (_HotSpotJVMCIRuntime_instance != NULL) {
   940     _shutdown_called = true;
   940     _shutdown_called = true;
   941     JavaThread* THREAD = JavaThread::current();
       
   942     HandleMark hm(THREAD);
   941     HandleMark hm(THREAD);
   943     Handle receiver = get_HotSpotJVMCIRuntime(CHECK_ABORT);
   942     Handle receiver = get_HotSpotJVMCIRuntime(CHECK);
   944     JavaValue result(T_VOID);
   943     JavaValue result(T_VOID);
   945     JavaCallArguments args;
   944     JavaCallArguments args;
   946     args.push_oop(receiver);
   945     args.push_oop(receiver);
   947     JavaCalls::call_special(&result, receiver->klass(), vmSymbols::shutdown_method_name(), vmSymbols::void_method_signature(), &args, CHECK_ABORT);
   946     JavaCalls::call_special(&result, receiver->klass(), vmSymbols::shutdown_method_name(), vmSymbols::void_method_signature(), &args, CHECK);
   948   }
   947   }
   949 }
   948 }
   950 
   949 
   951 bool JVMCIRuntime::treat_as_trivial(Method* method) {
   950 bool JVMCIRuntime::treat_as_trivial(Method* method) {
   952   if (_HotSpotJVMCIRuntime_initialized) {
   951   if (_HotSpotJVMCIRuntime_initialized) {
   958         }
   957         }
   959       }
   958       }
   960     }
   959     }
   961   }
   960   }
   962   return false;
   961   return false;
   963 }
       
   964 
       
   965 void JVMCIRuntime::call_printStackTrace(Handle exception, Thread* thread) {
       
   966   assert(exception->is_a(SystemDictionary::Throwable_klass()), "Throwable instance expected");
       
   967   JavaValue result(T_VOID);
       
   968   JavaCalls::call_virtual(&result,
       
   969                           exception,
       
   970                           KlassHandle(thread,
       
   971                           SystemDictionary::Throwable_klass()),
       
   972                           vmSymbols::printStackTrace_name(),
       
   973                           vmSymbols::void_method_signature(),
       
   974                           thread);
       
   975 }
       
   976 
       
   977 void JVMCIRuntime::abort_on_pending_exception(Handle exception, const char* message, bool dump_core) {
       
   978   Thread* THREAD = Thread::current();
       
   979   CLEAR_PENDING_EXCEPTION;
       
   980   tty->print_raw_cr(message);
       
   981   call_printStackTrace(exception, THREAD);
       
   982 
       
   983   // Give other aborting threads to also print their stack traces.
       
   984   // This can be very useful when debugging class initialization
       
   985   // failures.
       
   986   os::sleep(THREAD, 200, false);
       
   987 
       
   988   vm_abort(dump_core);
       
   989 }
   962 }
   990 
   963 
   991 void JVMCIRuntime::parse_lines(char* path, ParseClosure* closure, bool warnStatFailure) {
   964 void JVMCIRuntime::parse_lines(char* path, ParseClosure* closure, bool warnStatFailure) {
   992   struct stat st;
   965   struct stat st;
   993   if (::stat(path, &st) == 0 && (st.st_mode & S_IFREG) == S_IFREG) { // exists & is regular file
   966   if (::stat(path, &st) == 0 && (st.st_mode & S_IFREG) == S_IFREG) { // exists & is regular file