diff graal/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleRuntime.java @ 18220:890d284b2771

Truffle: add TruffleRuntime#getCapability method
author Andreas Woess <andreas.woess@jku.at>
date Thu, 30 Oct 2014 17:04:16 +0100
parents 7b45e33b7986
children 656331a61829
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleRuntime.java	Thu Oct 30 16:32:31 2014 +0100
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleRuntime.java	Thu Oct 30 17:04:16 2014 +0100
@@ -139,6 +139,14 @@
     FrameInstance getCurrentFrame();
 
     /**
+     * Requests a capability from the runtime.
+     *
+     * @param capability the type of the interface representing the capability
+     * @return an implementation of the capability or {@code null} if the runtime does not offer it
+     */
+    <T> T getCapability(Class<T> capability);
+
+    /**
      * Returns a list of all still referenced {@link RootCallTarget} instances that were created
      * using {@link #createCallTarget(RootNode)}.
      */