Search in sources :

Example 31 with Inline

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;
    }
}
Also used : TypeReference(org.jikesrvm.classloader.TypeReference) Inline(org.vmmagic.pragma.Inline) NoInline(org.vmmagic.pragma.NoInline)

Example 32 with Inline

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);
    }
}
Also used : RVMClass(org.jikesrvm.classloader.RVMClass) Inline(org.vmmagic.pragma.Inline) NoInline(org.vmmagic.pragma.NoInline)

Example 33 with Inline

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);
}
Also used : TypeReference(org.jikesrvm.classloader.TypeReference) Inline(org.vmmagic.pragma.Inline) NoInline(org.vmmagic.pragma.NoInline)

Example 34 with Inline

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);
    }
}
Also used : Offset(org.vmmagic.unboxed.Offset) Inline(org.vmmagic.pragma.Inline)

Example 35 with Inline

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();
}
Also used : Offset(org.vmmagic.unboxed.Offset) Inline(org.vmmagic.pragma.Inline)

Aggregations

Inline (org.vmmagic.pragma.Inline)110 NoInline (org.vmmagic.pragma.NoInline)42 Entrypoint (org.vmmagic.pragma.Entrypoint)40 Offset (org.vmmagic.unboxed.Offset)38 ObjectReference (org.vmmagic.unboxed.ObjectReference)35 Address (org.vmmagic.unboxed.Address)15 Word (org.vmmagic.unboxed.Word)15 TypeReference (org.jikesrvm.classloader.TypeReference)12 Uninterruptible (org.vmmagic.pragma.Uninterruptible)6 RVMType (org.jikesrvm.classloader.RVMType)5 RVMClass (org.jikesrvm.classloader.RVMClass)4 Unpreemptible (org.vmmagic.pragma.Unpreemptible)4 RVMClassLoader (org.jikesrvm.classloader.RVMClassLoader)3 TIB (org.jikesrvm.objectmodel.TIB)3 Extent (org.vmmagic.unboxed.Extent)3 MethodReference (org.jikesrvm.classloader.MethodReference)2 ForwardReference (org.jikesrvm.compilers.common.assembler.ForwardReference)2 RVMThread (org.jikesrvm.scheduler.RVMThread)2 CollectorContext (org.mmtk.plan.CollectorContext)2 NoNullCheck (org.vmmagic.pragma.NoNullCheck)2