# HG changeset patch # User Thomas Wuerthinger # Date 1367013851 -7200 # Node ID 0fccad3ce40d36d617c8b85603691b97c88733fe # Parent 927e0792094bab2126ad2fd781494b7c4b8da8dc Introduce CompilerDirectives.Unsafe. Mark Frame.getArguments method as unsafe. diff -r 927e0792094b -r 0fccad3ce40d graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java --- 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 { + } } diff -r 927e0792094b -r 0fccad3ce40d graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/Frame.java --- 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 getArguments(Class clazz); /**