Mercurial > hg > truffle
changeset 9349:0fccad3ce40d
Introduce CompilerDirectives.Unsafe. Mark Frame.getArguments method as unsafe.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sat, 27 Apr 2013 00:04:11 +0200 |
parents | 927e0792094b |
children | 6bb12a72d26b cc2149467eed 412f6e6dad73 |
files | graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/Frame.java |
diffstat | 2 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java Fri Apr 26 23:03:09 2013 +0200 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java Sat Apr 27 00:04:11 2013 +0200 @@ -117,4 +117,13 @@ @Target({ElementType.FIELD}) public @interface CompilationFinal { } + + /** + * Marks methods that are considered unsafe. Wrong usage of those methods can lead to unexpected + * behavior including a crash of the runtime. Therefore, special care should be taken. + */ + @Retention(RetentionPolicy.RUNTIME) + @Target({ElementType.METHOD}) + public @interface Unsafe { + } }
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/Frame.java Fri Apr 26 23:03:09 2013 +0200 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/Frame.java Sat Apr 27 00:04:11 2013 +0200 @@ -45,6 +45,7 @@ * @param clazz the known type of the arguments object as a compile time constant * @return the arguments used when calling this method */ + @CompilerDirectives.Unsafe <T extends Arguments> T getArguments(Class<T> clazz); /**