< prev index next >

src/hotspot/share/utilities/exceptions.hpp

Print this page
rev 50234 : 8204477: Count linkage errors and print in Exceptions::print_exception_counts_on_error


  91   void clear_pending_exception();
  92 
  93   ThreadShadow() : _pending_exception(NULL),
  94                    _exception_file(NULL), _exception_line(0) {}
  95 };
  96 
  97 
  98 // Exceptions is a helper class that encapsulates all operations
  99 // that require access to the thread interface and which are
 100 // relatively rare. The Exceptions operations should only be
 101 // used directly if the macros below are insufficient.
 102 
 103 class Exceptions {
 104   static bool special_exception(Thread *thread, const char* file, int line, Handle exception);
 105   static bool special_exception(Thread* thread, const char* file, int line, Symbol* name, const char* message);
 106 
 107   // Count out of memory errors that are interesting in error diagnosis
 108   static volatile int _out_of_memory_error_java_heap_errors;
 109   static volatile int _out_of_memory_error_metaspace_errors;
 110   static volatile int _out_of_memory_error_class_metaspace_errors;



 111  public:
 112   // this enum is defined to indicate whether it is safe to
 113   // ignore the encoding scheme of the original message string.
 114   typedef enum {
 115     safe_to_utf8 = 0,
 116     unsafe_to_utf8 = 1
 117   } ExceptionMsgToUtf8Mode;
 118   // Throw exceptions: w/o message, w/ message & with formatted message.
 119   static void _throw_oop(Thread* thread, const char* file, int line, oop exception);
 120   static void _throw(Thread* thread, const char* file, int line, Handle exception, const char* msg = NULL);
 121 
 122   static void _throw_msg(Thread* thread, const char* file, int line, Symbol* name, const char* message);
 123   static void _throw_msg(Thread* thread, const char* file, int line, Symbol* name, const char* message,
 124                          Handle loader, Handle protection_domain);
 125 
 126   static void _throw_msg_cause(Thread* thread, const char* file, int line, Symbol* name, const char* message, Handle h_cause);
 127   static void _throw_msg_cause(Thread* thread, const char* file, int line, Symbol* name, const char* message, Handle h_cause,
 128                                Handle h_loader, Handle h_protection_domain);
 129 
 130   static void _throw_cause(Thread* thread, const char* file, int line, Symbol* name, Handle h_cause);




  91   void clear_pending_exception();
  92 
  93   ThreadShadow() : _pending_exception(NULL),
  94                    _exception_file(NULL), _exception_line(0) {}
  95 };
  96 
  97 
  98 // Exceptions is a helper class that encapsulates all operations
  99 // that require access to the thread interface and which are
 100 // relatively rare. The Exceptions operations should only be
 101 // used directly if the macros below are insufficient.
 102 
 103 class Exceptions {
 104   static bool special_exception(Thread *thread, const char* file, int line, Handle exception);
 105   static bool special_exception(Thread* thread, const char* file, int line, Symbol* name, const char* message);
 106 
 107   // Count out of memory errors that are interesting in error diagnosis
 108   static volatile int _out_of_memory_error_java_heap_errors;
 109   static volatile int _out_of_memory_error_metaspace_errors;
 110   static volatile int _out_of_memory_error_class_metaspace_errors;
 111 
 112   // Count linkage errors
 113   static volatile int _linkage_errors;
 114  public:
 115   // this enum is defined to indicate whether it is safe to
 116   // ignore the encoding scheme of the original message string.
 117   typedef enum {
 118     safe_to_utf8 = 0,
 119     unsafe_to_utf8 = 1
 120   } ExceptionMsgToUtf8Mode;
 121   // Throw exceptions: w/o message, w/ message & with formatted message.
 122   static void _throw_oop(Thread* thread, const char* file, int line, oop exception);
 123   static void _throw(Thread* thread, const char* file, int line, Handle exception, const char* msg = NULL);
 124 
 125   static void _throw_msg(Thread* thread, const char* file, int line, Symbol* name, const char* message);
 126   static void _throw_msg(Thread* thread, const char* file, int line, Symbol* name, const char* message,
 127                          Handle loader, Handle protection_domain);
 128 
 129   static void _throw_msg_cause(Thread* thread, const char* file, int line, Symbol* name, const char* message, Handle h_cause);
 130   static void _throw_msg_cause(Thread* thread, const char* file, int line, Symbol* name, const char* message, Handle h_cause,
 131                                Handle h_loader, Handle h_protection_domain);
 132 
 133   static void _throw_cause(Thread* thread, const char* file, int line, Symbol* name, Handle h_cause);


< prev index next >