public class Util extends Object
Util class contains a motley collection of utility methods used throughout the
compiler.| Constructor and Description |
|---|
Util() |
| Modifier and Type | Method and Description |
|---|---|
static <T> void |
atPutGrow(List<T> list,
int pos,
T x,
T filler)
Sets the element at a given position of a list and ensures that this position exists.
|
static byte[] |
hexStringToBytes(String hex)
Converts a hex string to a byte array.
|
static String |
indent(String lines,
String indentation)
Prepends the String
indentation to every line in String lines, including a
possibly non-empty line following the final newline. |
static JavaConstant |
one(JavaKind kind)
Returns the one value for a given numeric kind.
|
static void |
printInlining(ResolvedJavaMethod method,
int bci,
int inliningDepth,
boolean success,
String msg,
Object... args)
Print a HotSpot-style inlining message to the console.
|
static void |
setAccessible(Executable executable,
boolean flag)
|
static void |
setAccessible(Field field,
boolean flag)
|
static <T> T |
uncheckedCast(Class<T> type,
Object object)
Statically cast an object to an arbitrary Object type.
|
static <T> T |
uncheckedCast(Object object)
Statically cast an object to an arbitrary Object type.
|
static JavaConstant |
zero(JavaKind kind)
Returns the zero value for a given numeric kind.
|
public static <T> T uncheckedCast(Class<T> type, Object object)
public static <T> T uncheckedCast(Object object)
public static <T> void atPutGrow(List<T> list, int pos, T x, T filler)
list - the list to put the element intopos - the position at which to insert the elementx - the element that should be insertedfiller - the filler element that is used for the intermediate positions in case the list
is shorter than pospublic static String indent(String lines, String indentation)
indentation to every line in String lines, including a
possibly non-empty line following the final newline.public static JavaConstant zero(JavaKind kind)
public static JavaConstant one(JavaKind kind)
public static void printInlining(ResolvedJavaMethod method,
int bci,
int inliningDepth,
boolean success,
String msg,
Object... args)
public static void setAccessible(Field field, boolean flag)
public static void setAccessible(Executable executable, boolean flag)
public static byte[] hexStringToBytes(String hex)
hex - the hex string