Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java @ 10649:ac8b195fd3aa
New unsafe cast CompilerDirectives method in Truffle API.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sun, 07 Jul 2013 23:51:52 +0200 |
parents | 0fccad3ce40d |
children | b6e46324233f |
comparison
equal
deleted
inserted
replaced
10648:8660a090c3e2 | 10649:ac8b195fd3aa |
---|---|
124 */ | 124 */ |
125 @Retention(RetentionPolicy.RUNTIME) | 125 @Retention(RetentionPolicy.RUNTIME) |
126 @Target({ElementType.METHOD}) | 126 @Target({ElementType.METHOD}) |
127 public @interface Unsafe { | 127 public @interface Unsafe { |
128 } | 128 } |
129 | |
130 /** | |
131 * Treats the given value as a value of the given class. The class must evaluate to a constant. | |
132 * | |
133 * @param value the value that is known to have the specified type | |
134 * @param clazz the specified type of the value | |
135 * @return the value | |
136 */ | |
137 @Unsafe | |
138 public static Object unsafeCast(Object value, Class clazz) { | |
139 return value; | |
140 } | |
129 } | 141 } |