8252966: CI: Remove KILL_COMPILE_ON_FATAL_ and KILL_COMPILE_ON_ANY macros

Remove the KILL_COMPILE_ON_FATAL_ and KILL_COMPILE_ON_ANY macros, replacing uses
of KILL_COMPILE_ON_FATAL_ with CHECK_AND_CLEAR_. Unlike KILL_COMPILE_ON_FATAL_,
CHECK_AND_CLEAR_ ignores ThreadDeath exceptions, which compiler threads should
not receive anyway.

Reviewed-by: vlivanov, neliasso
diff --git a/src/hotspot/share/ci/ciEnv.cpp b/src/hotspot/share/ci/ciEnv.cpp
index bd178fd..9eeeea2 100644
--- a/src/hotspot/share/ci/ciEnv.cpp
+++ b/src/hotspot/share/ci/ciEnv.cpp
@@ -453,10 +453,10 @@
     Klass* kls;
     if (!require_local) {
       kls = SystemDictionary::find_constrained_instance_or_array_klass(sym, loader,
-                                                                       KILL_COMPILE_ON_FATAL_(fail_type));
+                                                                       CHECK_AND_CLEAR_(fail_type));
     } else {
       kls = SystemDictionary::find_instance_or_array_klass(sym, loader, domain,
-                                                           KILL_COMPILE_ON_FATAL_(fail_type));
+                                                           CHECK_AND_CLEAR_(fail_type));
     }
     found_klass = kls;
   }
diff --git a/src/hotspot/share/ci/ciField.cpp b/src/hotspot/share/ci/ciField.cpp
index 23ba2f1..df4dfc9 100644
--- a/src/hotspot/share/ci/ciField.cpp
+++ b/src/hotspot/share/ci/ciField.cpp
@@ -400,7 +400,7 @@
                      _name->get_symbol(), _signature->get_symbol(),
                      methodHandle(THREAD, accessing_method->get_Method()));
   fieldDescriptor result;
-  LinkResolver::resolve_field(result, link_info, bc, false, KILL_COMPILE_ON_FATAL_(false));
+  LinkResolver::resolve_field(result, link_info, bc, false, CHECK_AND_CLEAR_(false));
 
   // update the hit-cache, unless there is a problem with memory scoping:
   if (accessing_method->holder()->is_shared() || !is_shared()) {
diff --git a/src/hotspot/share/ci/ciUtilities.inline.hpp b/src/hotspot/share/ci/ciUtilities.inline.hpp
index 5c62931..8b752cd 100644
--- a/src/hotspot/share/ci/ciUtilities.inline.hpp
+++ b/src/hotspot/share/ci/ciUtilities.inline.hpp
@@ -66,27 +66,4 @@
 #define GUARDED_VM_QUICK_ENTRY(action)      \
   {if (IS_IN_VM) { action } else { VM_QUICK_ENTRY_MARK; { action }}}
 
-// Redefine this later.
-#define KILL_COMPILE_ON_FATAL_(result)           \
-  THREAD);                                       \
-  if (HAS_PENDING_EXCEPTION) {                   \
-    if (PENDING_EXCEPTION->klass() ==            \
-        SystemDictionary::ThreadDeath_klass()) { \
-      /* Kill the compilation. */                \
-      fatal("unhandled ci exception");           \
-      return (result);                           \
-    }                                            \
-    CLEAR_PENDING_EXCEPTION;                     \
-    return (result);                             \
-  }                                              \
-  (void)(0
-
-#define KILL_COMPILE_ON_ANY                      \
-  THREAD);                                       \
-  if (HAS_PENDING_EXCEPTION) {                   \
-    fatal("unhandled ci exception");             \
-    CLEAR_PENDING_EXCEPTION;                     \
-  }                                              \
-(void)(0
-
 #endif // SHARE_CI_CIUTILITIES_INLINE_HPP