use of org.vmmagic.pragma.Inline in project JikesRVM by JikesRVM.
the class VMCommonLibrarySupport method getLong.
@Inline(value = Inline.When.ArgumentsAreConstant, arguments = { 1 })
static long getLong(Object object, RVMField field, Field jlrField, RVMClass accessingClass) throws IllegalAccessException, IllegalArgumentException {
checkReadAccess(object, field, jlrField, accessingClass);
TypeReference type = field.getType();
if (type.isLongType()) {
return field.getLongValueUnchecked(object);
} else if (type.isIntType()) {
return field.getIntValueUnchecked(object);
} else if (type.isShortType()) {
return field.getShortValueUnchecked(object);
} else if (type.isCharType()) {
return field.getCharValueUnchecked(object);
} else if (type.isByteType()) {
return field.getByteValueUnchecked(object);
} else {
throwNewIllegalArgumentException("field type mismatch");
return 0L;
}
}
use of org.vmmagic.pragma.Inline in project JikesRVM by JikesRVM.
the class VMCommonLibrarySupport method invokeVirtual.
@Inline(value = Inline.When.ArgumentsAreConstant, arguments = { 2 })
private static Object invokeVirtual(Object receiver, Object[] args, RVMMethod method, Method jlrMethod, RVMClass accessingClass, ReflectionBase invoker) throws IllegalAccessException, IllegalArgumentException, ExceptionInInitializerError, InvocationTargetException {
// validate "this" argument
if (receiver == null) {
throwNewNullPointerException();
}
RVMClass declaringClass = method.getDeclaringClass();
if (!isArgumentCompatible(declaringClass, receiver)) {
throwNewIllegalArgumentException();
}
// Accessibility checks
if (!method.isPublic() && !jlrMethod.isAccessible()) {
checkAccess(method, accessingClass);
}
// find the right method to call
RVMClass C = Magic.getObjectType(receiver).asClass();
method = C.findVirtualMethod(method.getName(), method.getDescriptor());
// Invoke method
try {
return Reflection.invoke(method, invoker, receiver, args, false);
} catch (Throwable t) {
throw new InvocationTargetException(t);
}
}
use of org.vmmagic.pragma.Inline in project JikesRVM by JikesRVM.
the class VMCommonLibrarySupport method getChar.
@Inline(value = Inline.When.ArgumentsAreConstant, arguments = { 1 })
static char getChar(Object object, RVMField field, Field jlrField, RVMClass accessingClass) throws IllegalAccessException, IllegalArgumentException {
checkReadAccess(object, field, jlrField, accessingClass);
TypeReference type = field.getType();
if (!type.isCharType())
throwNewIllegalArgumentException("field type mismatch");
return field.getCharValueUnchecked(object);
}
use of org.vmmagic.pragma.Inline in project JikesRVM by JikesRVM.
the class Unsafe method putOrderedObject.
@Inline
public void putOrderedObject(Object obj, long offset, Object value) {
Offset off = Offset.fromLong(offset);
Magic.storeStoreBarrier();
if (NEEDS_OBJECT_PUTFIELD_BARRIER) {
objectFieldWrite(obj, value, off, 0);
} else {
Magic.setObjectAtOffset(obj, off, value);
}
}
use of org.vmmagic.pragma.Inline in project JikesRVM by JikesRVM.
the class Unsafe method putObjectVolatile.
@Inline
public void putObjectVolatile(Object obj, long offset, Object value) {
Offset off = Offset.fromLong(offset);
Magic.storeStoreBarrier();
if (NEEDS_OBJECT_PUTFIELD_BARRIER) {
objectFieldWrite(obj, value, off, 0);
} else {
Magic.setObjectAtOffset(obj, off, value);
}
Magic.fence();
}
Aggregations