# HG changeset patch # User Doug Simon # Date 1418289518 -3600 # Node ID 304b65422434e168d17d0b25629ce0a4d8a7a713 # Parent 74f612049e4e783b312c144c3380a716c35cf7ff improved javadoc diff -r 74f612049e4e -r 304b65422434 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java --- 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 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 predicate) { + assert runtimeAccessCheck == null || predicate == null : "at most once runtime access check can be active"; runtimeAccessCheck = predicate; }