--- a/hotspot/src/share/vm/utilities/exceptions.hpp Thu Jan 26 16:49:22 2012 +0100
+++ b/hotspot/src/share/vm/utilities/exceptions.hpp Thu Jan 26 12:15:24 2012 -0800
@@ -189,6 +189,13 @@
#define CHECK_NULL CHECK_(NULL)
#define CHECK_false CHECK_(false)
+#define CHECK_AND_CLEAR THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; return; } (0
+#define CHECK_AND_CLEAR_(result) THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; return result; } (0
+#define CHECK_AND_CLEAR_0 CHECK_AND_CLEAR_(0)
+#define CHECK_AND_CLEAR_NH CHECK_AND_CLEAR_(Handle())
+#define CHECK_AND_CLEAR_NULL CHECK_AND_CLEAR_(NULL)
+#define CHECK_AND_CLEAR_false CHECK_AND_CLEAR_(false)
+
// The THROW... macros should be used to throw an exception. They require a THREAD variable to be
// visible within the scope containing the THROW. Usually this is achieved by declaring the function
// with a TRAPS argument.
@@ -258,7 +265,6 @@
ShouldNotReachHere(); \
} (0
-
// ExceptionMark is a stack-allocated helper class for local exception handling.
// It is used with the EXCEPTION_MARK macro.