< prev index next >

src/hotspot/share/runtime/interfaceSupport.inline.hpp

Print this page

        

@@ -325,11 +325,11 @@
     if (_thread->has_special_runtime_exit_condition())
       _thread->handle_special_runtime_exit_condition(false);
   }
 };
 
-// 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
 class VMEntryWrapper {
  public:

@@ -338,59 +338,31 @@
 };
 
 
 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) {                                         \
     static RuntimeHistogramElement* e = new RuntimeHistogramElement(#header); \
     if (e != NULL) e->increment_count();                           \
   }
 #else
 #define TRACE_CALL(result_type, header)                            \
   /* do nothing */
-#endif
+#endif // ASSERT
 
 
 // LEAF routines do not lock, GC or throw exceptions
 
 #define VM_LEAF_BASE(result_type, header)                            \

@@ -432,15 +404,28 @@
   result_type header {                                               \
     ThreadInVMfromJava __tiv(thread);                                \
     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)                      \
   result_type header {                                               \
     ThreadInVMfromJavaNoAsyncException __tiv(thread);                \
< prev index next >