Class<?>[] getExceptionTypes() { TypeReference[] exceptionTypes = method.getExceptionTypes(); if (exceptionTypes == null) { return new Class[0]; } else { return VMCommonLibrarySupport.typesToClasses(exceptionTypes); } }
@Inline( value = Inline.When.ArgumentsAreConstant, arguments = {0}) public T newInstance() throws IllegalAccessException, InstantiationException, ExceptionInInitializerError, SecurityException { // Basic checks checkMemberAccess(Member.PUBLIC); if (!type.isClassType()) throw new InstantiationException(); RVMClass cls = type.asClass(); if (cls.isAbstract() || cls.isInterface()) throw new InstantiationException(); // Ensure that the class is initialized if (!cls.isInitialized()) { RuntimeEntrypoints.initializeClassForDynamicLink(cls); } // Find the defaultConstructor RVMMethod defaultConstructor = getDefaultConstructor(); if (defaultConstructor == null) throw new InstantiationException(); // Check that caller is allowed to access it if (!defaultConstructor.isPublic()) { RVMClass accessingClass = RVMClass.getClassFromStackFrame(1); VMCommonLibrarySupport.checkAccess(defaultConstructor, accessingClass); } // Allocate an uninitialized instance; @SuppressWarnings("unchecked") // yes, we're giving an anonymous object a type. T obj = (T) RuntimeEntrypoints.resolvedNewScalar(cls); // Run the default constructor on the it. Reflection.invoke(defaultConstructor, null, obj, null, true); return obj; }
public short getShort(Field f, Object object) throws IllegalAccessException, IllegalArgumentException { return VMCommonLibrarySupport.getShort(object, field, f, RVMClass.getClassFromStackFrame(2)); }
void setShort(Field f, Object object, short value) throws IllegalAccessException, IllegalArgumentException { VMCommonLibrarySupport.setShort(object, value, field, f, RVMClass.getClassFromStackFrame(2)); }
Object invoke(Object receiver, Object[] args, Method m) throws IllegalAccessException, IllegalArgumentException, ExceptionInInitializerError, InvocationTargetException { return VMCommonLibrarySupport.invoke( receiver, args, method, m, RVMClass.getClassFromStackFrame(2), invoker); }
Class<?>[] getParameterTypes() { return VMCommonLibrarySupport.typesToClasses(method.getParameterTypes()); }