Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/Frame.java @ 9330:e162d9e32830
Added a clazz parameter to Frame.getArguments in order to allow unsafe access to the arguments object (i.e., avoiding the null check and the type cast).
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Fri, 26 Apr 2013 17:15:10 +0200 |
parents | 07f8d136a05e |
children | 0fccad3ce40d |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/Frame.java Fri Apr 26 15:58:41 2013 +0200 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/Frame.java Fri Apr 26 17:15:10 2013 +0200 @@ -36,9 +36,16 @@ FrameDescriptor getFrameDescriptor(); /** + * Retrieves the arguments object from this frame. The runtime assumes that the arguments object + * is never null. Additionally, the runtime may assume that the given parameter indicating the + * class of the arguments object is correct. The runtime is not required to actually check the + * type of the arguments object. The parameter must be a value that can be reduced to a compile + * time constant. + * + * @param clazz the known type of the arguments object as a compile time constant * @return the arguments used when calling this method */ - Arguments getArguments(); + <T extends Arguments> T getArguments(Class<T> clazz); /** * Read access to a local variable of type {@link Object}.