public class Reflection extends Object
Modifier and Type | Field and Description |
---|---|
static boolean |
bytecodeReflection
Perform reflection using bytecodes (true) or out-of-line machine code (false)
|
static boolean |
cacheInvokerInJavaLangReflect
Cache the reflective method invoker in JavaLangReflect?
|
private static byte[] |
emptyByteArray |
private static double[] |
emptyDoubleArray |
private static WordArray |
emptyWordArray |
private static boolean |
firstUse |
static int |
REFLECTION_FPRS_BITS |
static int |
REFLECTION_FPRS_MASK |
static int |
REFLECTION_GPRS_BITS |
static int |
REFLECTION_GPRS_MASK |
Constructor and Description |
---|
Reflection() |
Modifier and Type | Method and Description |
---|---|
static Object |
invoke(RVMMethod method,
ReflectionBase invoker,
Object thisArg,
Object[] otherArgs,
boolean isNonvirtual)
Call a method.
|
static boolean |
needsCheckArgs(ReflectionBase invoker)
Does the reflective method scheme need to check the arguments are valid?
|
private static Object |
outOfLineInvoke(RVMMethod method,
Object thisArg,
Object[] otherArgs,
boolean isNonvirtual) |
static boolean |
unwrapBoolean(Object o) |
static int |
unwrapBooleanAsInt(Object o) |
static byte |
unwrapByte(Object o) |
static char |
unwrapChar(Object o) |
static double |
unwrapDouble(Object o) |
static float |
unwrapFloat(Object o) |
static int |
unwrapInt(Object o) |
static long |
unwrapLong(Object o) |
static Address |
unwrapObject(Object o) |
static short |
unwrapShort(Object o) |
static Object |
wrapBoolean(int b) |
static Object |
wrapByte(byte b) |
static Object |
wrapChar(char c) |
static Object |
wrapDouble(double d) |
static Object |
wrapFloat(float f) |
static Object |
wrapInt(int i) |
static Object |
wrapLong(long l) |
static Object |
wrapShort(short s) |
public static boolean bytecodeReflection
public static boolean cacheInvokerInJavaLangReflect
public static final int REFLECTION_GPRS_BITS
public static final int REFLECTION_GPRS_MASK
public static final int REFLECTION_FPRS_BITS
public static final int REFLECTION_FPRS_MASK
private static final WordArray emptyWordArray
private static final double[] emptyDoubleArray
private static final byte[] emptyByteArray
private static boolean firstUse
public Reflection()
public static boolean needsCheckArgs(ReflectionBase invoker)
invoker
- the invoker to use for the reflective invokationpublic static Object invoke(RVMMethod method, ReflectionBase invoker, Object thisArg, Object[] otherArgs, boolean isNonvirtual)
method
- method to be calledinvoker
- the invoker to use for the invocation, may be null
in
certain casesthisArg
- "this" argument (ignored if method is static)otherArgs
- remaining argumentsisNonvirtual
- flag is false
if the method of the real class of this
object is to be invoked; true
if a method of a superclass may be invokedprivate static Object outOfLineInvoke(RVMMethod method, Object thisArg, Object[] otherArgs, boolean isNonvirtual)
public static Object wrapBoolean(int b)
public static Object wrapDouble(double d)
public static int unwrapBooleanAsInt(Object o)
public static boolean unwrapBoolean(Object o)
public static byte unwrapByte(Object o)
public static char unwrapChar(Object o)
public static short unwrapShort(Object o)
public static long unwrapLong(Object o)
public static float unwrapFloat(Object o)
public static double unwrapDouble(Object o)
public static Address unwrapObject(Object o)