public abstract class StaticFieldReader extends Object
Constructor and Description |
---|
StaticFieldReader() |
Modifier and Type | Method and Description |
---|---|
private static void |
assertNotReached() |
static Address |
getAddressStaticFieldValue(RVMField field)
Returns the current contents of a Address static field.
|
static double |
getDoubleStaticFieldValue(RVMField field)
Returns the current contents of a double static field.
|
static ConstantOperand |
getFieldValueAsConstant(RVMField field,
Object obj) |
static float |
getFloatStaticFieldValue(RVMField field)
Returns the current contents of a float static field.
|
static int |
getIntStaticFieldValue(RVMField field)
Returns the current contents of an int-like static field.
|
private static Field |
getJDKField(RVMField field)
Converts a RVMField to a java.lang.reflect.Field.
|
static long |
getLongStaticFieldValue(RVMField field)
Returns the current contents of a long static field.
|
static Object |
getObjectStaticFieldValue(RVMField field)
Returns the current contents of a reference static field.
|
static ConstantOperand |
getStaticFieldValue(RVMField field)
Returns a constant operand with the current value of a static field.
|
static TypeReference |
getTypeFromStaticField(RVMField field)
Get the type of an object contained in a static field.
|
static boolean |
isStaticFieldNull(RVMField field)
Does a static field null contain
null ? |
private static void |
throwNoSuchFieldExceptionWithCause(RVMField field,
Throwable cause) |
private static void |
throwOptimizingCompilerExceptionBecauseOfIllegalAccess(RVMField field,
Throwable e) |
public StaticFieldReader()
public static ConstantOperand getFieldValueAsConstant(RVMField field, Object obj) throws NoSuchFieldException
NoSuchFieldException
public static ConstantOperand getStaticFieldValue(RVMField field) throws NoSuchFieldException
field
- the static field whose current value we want to readNoSuchFieldException
- when the field could not be foundpublic static int getIntStaticFieldValue(RVMField field) throws NoSuchFieldException
field
- a static fieldNoSuchFieldException
- when the field could not be foundpublic static float getFloatStaticFieldValue(RVMField field) throws NoSuchFieldException
field
- a static fieldNoSuchFieldException
- when the field could not be foundpublic static long getLongStaticFieldValue(RVMField field) throws NoSuchFieldException
field
- a static fieldNoSuchFieldException
- when the field could not be foundpublic static double getDoubleStaticFieldValue(RVMField field) throws NoSuchFieldException
field
- a static fieldNoSuchFieldException
- when the field could not be foundpublic static Object getObjectStaticFieldValue(RVMField field) throws NoSuchFieldException
field
- a static fieldNoSuchFieldException
- when the field could not be foundpublic static Address getAddressStaticFieldValue(RVMField field) throws NoSuchFieldException
field
- a static fieldNoSuchFieldException
- when the field could not be foundpublic static boolean isStaticFieldNull(RVMField field) throws NoSuchFieldException
null
?field
- a static fieldtrue
if the field contains null
, false
otherwiseNoSuchFieldException
- when the field could not be foundpublic static TypeReference getTypeFromStaticField(RVMField field) throws NoSuchFieldException
field
- a static fieldNoSuchFieldException
- when the field could not be foundprivate static Field getJDKField(RVMField field) throws NoSuchFieldException
field
- the internal field representationNoSuchFieldException
- when the field could not be foundprivate static void throwOptimizingCompilerExceptionBecauseOfIllegalAccess(RVMField field, Throwable e)
private static void throwNoSuchFieldExceptionWithCause(RVMField field, Throwable cause) throws NoSuchFieldException
NoSuchFieldException
private static void assertNotReached()