changeset 18658:304b65422434

improved javadoc
author Doug Simon <doug.simon@oracle.com>
date Thu, 11 Dec 2014 10:18:38 +0100
parents 74f612049e4e
children 81a26fb13a9e
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java	Wed Dec 10 09:45:20 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java	Thu Dec 11 10:18:38 2014 +0100
@@ -82,7 +82,14 @@
 
     private static Predicate<Void> runtimeAccessCheck;
 
+    /**
+     * Sets a predicate which will be used to assert a valid calling context for a call to
+     * {@link #runtime()}. This is useful for verifying execution scopes that should not make a
+     * static access to {@link HotSpotGraalRuntime}. Such scopes are responsible for resetting the
+     * predicate to null.
+     */
     public static void setRuntimeAccessCheck(Predicate<Void> predicate) {
+        assert runtimeAccessCheck == null || predicate == null : "at most once runtime access check can be active";
         runtimeAccessCheck = predicate;
     }