Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java @ 11307:da412706d0fd
Small adjustment to CompilerDirectives.unsafeCast.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Wed, 14 Aug 2013 15:44:05 +0200 |
parents | 28da427847c5 |
children | f0c8303cf88e |
comparison
equal
deleted
inserted
replaced
11306:2a26b86d7724 | 11307:da412706d0fd |
---|---|
170 * @param value the value that is known to have the specified type | 170 * @param value the value that is known to have the specified type |
171 * @param clazz the specified type of the value | 171 * @param clazz the specified type of the value |
172 * @param customType the custom type that if present on a value makes this unsafe cast safe | 172 * @param customType the custom type that if present on a value makes this unsafe cast safe |
173 * @return the value | 173 * @return the value |
174 */ | 174 */ |
175 @SuppressWarnings("unchecked") | |
176 @Unsafe | 175 @Unsafe |
177 public static <T> T unsafeCast(Object value, Class<T> clazz, Object customType) { | 176 public static <T> T unsafeCast(Object value, Class<T> clazz, Object customType) { |
178 return (T) value; | 177 return unsafeCast(value, clazz); |
179 } | 178 } |
180 | 179 |
181 /** | 180 /** |
182 * Proxies a sun.misc.Unsafe instance into an instance that adds a custom location identity on | 181 * Proxies a sun.misc.Unsafe instance into an instance that adds a custom location identity on |
183 * its accesses. This means that the accesses on these kind of location identities can only | 182 * its accesses. This means that the accesses on these kind of location identities can only |