--- a/src/hotspot/share/runtime/interfaceSupport.inline.hpp Wed Jul 31 06:37:13 2019 -0400
+++ b/src/hotspot/share/runtime/interfaceSupport.inline.hpp Wed Jul 31 06:54:50 2019 -0400
@@ -327,7 +327,7 @@
}
};
-// Debug class instantiated in JRT_ENTRY and ITR_ENTRY macro.
+// Debug class instantiated in JRT_ENTRY macro.
// Can be used to verify properties on enter/exit of the VM.
#ifdef ASSERT
@@ -340,45 +340,17 @@
class VMNativeEntryWrapper {
public:
- VMNativeEntryWrapper() {
- if (GCALotAtAllSafepoints) InterfaceSupport::check_gc_alot();
- }
-
- ~VMNativeEntryWrapper() {
- if (GCALotAtAllSafepoints) InterfaceSupport::check_gc_alot();
- }
+ VMNativeEntryWrapper();
+ ~VMNativeEntryWrapper();
};
-#endif
-
-
-// VM-internal runtime interface support
-
-// Definitions for JRT (Java (Compiler/Shared) Runtime)
-
-// JRT_LEAF currently can be called from either _thread_in_Java or
-// _thread_in_native mode. In _thread_in_native, it is ok
-// for another thread to trigger GC. The rest of the JRT_LEAF
-// rules apply.
-class JRTLeafVerifier : public NoSafepointVerifier {
- static bool should_verify_GC();
- public:
-#ifdef ASSERT
- JRTLeafVerifier();
- ~JRTLeafVerifier();
-#else
- JRTLeafVerifier() {}
- ~JRTLeafVerifier() {}
-#endif
-};
-
-#ifdef ASSERT
-
class RuntimeHistogramElement : public HistogramElement {
public:
RuntimeHistogramElement(const char* name);
};
+#endif // ASSERT
+#ifdef ASSERT
#define TRACE_CALL(result_type, header) \
InterfaceSupport::_number_of_calls++; \
if (CountRuntimeCalls) { \
@@ -388,7 +360,7 @@
#else
#define TRACE_CALL(result_type, header) \
/* do nothing */
-#endif
+#endif // ASSERT
// LEAF routines do not lock, GC or throw exceptions
@@ -434,11 +406,24 @@
VM_ENTRY_BASE(result_type, header, thread) \
debug_only(VMEntryWrapper __vew;)
+// JRT_LEAF currently can be called from either _thread_in_Java or
+// _thread_in_native mode.
+//
+// JRT_LEAF rules:
+// A JRT_LEAF method may not interfere with safepointing by
+// 1) acquiring or blocking on a Mutex or JavaLock - checked
+// 2) allocating heap memory - checked
+// 3) executing a VM operation - checked
+// 4) executing a system call (including malloc) that could block or grab a lock
+// 5) invoking GC
+// 6) reaching a safepoint
+// 7) running too long
+// Nor may any method it calls.
#define JRT_LEAF(result_type, header) \
result_type header { \
VM_LEAF_BASE(result_type, header) \
- debug_only(JRTLeafVerifier __jlv;)
+ debug_only(NoSafepointVerifier __nsv;)
#define JRT_ENTRY_NO_ASYNC(result_type, header) \