comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java @ 12405:139b84d713bc

Truffle API adjustments: Simplify frame handling. Introduce cast for MaterializedFrame objects.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Mon, 14 Oct 2013 23:28:10 +0200
parents f753092f608d
children a9837a03127e
comparison
equal deleted inserted replaced
12404:47eb670c1634 12405:139b84d713bc
26 26
27 import java.lang.annotation.*; 27 import java.lang.annotation.*;
28 import java.lang.reflect.*; 28 import java.lang.reflect.*;
29 import java.util.concurrent.*; 29 import java.util.concurrent.*;
30 30
31 import com.oracle.truffle.api.frame.*;
32
31 import sun.misc.*; 33 import sun.misc.*;
32 34
33 /** 35 /**
34 * Directives that influence the optimizations of the Truffle compiler. All of the operations have 36 * Directives that influence the optimizations of the Truffle compiler. All of the operations have
35 * no effect when executed in the Truffle interpreter. 37 * no effect when executed in the Truffle interpreter.
163 public static <T> T unsafeCast(Object value, Class<T> type, boolean condition) { 165 public static <T> T unsafeCast(Object value, Class<T> type, boolean condition) {
164 return (T) value; 166 return (T) value;
165 } 167 }
166 168
167 /** 169 /**
170 * Asserts that this value is not null and retrieved from a call to Frame.materialize.
171 *
172 * @param value the value that is known to have been obtained via Frame.materialize
173 * @return the value to be casted to the new type
174 */
175 public static MaterializedFrame unsafeFrameCast(MaterializedFrame value) {
176 return value;
177 }
178
179 /**
168 * Unsafe access to a boolean value within an object. The condition parameter gives a hint to 180 * Unsafe access to a boolean value within an object. The condition parameter gives a hint to
169 * the compiler under which circumstances this access can be moved to an earlier location in the 181 * the compiler under which circumstances this access can be moved to an earlier location in the
170 * program. The location identity gives a hint to the compiler for improved global value 182 * program. The location identity gives a hint to the compiler for improved global value
171 * numbering. 183 * numbering.
172 * 184 *